CONCEPT Cited by 3 sources
BYOK (Bring Your Own Key)¶
BYOK (Bring-Your-Own-Key) is the posture in which a customer stores a third-party provider API key (OpenAI, Anthropic, Google, etc.) with the proxy / gateway operator — who injects it server-side on every upstream request — rather than shipping it to every client or embedding it in every application. The client authenticates to the gateway once (typically via the gateway operator's own identity substrate) and the upstream provider sees the gateway's injected key.
Why it matters¶
Without BYOK, an LLM key lives in every environment that needs to call the provider:
- Developer laptops → copy-paste risk + rotation nightmare on a leak.
- CI runners / job queues → secret-manager integration needed per environment.
- Per-application config → multiplies the surface area of every new service.
With BYOK at a central gateway:
- The key lives in one secrets store the gateway can reach.
- Clients authenticate via a different substrate (SSO, Zero Trust, workload identity) — rotating the client credential is cheap and audit-logged.
- Rotation, revocation, and provider migration happen at the gateway, not in every application.
- Per-tenant / per-user metering and rate-limiting become centralised (the gateway knows who is calling, independent of which key it injects upstream).
Cloudflare AI Gateway instance¶
AI Gateway's Secrets Store + BYOK integration lets the gateway inject the real provider key (e.g. Anthropic) on behalf of the caller, identified by the gateway request path. A variant is Unified Billing, in which customers don't hold provider keys at all — Cloudflare pays the provider and charges credits from the customer's Cloudflare account.
Seen in¶
- sources/2026-01-29-cloudflare-moltworker-self-hosted-ai-agent —
canonical wiki instance. Moltbot's Anthropic key
is moved from the user's local machine into Cloudflare's secrets
store; Moltbot's code is unchanged (only
ANTHROPIC_BASE_URLis flipped to the gateway endpoint). - sources/2026-04-20-cloudflare-internal-ai-engineering-stack —
Cloudflare's internal stack runs BYOK at enterprise scale: the
platform-layer proxy Worker validates the client's
Zero Trust Access JWT,
strips the client auth, injects the real provider key via the
cf-aig-authorizationheader, and tags each request with an anonymous per-user UUID (cf-aig-metadata). No LLM keys live on user laptops. - sources/2026-04-17-databricks-governing-coding-agent-sprawl-with-unity-ai-gateway — inverted variant: Databricks' Unity AI Gateway makes Foundation Model API (first-party inference for OpenAI/Anthropic/Gemini/Qwen) the default upstream, and supports admin-registered external capacity as a BYOK escape hatch. Governance extends to "all your tokens, regardless of where they flow". See patterns/unified-billing-across-providers for the first-party- plus-BYO cost shape.
Related¶
- systems/cloudflare-ai-gateway — the concrete BYOK-supporting LLM gateway.
- systems/unity-ai-gateway — BYOK as external-capacity escape hatch to first-party Foundation Model API default.
- systems/databricks-foundation-model-api — first-party inference alternative to BYOK upstream providers.
- patterns/ai-gateway-provider-abstraction — the provider-swap pattern BYOK enables without a code redeploy.
- patterns/central-proxy-choke-point — architectural posture where BYOK lives.
- patterns/unified-billing-across-providers — first-party + BYO under one bill.
- concepts/ephemeral-credentials — adjacent secrets-management doctrine.
- concepts/centralized-ai-governance — broader three-pillar framing where BYOK fits under pillar 1 (security + audit).