Skip to content

Security and governanceGuide

What is BYOK in AI? Bring your own key, explained for buyers

Bring your own key sounds like a checkbox. It decides who your AI provider's customer is, which rates and data agreements apply to your traffic, and what happens when your key fails. Five questions separate real BYOK from a fallback to someone else's account.

By INFRO Editorial

Published

6 min read

An amber key-shaped glass form on a dark ground, connected by a single bright line to a vault-like node, representing a company's own provider credential

In short

BYOK (bring your own key) in AI means a platform sends your requests to model providers using provider accounts and credentials you own, so the provider bills you directly under your contract, rates and data terms. Implementations differ in ways that matter: some platforms retry a failed BYOK request on their own accounts, some do not count BYOK spend in budgets, and some charge a fee on BYOK usage. Ask where keys are stored, what happens when your key fails, whether budgets see BYOK spend, what the platform charges for it, and how you leave.

Key takeaways

  • BYOK means your requests run on provider accounts you own, so the provider bills you directly under your own contract, rates and data terms.
  • Ask what happens when your key fails: OpenRouter and Vercel both document falling back to their own capacity by default.
  • Ask whether budgets see BYOK spend: Vercel's budgets do not count it, OpenRouter's count it only if switched on, Cloudflare's count it for priced models.
  • Ask what BYOK costs: some platforms charge a percentage fee on BYOK usage past an allowance; others charge a subscription.
  • Ask how keys are stored, scoped and rotated, and how you leave.

What is BYOK in AI? Bring your own key means a platform runs your AI requests on provider accounts you own, using credentials you give it, instead of on its own accounts. Your provider — OpenAI, Anthropic, Google, a cloud — bills you directly, and your contract, negotiated rates and data agreements apply to the traffic. The platform governs the requests without buying them.

That sounds like a setting. In practice it decides who your provider's customer is, and implementations differ in ways that undo the point if you do not ask. This guide explains what BYOK changes, then gives five questions that separate one implementation from another, with what three well-known platforms document today.

What BYOK changes

QuestionPlatform's accountsYour accounts (BYOK)
Who is the provider's customer?The platformYou
Which rates apply?The platform's price for the modelYour contract's rate
Which data terms apply?The platform's agreement with the providerYour agreement with the provider
Who sees the provider invoice?The platformYou
What happens if the platform goes away?Your inference stopsYour provider accounts still work
Who holds the provider relationship and volume history?The platformYou

For a hobby project the left column is often simpler: one account, one balance, every model. For a company with negotiated rates, committed spend with a cloud, data processing agreements or a procurement process, the right column is usually required. It is also the basis of an AI control plane that governs traffic without sitting in the money flow.

Five questions to ask any BYOK platform

1. What happens when my key fails?

This is the question that matters most, because a fallback to the platform's own capacity means a request you meant to run under your contract runs under theirs.

  • OpenRouter: by default, if all your keys hit a rate limit or fail, OpenRouter falls back to its shared endpoints; a per-key setting, "Never use shared capacity", turns that off1.
  • Vercel AI Gateway: if a request with your credentials fails, it retries with its system credentials, and that fallback usage is billed against your credits balance; with zero data retention on, the fallback is limited to ZDR-eligible system credentials2.
  • Cloudflare AI Gateway: keys are stored in Secrets Store, and a provider authorization header sent on the request takes precedence over the stored key3.

None of these behaviours is wrong; a fallback improves availability. But if you chose BYOK for data terms or contract reasons, you need to know whether the fallback exists and how to turn it off.

2. Do budgets and limits see BYOK spend?

A spend limit that cannot see your own-key traffic does not limit it.

  • Vercel: spend through your own credentials "isn't counted in budgets" and "a budget can't be used to cap BYOK spend"2.
  • OpenRouter: by default BYOK spend does not count toward guardrail or workspace budgets; an "Include BYOK spend" setting includes it1.
  • Cloudflare: spend limits apply to BYOK requests for models with known pricing4.

3. What does BYOK cost?

Pricing models differ. OpenRouter charges a fee of 5% of what the same usage would cost on OpenRouter, after a monthly allowance measured in list-price inference cost1. Vercel makes BYOK available on its paid tier and requires purchased AI Gateway credits2. Other platforms charge a subscription with no fee on model spend. Work out what each structure costs at your volume, including any fallback usage billed on top.

4. How are keys stored, scoped and rotated?

The platform now holds a credential to your provider account. Ask:

  • Is the key encrypted at rest, and is it ever returned by an API or shown in a console after it is saved?
  • Can it be limited to one project, environment or workload?
  • Can you hold several keys per provider and rotate one while the others serve?
  • Is every key change in an audit log?

