OpenRouter BYOK: use your own provider keys in OpenRouter

Updated · 5 min read

OpenRouter BYOK (bring your own key) lets you add your own provider API keys, from OpenAI, Anthropic, Google, AWS Bedrock, Azure and more than a hundred other providers, to your OpenRouter account. Requests that OpenRouter routes to that provider then run on your key, and the provider bills you for the tokens. On the pay-as-you-go plans, the first $25,000 of BYOK usage each month (at list price) has no OpenRouter fee; above that, OpenRouter charges 5% of the normal OpenRouter price, taken from your OpenRouter credits. You manage keys in your workspace BYOK settings at openrouter.ai/integrations. By default OpenRouter tries your key first and falls back to its own capacity, paid with credits, if your key fails; you can turn that fallback off for each key.

Fees and plans

OpenRouter's pricing page on 2026-11-24:

Plan Fee on buying credits BYOK
Free None (free models only) Not included
Standard (pay-as-you-go) 5.5% $25,000 of list-price inference a month with no fee, then 5%
Business (pay-as-you-go) 8% $25,000 a month with no fee, then 5%
Enterprise By contract Custom allowance

The allowance is measured in list-price inference cost, not in requests. For example, if your BYOK requests in a month would have cost $30,000 at OpenRouter's prices, you pay the provider for all of them and OpenRouter charges 5% of the $5,000 above the allowance, $250, from your credits.

Below the allowance, BYOK adds nothing on OpenRouter's side, while buying the same usage as credits on Standard carries the 5.5% purchase fee. Failed attempts aren't billed, so when a request falls back to another provider you pay only for the one that answers.

How to add a provider key

  1. Open your workspace's BYOK settings at openrouter.ai/integrations.
  2. Open the provider's page, for example /settings/integrations/openai, and add your key. Azure, Bedrock and Vertex take JSON credentials (see below).
  3. Put the key in the Prioritized section to use it before OpenRouter's own endpoints, or in Fallback to use it only as a last resort. You can drag keys between the two.
  4. Optionally limit the key under This key applies to: only some models, only some of your OpenRouter API keys, or only some workspace members.
  5. Choose the key's Shared capacity fallback setting (next section).

Your apps keep calling OpenRouter with your OpenRouter API key, as before. When a request sets no provider order, OpenRouter tries every provider you have a prioritized key for on your key first. To manage keys from code, the BYOK endpoints at https://openrouter.ai/api/v1/byok take a management API key, which the Free plan doesn't include.

Key priority and fallback

For each provider, OpenRouter tries your prioritized keys in the order you set, then OpenRouter's shared endpoints, then your fallback keys. Each prioritized key's Shared capacity fallback setting controls when OpenRouter may use its own capacity, which spends your credits:

Setting What happens
Use shared capacity (default) Your key first; on failure, OpenRouter's endpoints
Never use shared capacity for models this key applies to Models in the key's filter never fall back on this provider, so you may see rate-limit errors once your keys are exhausted
Never use shared capacity for any model on this provider OpenRouter never spends credits on this provider; if no key can serve the model, it skips the provider. Other providers can still answer unless you restrict them
Never use any other provider or key for this key's models Those models run only on keys with this setting; if none can serve, the request fails with a 404

If you send a provider order, the providers you name go first, and within each one your key is tried before shared capacity. For example, with keys for Amazon Bedrock and Google Vertex AI but not Anthropic, "order": ["anthropic"] tries Anthropic on OpenRouter's capacity first, then Bedrock and Vertex on your keys, then Bedrock and Vertex on OpenRouter's capacity.

You can add several keys for the same provider, each with its own name and filters. If one hits its rate limit or errors, OpenRouter moves to the next matching key.

Which providers you can bring

OpenRouter's BYOK API accepts more than 120 provider slugs. They include openai, anthropic, google-ai-studio, google-vertex, amazon-bedrock, azure, xai, mistral, deepseek, groq, cerebras, together, fireworks, deepinfra, moonshotai, z-ai, perplexity and cohere. Azure, Bedrock and Vertex have their own credential formats:

  • Azure: OpenRouter recommends a Foundry configuration with api_key, resource_name and resource_type ("ai_foundry" for *.services.ai.azure.com, "openai" for *.openai.azure.com). An older format lists each deployment's endpoint URL.
  • AWS Bedrock: a Bedrock API key, which is tied to one AWS region, or a JSON object with accessKeyId, secretAccessKey and region. The IAM user needs bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream. You can also choose the cross-region inference profile (global, us, eu, apac).
  • Google Vertex AI: a service account key in JSON, with an optional region. The account needs aiplatform.endpoints.predict.

Privacy and data policies

A BYOK key changes the credential, not the routing rules. Your data policies, such as blocking providers that train on prompts or requiring zero data retention (ZDR), still apply to endpoints that use your key. If your own provider agreement includes ZDR, declare it on the key's Provider agreement section, and OpenRouter can then use that key on ZDR-only requests even when its shared endpoint keeps prompts. OpenRouter doesn't verify the declaration. OpenAI, Azure and Anthropic keys can also declare an EU or US data region for OpenRouter's regional domains, which need the Business or Enterprise plan.

Budgets and spend tracking

