What is BYOK for LLM APIs?

BYOK (Bring Your Own Key) — a configuration in which a developer uses their own provider API keys (OpenAI, Anthropic, Google, etc.) through an LLM gateway, so requests are billed against the developer's direct provider accounts rather than the gateway's pooled rates. The gateway still handles routing, fallback, observability, and wire-format normalization, but the underlying token spend goes to the developer's provider bills.

When BYOK makes sense

When managed (gateway-owned keys) makes sense

How BYOK works on GammaInfra

BYOK is configured per provider in the dashboard at dashboard.gammainfra.com. Add an OpenAI key, Anthropic key, Google key, etc., and the gateway will use those keys for the matching provider in any fallback chain.

BYOK has a separate prepaid balance from the managed balance — byok_credit_balance_usd. Per-request fee is 1% of retail cost_usd during the launch window (2% standard). When the BYOK balance hits zero, requests return 402 byok_balance_empty — never a silent fallback to the managed balance. Top up the BYOK balance via POST /v1/billing/byok/checkout (no top-up fee, $5 minimum).

Mixed BYOK + managed routing

You can BYOK a subset of providers. The gateway uses your key when one is configured for the request's resolved provider; otherwise it uses its managed key. This is the most common production setup — BYOK the providers where you have negotiated rates or compliance requirements, let the gateway pool the rest.

Per-request, the X-GammaInfra-Endpoint response header tells you which provider/model served the call. The dashboard's request log shows whether each request was billed against the managed or BYOK balance.

Common questions

Does BYOK mean the gateway has zero access to my provider account?
The gateway has authenticated access to make API calls on your behalf via the keys you provide — that's how it dispatches your requests. It does not have access to your provider dashboard, billing, or account settings. Keys are encrypted at rest (typically with a per-tenant Fernet or AES-GCM cipher). You can revoke a BYOK key in the gateway dashboard at any time.
Can I mix BYOK and managed routing for different providers?
Yes — this is the most common setup in practice. BYOK the providers where you have existing relationships or rate-negotiated contracts (often OpenAI and Anthropic), let the gateway pool the rest (Mistral, Groq, DeepSeek, xAI, Bedrock). Per-request the gateway uses your BYOK key when one is configured for the resolved provider, otherwise its managed key.
What happens to my provider rate limits when I BYOK?
Your own. The gateway makes requests against your provider account, so your per-account rate limits apply. The gateway will still cascade through the fallback chain on rate-limit errors — if your OpenAI key gets throttled, the next provider in the chain takes over. If that next provider is also BYOK, it uses that key; otherwise it falls back to managed.
How is BYOK pricing different from managed pricing on GammaInfra?
Managed: 0% token markup, pass-through provider rates, 3–5% fee at top-up time. BYOK: you pay provider rates directly to the provider (gateway doesn't touch token billing), 1–2% per-request fee on retail cost_usd against a separate prepaid BYOK balance. BYOK makes sense when you have negotiated provider rates or compliance reasons to keep provider billing direct. Managed makes sense when you want the gateway's pooled rate limits and unified billing.
Is BYOK supported on Amazon Bedrock too?
Yes for accounts that have either a long-term Bedrock Bearer token or an IAM-with-SigV4 identity with bedrock:InvokeModel permissions. Bedrock BYOK behaves the same as other providers — the gateway uses your AWS credentials to invoke models in your AWS account, and you receive Bedrock's bill on your AWS invoice.

Try the gateway

Get a GammaInfra API key →

$3 free trial credit on signup, $10 minimum top-up. Pass-through provider rates plus 3% top-up fee during the launch window (5% after 2026-06-23).

Last updated 2026-05-15.