On your side, give the platform an inference-only key, never an organization admin key; least privilege for provider admin keys and BYOK credential architecture go into detail.

5. How do I leave?

Because the provider accounts are yours, leaving should mean pointing your applications back at the provider or another gateway. Check that the platform's API is a standard shape (OpenAI-compatible, or the provider's own), that your request and cost history can be exported, and that nothing in your code depends on platform-only fields you cannot remove in an afternoon. Avoiding LLM vendor lock-in covers the wider question.

Setting up BYOK safely

Whichever platform you choose, the work on your side is the same:

  1. Create a dedicated key per platform and environment. Never reuse the key your own services use, so revoking the platform's access does not break anything else, and usage reports separate the two.
  2. Scope it. Use the provider's own controls: an OpenAI project key limited to the project the platform serves, an Anthropic key in a dedicated workspace, a Google Cloud project used only for that traffic. Give it inference permissions only.
  3. Set a ceiling at the provider too. OpenAI and Anthropic both let you set spend limits on the organization, project or workspace. A provider-side limit is the backstop if the platform's own limits fail or are misconfigured.
  4. Record the arrangement. Note which platform holds which key, who created it, and when it should be rotated. The audit question "who can call our OpenAI account?" should have a written answer.
  5. Rehearse revocation. Revoke and replace the key once before you depend on it, and time how long the platform takes to pick up the new one.

BYOK is a mechanism, not the product

Holding your keys is the easy part. What makes a BYOK platform useful is what it does with the traffic: routing and failover across your accounts, access policy, budgets that refuse before the provider is called, cost estimates at your own rates, attribution and an audit trail. Judge a BYOK platform on those, and on its answers to the five questions above.

How INFRO answers the five questions

INFRO runs only on provider accounts you connect; it holds no provider accounts of its own and charges a software subscription with 0% markup on model spend. Failure: failover moves only between your own connections, in the order your route sets; when none can serve a request it fails with an error naming each attempt. Budgets: every request is on your keys, so budgets at organization, project, member and key level see all of it, checked before the provider is called. Cost: a plan subscription; nothing is priced per token. Keys: each provider key is sealed on arrival and never shown again; applications use INFRO gateway keys that can be limited to chosen providers, environments or IP ranges and rotated with an overlap window, and changes are in the audit log. Exit: the API is OpenAI-compatible, your provider accounts keep working without INFRO, and request and cost history can be exported.

Summary

BYOK means your provider is billing you, under your terms. Before you rely on it, find out what a platform does when your key fails, whether its budgets see your own-key spend, what it charges for BYOK, how it holds your keys, and how you would leave.

Questions readers ask

What does BYOK mean in AI?
Bring your own key: a platform calls AI model providers using credentials for provider accounts you own, rather than its own. The provider bills you directly, and your contract, negotiated rates and data agreements with that provider apply to the traffic.
Is BYOK more secure?
It moves risk rather than removing it. Your provider key is held by the platform, so ask how it is stored, encrypted, scoped and rotated. In exchange, your data agreements with the provider apply, and revoking the key at the provider ends the platform's access.
Does BYOK cost extra?
It depends on the platform. OpenRouter charges 5% of the equivalent OpenRouter cost on BYOK usage past a monthly allowance, Vercel requires a paid tier and purchased credits to use BYOK, and other platforms charge a flat subscription with no fee on model spend. Read the current pricing page.
What happens when my BYOK key fails?
On some platforms the request is retried on the platform's own provider accounts. OpenRouter falls back to shared capacity by default unless you disable it per key, and Vercel retries with its system credentials and bills that usage to your credits balance. Check this before you rely on BYOK for contract or data reasons.

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

INFRO accounts are self-serve. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.BYOK (opens in a new tab) — OpenRouter. Accessed Oct 20, 2026.
  2. 2.Bring Your Own Key (BYOK) to AI Gateway (opens in a new tab) — Vercel. Accessed Oct 20, 2026.
  3. 3.Bring your own keys (BYOK) (opens in a new tab) — Cloudflare. Accessed Oct 20, 2026.
  4. 4.Spend limits (opens in a new tab) — Cloudflare. Accessed Oct 20, 2026.

About this article

Competitor behaviour is quoted from OpenRouter's, Vercel's and Cloudflare's own BYOK and spend documentation, all opened on 2026-10-20. Written by the team that builds INFRO, which runs only on customers' own provider accounts; that position is stated in its own section and the five questions apply to INFRO as much as to anyone.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.