Skip to content

Model Providers

Model providers are the upstream inference targets behind the AI Gateway. The project provider catalog describes what an adapter can support; provider keys and model mappings describe what the project is allowed to route.

View as Markdown Open the plain-text version of this page.
Application Project API key AI Gateway Project provider key Upstream credential and model

Provider model#

Four layers have distinct responsibilities:

Layer Responsibility
Provider catalog Built-in adapter, endpoint families, features, aliases, and model metadata
Provider key Project-scoped target, secret, priority, timeout, endpoint, and headers
Model mapping Public Gateway model id to upstream model id plus endpoint and features
Pricing metadata Cost estimation and trace enrichment only

Pricing metadata is not routing truth. Adding a price entry does not make a model routable; a target still needs a configured provider key and an eligible binding.

Target access boundaries#

Access mode Credential owner Notes Availability
Bring your own key (BYOK) Project provider key holds the upstream secret Caller sends only the Provon project key; the Gateway adds the upstream secret Self-hosted Node runtime and hosted edge (Cloudflare Worker); both resolve provider keys from the shared metadata store
Managed catalog exposed by the operator Deployment operator supplies the upstream target Callers see model names only; no caller-configured upstream key or vendor target Only on deployments the operator configured to serve those models

BYOK is the portable default: the application authenticates to Provon with its project API key; the Gateway authenticates upstream with the provider key it stores server-side.

When a deployment serves a managed catalog, those models appear as read-only entries in Providers. Callers never set an upstream key, base URL, or vendor preference for them, and the application sees only the public model names. Self-hosted deployments do not add a managed catalog by changing pricing metadata.

Provider types#

Type Examples Configuration
Native provider adapter Anthropic, Gemini, Cohere, Cloudflare Workers AI The Gateway translates supported OpenAI request shapes
OpenAI-compatible provider OpenAI, OpenRouter, Groq, Mistral, DeepSeek, Kimi, Qwen, GLM The Gateway forwards compatible endpoint shapes
Deployment-specific provider Azure OpenAI, Gemini Enterprise Requires a project or deployment base URL
Custom public endpoint OpenAI-compatible vendor endpoint, NVIDIA NIM Requires an allowed public HTTP(S) base URL

The runtime provider catalog is the source of truth. Query it instead of maintaining a static provider list in application code:

bash
export PROVON_API_URL="https://api.provon.dev/v1"

curl "$PROVON_API_URL/gateway/providers" \
  -H "Authorization: Bearer $PROVON_API_KEY"

Connect a provider#

In the Workbench:

  1. Open Providers and choose a provider.
  2. Under Provider keys, create a key with a descriptive name.
  3. Add the upstream API key. You can add more than one credential later for load balancing or rotation.
  4. Keep the official endpoint, or enter an allowed override where the provider supports one.
  5. Optionally add header overrides that the Gateway sends only to this provider key.
  6. Choose All or Specific model mapping mode.
  7. Keep the provider key enabled.
  8. Send a test request and verify its trace.

Success checks#

  • provon gateway status lists the provider key as enabled, or the Workbench key row shows enabled state.
  • A test request returns 2xx and a trace shows the selected provider key and upstream model id.
  • A key you disabled disappears from eligible targets in capability discovery.

Header overrides are useful for provider-specific metadata such as routing tags, but they are privileged configuration: treat them as capable of carrying secrets. The application never receives the upstream credential or these overrides; it calls the Gateway with a project API key that has gateway:invoke.

Custom providers#

A custom provider has a project-scoped routing id and uses a built-in protocol driver. The openai-compatible driver covers OpenAI-compatible HTTP endpoints; user configuration never supplies executable adapter code.

Choose one endpoint mode:

Mode Behavior
API base URL The Gateway appends the OpenAI-compatible operation path
Exact endpoint URL The Gateway sends Chat Completions requests to the configured URL as-is

Configure Responses API independently for each custom provider:

Mode Behavior
Off The provider is not eligible for /responses requests
Native The Gateway sends the request to the upstream /responses endpoint
Via Chat Completions Stateless Responses requests and responses are translated through Chat Completions

The compatibility mode supports text, image input, function calling, structured output, usage metadata, and streaming. It intentionally rejects stateful fields such as previous_response_id, conversation, store: true, and background: true.

For example, an exact endpoint configured as https://models.example/custom/chat receives:

json
{
  "model": "acme-kimi/kimi-2.7-code",
  "messages": [{ "role": "user", "content": "Hello" }]
}

