Overview
Passthrough integrations let you call provider-native API paths and payloads through Bifrost without route-level request/response conversion. When you use passthrough endpoints, the request still flows through Bifrost core logic. You keep Bifrost features such as logging and observability while sending provider-native paths and bodies.Endpoints
/openai_passthroughDefault provider:openai/anthropic_passthroughDefault provider:anthropic/azure_passthroughDefault provider:azure/genai_passthroughDefault provider:gemini(with automatic Vertex detection for clients configured to use Vertex)/bedrock_passthroughDefault provider:bedrock(restricted to three operations, see Bedrock Passthrough)
How It Works
- Send your request to a passthrough endpoint (OpenAI, Anthropic, Azure, or GenAI passthrough).
- The integration strips the passthrough prefix and forwards the remaining provider-native path/body.
- Bifrost picks the provider key. Client-supplied provider credentials (
authorization,api-key,x-api-key,x-goog-api-key) are stripped from the request, and Bifrost selects a key from its own key config for the resolved provider and model. - Bifrost handles provider execution through core inference and plugin pipelines.
- Response status, headers, and body are returned as passthrough output (for both stream and non-stream requests).
When the URL path names a model (for example
models/{model} or a deployment path), Bifrost uses that model. Otherwise, for JSON bodies, it reads the model from the top-level model key, the same key the provider reads. Virtual-key model restrictions apply to whichever model was resolved. A JSON body must carry that key at most once, spelled exactly model (lowercase), with a string value; a body that repeats it (in any letter case), spells it differently, gives it a non-string value, or is not valid JSON while sent as application/json is rejected with 400. Bodies without a model key and multipart bodies are unaffected.Claude Code OAuth sign-in (
Authorization: Bearer sk-ant-oat…) is handled separately on the regular /anthropic route, where Bifrost forwards the caller’s token instead of selecting a key. Point Claude Code there — no passthrough endpoint needed. See Claude Code authentication.Provider Selection Rules
OpenAI Passthrough
- Uses
openaias the default provider.
Anthropic Passthrough
- Uses
anthropicas the default provider.
Azure Passthrough
- Uses
azureas the default provider. - Requires an Azure key with
endpointconfigured. api-versionhandling varies by route:/openai/deployments/routes: if the caller omitsapi-version, Bifrost injects a default (2025-04-01-preview). Pass your ownapi-versionto override — for example, to pin to a GA version or use a specific preview version.
Bedrock Passthrough
-
Uses
bedrockas the default provider. -
Not a general AWS proxy. Bifrost forwards only the Bedrock operations it has no native route for, and refuses every other path, method or malformed identifier with a
400before any request is built: -
Identifiers follow the character sets AWS documents for each parameter: agent, alias, knowledge-base and guardrail ids are alphanumeric, a session id may also contain
.,_,:and-(but never consists only of dots), and a guardrail version isDRAFTor a number from 1 to 8 digits. An ARN is not accepted in place of an id. -
The host comes from the key’s
region(or itsendpointsoverrides). Credentials in the incoming request are never forwarded.InvokeAgentandRetrieveare always signed with the key’s AWS credentials (SigV4, servicebedrock), because AWS does not accept Bedrock API keys for Agents Runtime operations: a key that holds only an API key is refused with a400for those two operations, so select a key that has an access key and secret key or a role (for example withx-bf-api-key).ApplyGuardrailsends the key’s Bedrock API key as a bearer token when it has one, and is SigV4-signed otherwise. -
The AWS status and body come back unchanged, together with the response headers Bifrost forwards, including
Content-TypeandX-Amzn-*such asX-Amzn-ErrortypeandX-Amzn-Requestid. Transport-level headers (for exampleContent-Length,Content-Encoding,Transfer-Encoding,ConnectionandDate) and credential-bearing ones (Set-Cookie, anything that looks like an API key or secret, andX-Amzn-Oidc-*) are removed, so an upstreamResourceNotFoundExceptionstill reaches the caller with its exception type.InvokeAgentis forwarded to the client as AWS produces it, so a long agent run is not buffered and is not bound by the gateway’s whole-response timeout (only a stalled connection ends it, via the stream idle timeout).RetrieveandApplyGuardrailare returned as a single response.
GenAI Passthrough
- Uses
geminiby default. - Automatically switches to
vertexwhen Vertex patterns are detected, such as:- URL path containing
/projects/{PROJECT_ID}/locations/{LOCATION}/ - Request body
modelcontaining a Vertex resource path - OAuth token pattern typically used for Vertex (
Bearer ya29...)
- URL path containing
Usage Examples
OpenAI Passthrough
- Python SDK
- cURL
Anthropic Passthrough
- Python SDK
- cURL
Azure Passthrough
- Azure OpenAI SDK
- OpenAI SDK
- Anthropic SDK (Anthropic on Azure)
- cURL
Bedrock Passthrough
GenAI Passthrough (Gemini)
- Python SDK
- cURL
GenAI Passthrough (Vertex-style request)
- Python SDK
- cURL
Notes
- Use passthrough when you need a provider endpoint that is not directly supported by Bifrost integration routes yet.
- Provider key selection is done by Bifrost, not by the caller. On every passthrough endpoint, the client’s
authorization,api-key,x-api-key, andx-goog-api-keyheaders are dropped before the request leaves Bifrost, and the upstream auth header (including Azure’sapi-key/ OAuth token) is set from the Bifrost key config. - The only exception is direct API keys, which need both the server-side
allow_direct_keyssetting and a per-requestx-bf-direct-key: trueheader. Without both, a raw provider key in the request is ignored. - For Azure
/openai/deployments/routes, Bifrost injectsapi-version=2025-04-01-previewwhen the caller does not supply one. Supply your ownapi-versionquery parameter to use a different version (e.g.2024-10-21for the latest GA, or a newer preview).

