Overview
The passthrough API proxies provider-native requests through GoModel without translating the request or response body. Use it when a client library expects a provider’s native API instead of the OpenAI-compatible API. For example, the Anthropic SDK sends requests to/v1/messages, so you can point it at GoModel’s Anthropic passthrough base URL:
v1 segment and forwards the request upstream
as Anthropic’s native:
How it works
Passthrough routes use this shape:ALLOW_PASSTHROUGH_V1_ALIAS=true, which is the default:
GOMODEL_MASTER_KEY or
managed auth keys are enabled, the client must send a GoModel bearer token:
Authorization and X-Api-Key headers before forwarding
the request, then applies the upstream provider credential configured on the
server. For Anthropic, GoModel uses its configured ANTHROPIC_API_KEY.
Because passthrough is provider-native, the response is also provider-native.
For Anthropic messages, the response uses Anthropic’s message schema, not an
OpenAI chat completion schema.
When usage tracking is enabled, successful passthrough inference responses
are recorded: token counts are read from SSE usage events on streaming
responses and from the usage member of JSON responses, so costs and budgets
account for passthrough traffic like any other route.
Access control
Passthrough reaches the provider account directly with the server’s credential, including routes the gateway cannot scope to a caller, such asGET /files. Access is therefore limited:
GOMODEL_MASTER_KEY— always has passthrough access.- Managed API keys — created without passthrough access by default. Keys
that existed before passthrough access was introduced keep it. A key without
access gets
403with error codepassthrough_access_denied. - Model allowlists — a body that names a
modelis checked against the caller’s allowlist. A request that names no model acts on the whole provider, so the allowlist must grant the whole provider (anthropic/) or everything (/). A key limited toanthropic/claude-sonnet-4-6can callPOST /p/anthropic/v1/messagesfor that model, but notGET /p/anthropic/v1/models.
"passthrough_access": true
on POST /admin/auth-keys), on the dashboard’s API Keys page, or later.
Only a global admin credential (the master key or a dashboard key without a
user path) can grant it, because a passthrough key reaches beyond any user
path; a user-path scoped admin gets 403 admin_scope_denied but can revoke it.
Anthropic SDK example
Set the Anthropic SDK base URL to GoModel’s Anthropic passthrough route. Use the GoModel token as Anthropic SDK bearer auth.not-needed instead of auth_token or authToken. GoModel strips X-Api-Key
from passthrough requests before forwarding them upstream.
Current limitations
Passthrough is intentionally narrow while the API is in beta.openai,anthropic,openrouter,kilo,zai,sglang,vllm,llamacpp,llmd,deepseek,edenai, andjevare enabled by default.- Chutes supports passthrough but requires explicit operator opt-in because
passthrough can forward provider-native routes that do not identify a model.
Add
chutestoENABLED_PASSTHROUGH_PROVIDERSonly when you intend to expose that surface. - GoModel does not translate passthrough request bodies or response bodies.
- The
modela JSON passthrough body names is checked against the caller’s model allowlist regardless of body size, up to the configured body limit; a larger body is refused with the limit’s own error. A body that repeats the top-levelmodelfield is rejected, since the upstream would decide which one wins. A request that names no model needs a provider-wide grant (see Access control). - The upstream account is shared. A key with passthrough access can reach
objects on it, such as files or batches, that other keys created. Grant
passthrough_accessonly to keys you trust with the whole provider account. - Provider-native error bodies and status codes are proxied instead of converted into OpenAI-compatible responses, so provider SDKs raise their own typed errors. Errors raised by GoModel itself (authentication, rate limits, budgets, a provider that is not enabled, an unreachable upstream) use the gateway’s error shape, as does an upstream error body that is not JSON or is larger than 1 MiB.
- Features that depend on OpenAI-compatible request or response shapes may not
apply to passthrough traffic in the same way as
/v1traffic.
Related environment variables
Passthrough routes are enabled by default:ENABLED_PASSTHROUGH_PROVIDERS to the provider types you want to expose.