By default, BYOK spend doesn't count toward guardrail budgets or workspace budgets; only credit spend does, so a budget can look far from its cap after heavy BYOK use. Turn on Include BYOK spend on the guardrail or in the workspace's Budgets settings (include_byok_in_budgets in the API), and OpenRouter adds what each BYOK request would have cost on OpenRouter.

When a BYOK request fails

Open the Activity page, click the request, then View Raw Metadata. The provider_responses field lists each provider attempt with its HTTP status:

  • 401: the key is invalid or revoked.
  • 403: the key lacks permission. On Bedrock, check the IAM policy and that the model is enabled in your region; on Vertex, check the service account's permissions.
  • 429: your provider account hit its rate limit.

When BYOK is worth it

BYOK helps when you already have credits or a contract with a provider, need your own rate limits, or want provider terms such as ZDR on your own account, while keeping OpenRouter's single API, model list and fallbacks. If you don't have provider accounts, plain OpenRouter credits are simpler, and the free models need no credits. To compare other gateways, see OpenRouter alternatives.

Apps that work with your OpenRouter key

  • Flowly

    Free (free OpenRouter models) + from $15/month · macOS, iOS, Android · Open source

    Visit

    Open-source personal AI agent with desktop, mobile and CLI apps; the CLI can run on your own OpenRouter, Anthropic, OpenAI, xAI, Gemini or Groq key instead of Flowly Cloud.

    Works with:OpenRouterAnthropicOpenAIxAI+2 more

  • Scatter

    Free · Web

    Visit

    Free browser app for learning a topic on an infinite canvas of linked explanations, using your own OpenRouter, OpenAI or Anthropic key or a local model server.

    Works with:OpenRouterOpenAIAnthropicOllama+1 more

  • Robin Review

    Free · Open source

    Visit

    Free, open-source AI code reviewer that runs as a GitHub Action in your repo and reviews every pull request with your own LLM API key.

    Works with:OpenRouterOpenAIGroqOllama

  • Infinity

    Free · macOS

    Visit

    Free Mac AI chat app with git-style branching: fork any part of an answer into its own thread, ask up to four models at once, and use your own keys or local models.

    Works with:OpenAIAnthropicGoogle GeminixAI+7 more

  • Caotang

    Free · Web · Open source

    Visit

    Free, local-first browser writing studio for novels and scripts, with an AI agent that runs on your own Anthropic, OpenAI, Google, OpenRouter or local model key.

    Works with:AnthropicOpenAIGoogle GeminixAI+5 more

  • Shizue

    Free · Chrome extension · Open source

    Visit

    Free, open-source Chrome side panel for AI chat, page summaries, bilingual video captions and in-tab tasks, running on your ChatGPT plan or your own OpenAI, Claude, Gemini or OpenRouter key.

    Works with:OpenAIAnthropicGoogle GeminiOpenRouter+1 more

  • PockoBots

    Free (beta) · Android · Open source

    Visit

    Open-source AI coding agent and personal bots that run on your Android phone, powered by your own OpenAI, Anthropic, Gemini, Groq or OpenRouter key with no app subscription.

    Works with:OpenAIAnthropicGoogle GeminiGroq+1 more

  • Conduit

    Free · Windows, macOS, Linux · Open source

    Visit

    Open-source desktop AI app for agents, research, writing and slides that runs on your own keys from 23 providers or local models.

    Works with:AnthropicOpenAIGoogle GeminixAI+12 more

See all 48 apps that work with OpenRouter

Questions

What is OpenRouter BYOK?

It lets you attach your own provider API keys, such as OpenAI, Anthropic, Google, AWS Bedrock or Azure keys, to your OpenRouter account. Requests routed to that provider then run on your key: the provider bills you for the tokens, and you keep OpenRouter's single API and routing.

Is OpenRouter BYOK free?

Up to a point. On the pay-as-you-go plans (Standard and Business), the first $25,000 of BYOK usage each month, measured at list price, has no OpenRouter fee. Above that, OpenRouter charges 5% of what the same requests would cost on OpenRouter, taken from your credits. The Free plan doesn't include BYOK, and Enterprise allowances are custom.

Do I still need OpenRouter credits with BYOK?

For two things: the 5% fee once you pass the monthly allowance, and fallback to OpenRouter's own capacity when your key fails, which is on by default. Set a key's Shared capacity fallback to Never use shared capacity to stop the fallback.

What happens when my key hits a rate limit?

OpenRouter tries your next key for that provider, then its own shared endpoints, paid from your credits, then any keys you put in the Fallback section. You can block the shared endpoints per key.

Does BYOK spend count toward my OpenRouter budgets?

Not by default. Guardrail and workspace budgets count only credit spend unless you turn on Include BYOK spend (include_byok_in_budgets in the API). Then OpenRouter adds what the request would have cost on OpenRouter.

Which providers can I bring keys for?

OpenRouter's BYOK API accepts more than 120 provider slugs, including openai, anthropic, google-ai-studio, google-vertex, amazon-bedrock, azure, xai, mistral, deepseek, groq, cerebras, together and fireworks.

Sources

Checked against the providers' own documentation on 2026-11-24. Prices and limits change; the links below have the current figures.

Related guides