Docs menu

Gateway

Bring your own key

Route requests with your own provider credentials, either as a stored connection or a per-request header.

Bring your own key (BYOK) lets requests run on your provider account instead of Seldon's. The provider bills you directly, and Seldon does not debit your workspace credits for those calls.

Two ways to supply a key

Stored connectionPer-request header
Where the key livesEncrypted in a dedicated vaultOnly in the request
How you set it upProviders in the dashboardx-byok-key header
Provider selectionYour connection's models and orderprovider.only with exactly one provider
BudgetsOptional BYOK budgetsNot applicable

Stored connections

Add a connection under Providers, verify it, and choose which models it may serve. Requests covered by your BYOK policy route to eligible connections in your saved order. If no connection can serve the requested model and features, the request returns 422 byok_no_eligible_connection.

You can set BYOK budgets in Billing. A request that would exceed one returns 402 byok_budget_exceeded.

Per-request header

Shell
curl "$SELDON_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $SELDON_API_KEY" \
  -H "x-byok-key: $PROVIDER_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "openai/gpt-5.4-nano",
    "messages": [{"role": "user", "content": "Hello"}],
    "provider": {"only": ["openai"]}
  }'
  • provider.only must name exactly one provider that accepts a key header, or the request returns 400 byok_provider_required or byok_credential_unsupported.
  • The header is used for this request and not stored.
  • Don't combine the header with a stored BYOK policy (400 byok_credential_conflict).

What changes with BYOK

  • Spend limits on workspace credits exclude BYOK usage.
  • Response-cache entries are scoped to the credential that produced them.
  • Functions run on workspace credits only; BYOK requests to a function alias return 400 function_requires_managed_funding.

See Errors for every BYOK code.