BYOK Meaning
Last updated November 3, 2026.
BYOK means bring your own key. In AI tools, you paste an API key from a model provider (Anthropic, OpenAI, Google, or another) into a coding tool or router. The tool sends its model requests with your key, and the provider bills your account per token. The tool stops reselling the model to you, though some tools still charge a platform fee on those requests.
BYOK in AI vs BYOK in Encryption
Most search results for BYOK describe the security meaning. A cloud customer generates an encryption key in their own key management system and imports it into a cloud provider, so the provider encrypts stored data with a key the customer controls and can revoke.
The AI meaning shares the name and the idea of customer control, but the key is an API credential, not an encryption key. It decides who pays for inference and which provider account the prompts reach. Revoking it stops the tool from making model calls on your account.
Which AI Coding Tools Support BYOK
| Tool | Where the key goes | Providers | Fee on own-key requests |
|---|---|---|---|
| Cursor | Settings > Models | OpenAI, Anthropic, Google, Azure OpenAI, AWS Bedrock | None on individual plans; $0.25/M tokens on Teams and Enterprise |
| GitHub Copilot (enterprise) | Enterprise or org settings, custom models | Anthropic, AWS Bedrock, Google AI Studio, Microsoft Foundry, OpenAI, OpenAI-compatible, xAI | Public preview |
| VS Code Copilot Chat | Language Models editor | Provider keys, custom endpoints, local Ollama | Provider bills tokens |
| Claude Code | ANTHROPIC_BASE_URL + gateway credential or apiKeyHelper | Anthropic API or a compatible gateway | Billed per token; subscription limits do not apply |
| OpenRouter | Workspace BYOK settings | Provider keys for routed providers | 5% of normal OpenRouter cost after the free allowance |
Open-source agents such as Cline, opencode, Kilo Code, and Aider are BYOK by design. They ship no model of their own, so every request goes out on a key you configure. See Cursor alternatives for how those agents compare.
Cursor BYOK
Open Cursor Settings, go to Models, find the provider, paste the key, and click Save. Cursor then uses your key for that provider's models, and they appear in the model picker. An invalid key makes requests to that provider fail until you replace or remove it.
Two limits matter. Custom keys only work with chat models, and Tab completion keeps using Cursor's built-in models. For OpenAI, Cursor accepts standard non-reasoning chat models.
Billing depends on the plan. On individual plans, own-key requests do not draw from included usage or prepaid credit. On Teams and Enterprise plans, eligible third-party requests carry the Cursor Token Rate of $0.25 per million input, output, and cached tokens, even with your own key. Cursor's Zero Data Retention policy does not apply to requests sent with your own keys, so the provider's retention terms govern them.
GitHub Copilot BYOK
GitHub offers two forms. Enterprise and organization owners can add their own API keys as custom models and make them available to organizations, for Copilot Chat, Copilot CLI, and IDEs. That feature is in public preview. Supported providers are Anthropic, AWS Bedrock, Google AI Studio, Microsoft Foundry, OpenAI, OpenAI-compatible providers, and xAI.
Individual developers in VS Code can add a model provider in the Language Models editor with an API key or a custom endpoint. Local models such as Ollama work through a provider extension and do not need a GitHub sign-in.
Claude Code BYOK (ANTHROPIC_BASE_URL)
Claude Code reads ANTHROPIC_BASE_URL to send requests to an LLM gateway instead of Anthropic directly. A gateway credential variable or an apiKeyHelper script supplies the key. While either is active, requests carry that credential instead of the developer's claude.ai login, the subscription's usage limits do not apply, and the traffic is billed per token.
Organizations can lock this down. Setting allowedProviders to ["customEndpoint"] in a managed settings file, with the gateway URL in that file's env block, makes Claude Code refuse sessions pointed anywhere else. For routing Claude Code to other models through a gateway, see Claude Code Router.
OpenRouter BYOK Fees
OpenRouter stores provider keys encrypted and uses them for every request routed to that provider. Using your own key costs 5% of what the same model and provider would cost on OpenRouter, deducted from your OpenRouter credits.
A free allowance comes first, measured by list-price inference cost rather than request count. Pay-as-you-go accounts get $25,000 per month; Enterprise allowances are custom. Your own key does not override zero-data-retention enforcement: if you enforce ZDR, an endpoint that retains prompts stays blocked unless the key carries a ZDR declaration.
When BYOK Saves Money
A subscription is a prepayment for usage. It wins when you use most of what it includes. BYOK wins when usage is light or uneven, or when most requests can go to a cheap model, because you pay per token and nothing for idle capacity.
The per-token rate is the lever. Claude Opus 5.5 costs $4 input and $20 output per million tokens on Anthropic's API, and Claude Haiku 5.5 costs $0.10 and $0.50, a 40x gap. Any OpenAI-compatible key works in tools that accept a custom base URL, including Morph's endpoint at https://api.morphllm.com/v1 for open-weight coding models such as GLM-5.2. See AI coding costs for per-task math.
BYOK does not always mean zero markup. Cursor Teams adds $0.25 per million tokens and OpenRouter adds 5% after its allowance. Add those to the provider rate before comparing against a plan.
Frequently Asked Questions
What does BYOK mean?
BYOK means bring your own key. In AI tools, you supply your own API key from a model provider such as Anthropic, OpenAI, or Google, and the provider bills you per token for the requests the tool sends. In cloud security, BYOK means supplying your own encryption key to a cloud provider's key management service.
Does Cursor support BYOK?
Yes. In Cursor Settings > Models you can paste keys for OpenAI, Anthropic, Google, Azure OpenAI, or AWS Bedrock. Custom keys work only with chat models; Tab completion keeps using Cursor's own models. On individual plans, own-key requests do not draw from included usage. On Teams and Enterprise plans, eligible third-party requests still carry the Cursor Token Rate of $0.25 per million tokens, including requests made with your own key.
Does GitHub Copilot support BYOK?
Yes. Enterprise and organization owners can add their own API keys as custom models for Copilot Chat, Copilot CLI, and IDEs. The feature is in public preview and supports Anthropic, AWS Bedrock, Google AI Studio, Microsoft Foundry, OpenAI, OpenAI-compatible providers, and xAI. In VS Code, individual users can also add a provider key or a local Ollama model in the Language Models editor.
How do I use my own API key with Claude Code?
Point Claude Code at a gateway or a compatible endpoint with ANTHROPIC_BASE_URL and supply a credential through the gateway credential variables or apiKeyHelper. While that credential is active, requests use it instead of your claude.ai subscription login, the subscription's usage limits do not apply, and the traffic is billed per token.
How much does OpenRouter charge for BYOK?
OpenRouter charges 5% of what the same model and provider would normally cost on OpenRouter, deducted from your OpenRouter credits. A plan-dependent free allowance applies first: pay-as-you-go accounts get $25,000 per month of list-price inference before the fee starts.
Is BYOK cheaper than a subscription?
It depends on volume. A flat plan is cheaper when you use most of its included usage. BYOK is cheaper when your usage is light or uneven, or when you route most requests to a low-cost model, because you pay the provider's per-token rate and nothing for unused capacity.
The fastest endpoints are private deployments
Morph's top speeds come from dedicated deployments, not shared public endpoints: speculators trained on your traffic, caching tuned to your workload, and volume discounts over public per-token rates. Over 500 billion tokens per day run this way.
Bring a key for fast open-weight coding models
Morph serves GLM-5.2 and other open-weight coding models on one OpenAI-compatible API. Paste a Morph key and base URL into any tool that accepts a custom endpoint.
Sources
- Cursor Docs: Bring your own API key (providers, Cursor Token Rate, ZDR; fetched November 3, 2026)
- GitHub Docs: Using your own API keys in GitHub Copilot (enterprise, public preview)
- VS Code Docs: AI language models (bring your own language model key, Ollama)
- Claude Code Docs: LLM gateway (ANTHROPIC_BASE_URL, apiKeyHelper, allowedProviders)
- OpenRouter Docs: BYOK (5% fee, free allowance, ZDR)
- Anthropic: Claude pricing (Opus 5.5, Haiku 5.5 rates)