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

URL: https://infro.io/blog/what-is-byok-ai
Author: INFRO Editorial (https://infro.io/blog/editorial)
Publisher: INFRO
Published: 2026-10-20
Last modified: 2026-10-20
Last reviewed: 2026-10-20 (next review due 2026-11-19)
Topic: Security and governance
Format: Guide

> 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

| Question | Platform's accounts | Your accounts (BYOK) |
| --- | --- | --- |
| Who is the provider's customer? | The platform | You |
| Which rates apply? | The platform's price for the model | Your contract's rate |
| Which data terms apply? | The platform's agreement with the provider | Your agreement with the provider |
| Who sees the provider invoice? | The platform | You |
| What happens if the platform goes away? | Your inference stops | Your provider accounts still work |
| Who holds the provider relationship and volume history? | The platform | You |

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](https://infro.io/blog/what-is-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 off[1].
- **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 credentials[2].
- **Cloudflare AI Gateway:** keys are stored in Secrets Store, and a provider authorization header sent on the request takes precedence over the stored key[3].

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 it[1].
- **Cloudflare:** spend limits apply to BYOK requests for models with known pricing[4].

### 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 cost[1]. Vercel makes BYOK available on its paid tier and requires purchased AI Gateway credits[2]. 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](https://infro.io/blog/provider-admin-key-least-privilege) and [BYOK credential architecture](https://infro.io/blog/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](https://infro.io/blog/avoid-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.

> **Example: One key, three controls**
> A team connects its OpenAI account to a gateway. It creates a project called `gateway-prod`, issues a project key with model permissions only, sets a monthly project spend limit at OpenAI, and records the key in its secrets inventory with a 90-day rotation date. The gateway's own budgets enforce per-team limits day to day; the provider's project limit stops a misconfiguration from becoming a month-end surprise.

## 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

### 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.

## Sources

1. BYOK — OpenRouter. https://openrouter.ai/docs/guides/overview/auth/byok (accessed 2026-10-20)
2. Bring Your Own Key (BYOK) to AI Gateway — Vercel. https://vercel.com/docs/ai-gateway/authentication-and-byok/byok (accessed 2026-10-20)
3. Bring your own keys (BYOK) — Cloudflare. https://developers.cloudflare.com/ai-gateway/configuration/bring-your-own-keys/ (accessed 2026-10-20)
4. Spend limits — Cloudflare. https://developers.cloudflare.com/ai-gateway/features/spend-limits/ (accessed 2026-10-20)