The acme-kimi prefix selects the project-defined custom provider; the upstream receives kimi-2.7-code.

Provider key priority#

A project can configure multiple provider keys for the same provider. Drag keys to set priority. Matching requests use the first eligible key after capability, policy, health, and load-balancing decisions.

Use separate provider keys for:

  • regions or provider deployments;
  • independent upstream accounts;
  • isolated model allowlists;
  • distinct timeout or header requirements;
  • ordered recovery targets.

Do not duplicate a key only to rename the same secret. Use one target per operational boundary.

Multiple credentials and load balancing#

A single provider key can hold more than one upstream credential. The runtime selects the active credential using credential priority and the key's load-balance policy. This lets you spread load across several API keys, rotate a secret without downtime, or isolate keys with different rate-limit headroom.

See Routing and reliability for the load-balance strategies and configuration example.

Model mappings#

Provider keys support two modes:

Mode Behavior
All The key can route provider-compatible model ids without explicit mappings
Specific Only enabled model mappings are eligible

An explicit mapping contains:

Field Meaning
AI Gateway model Public model id sent by the application
Upstream model Model id sent to the provider
Endpoint types Endpoint families this mapping may serve
Features Streaming, tool calling, vision input, reasoning, or other requirements
Context window Selection and UI metadata
Max output tokens Selection and UI metadata
Pricing metadata Cost calculation metadata

Example:

text
AI Gateway model: support-model
Upstream model:   gpt-4o-mini
Endpoints:        chat-completions, responses
Features:         streaming, tool-calling, structured-outputs

The application can then send the provider-qualified public id:

json
{
  "model": "openai/support-model"
}

Plain "support-model" requests require a matching model policy or registry inference. See Routing and reliability.

Capability discovery#

Do not assume endpoint parity between providers or between two provider keys for the same provider.

bash
curl "$PROVON_API_URL/gateway/capability-matrix?includeDisabled=false" \
  -H "Authorization: Bearer $PROVON_API_KEY"

The matrix includes:

  • recognized endpoint families;
  • provider-native, translated, bridged, and unsupported status;
  • provider feature declarations;
  • enabled provider keys and credentials;
  • model mappings and their endpoint and feature declarations.

Filter model selection for the exact request shape:

bash
curl \
  "$PROVON_API_URL/gateway/model-selection?endpoint=responses&features=streaming,tool-calling" \
  -H "Authorization: Bearer $PROVON_API_KEY"

Custom OpenAI-compatible targets#

Use the openai-compatible provider for a user-owned endpoint that implements supported OpenAI request and response shapes.

Configure:

  • a public HTTP(S) base URL; use HTTPS for production traffic;
  • a provider key secret;
  • explicit model mappings when the target should expose only named logical models;
  • accurate endpoint and feature declarations for mapped models;
  • an attempt timeout.

The URL validator rejects credentials in URLs, query strings, and fragments; for custom-base-url providers it also rejects loopback and internal hostnames and private or reserved IP literals. A deployment may additionally inject DNS resolution policy so that public names resolving to any non-public address are rejected too. Official provider adapters keep their fixed official endpoint unless their manifest explicitly allows an override.

Do not point a public custom provider key at a loopback or internal service.

Advanced provider key settings#

Provider keys can define:

  • per-attempt timeout;
  • header overrides sent only to that target;
  • retry policy;
  • fallback status and network-error policy;
  • circuit-breaker policy;
  • priority and credential ordering.

The Workbench exposes the commonly used timeout and header controls; provider key management APIs carry the reliability policy fields used by runtime adapters.

Recovery remains capability-aware: an alternate key or model that cannot satisfy the request is not a valid fallback.

Trace evidence#

When Trace Capture selects a request, the trace can show:

  • selected provider, provider key, and credential fingerprint;
  • requested, Gateway, and upstream model ids;
  • translated or bridged operation shape;
  • every provider attempt and fallback index;
  • latency and time to first chunk;
  • token, cache, reasoning, and cost fields;
  • normalized provider errors and guardrail outcomes.

See Gateway tracing.

Security#

  • Store upstream credentials only in project-scoped provider keys.
  • Give calling applications Provon project API keys.
  • Use Specific mappings for strict model allowlists.
  • Rotate upstream and project keys independently.
  • Restrict custom endpoints to intended public hosts.
  • Treat header overrides as secrets-capable configuration.
  • Do not expose model servers directly when the Gateway is the control point.