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
- Existing provider relationships. If you've already negotiated rates with OpenAI or have committed-use Bedrock contracts on AWS, BYOK keeps that economics in place while adding gateway features (routing, fallback, headers).
- Compliance and audit. Some enterprises need provider bills to land directly on their own accounts for SOC2 / GDPR / data-residency audit trails. BYOK puts the provider relationship between the customer and the provider with no third party in the billing path.
- Free-tier consumption. Some providers ship monthly free-tier credits that only redeem against the developer's account. BYOK lets you burn that free tier through the gateway.
- Region-specific accounts. If you have an EU-only OpenAI account or an APAC-only Bedrock IAM identity, BYOK lets the gateway use them for region-constrained requests.
When managed (gateway-owned keys) makes sense
- Day-one simplicity. One API key from the gateway covers every major provider. No need to register and provision N provider accounts before going live.
- Higher pooled rate limits. The gateway aggregates customer traffic against its negotiated provider quotas. A small customer benefits from the pool rather than running into per-account limits early.
- Unified billing. One top-up funds requests across all providers. No reconciliation across N provider invoices.
- 0% token markup. Pass-through provider rates with the gateway fee on top-up rather than per token (this is the GammaInfra model; others vary).
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?
Can I mix BYOK and managed routing for different providers?
What happens to my provider rate limits when I BYOK?
How is BYOK pricing different from managed pricing on GammaInfra?
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?
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
$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.