agenttabGet the app
  • Models
  • Privacy
  • Basics

Bring your own API key: what BYOK means for AI apps

What bring your own API key means for AI apps: who bills you, where requests and keys go, and how to set a spending limit at OpenAI, Anthropic and Google.

Updated 9 min read

On this page: 7 sections
  1. 1Two ways an AI app pays for its model
  2. 2Where your requests go
  3. 3Where your key should live
  4. 4How to create a key and set a spending limit
  5. 5The trade-offs
  6. 6How agenttab handles your key
  7. 7FAQ

Bring your own API key (BYOK) means an AI app runs on your account with an AI provider instead of the app’s own. You create a key at a provider such as OpenAI, Anthropic or Google, paste it into the app, and the provider bills you directly at its listed price, with no markup or subscription in between. In return, you look after the billing, the limits and the key itself.

Two ways an AI app pays for its model

Every AI app sends your requests to a model somewhere, and someone pays for the tokens. There are two common setups.

In the first, the app holds its own key on its own server. You pay the app, usually a monthly subscription or a pack of credits, and the app pays the provider. Your requests travel from your phone to the developer’s server, then on to the provider.

In the second, you bring your own key. You have an account with the provider, the app uses your key, and the provider charges you for what you use. The app developer isn’t part of the bill.

App’s own keyBring your own key
Who the provider billsThe app developerYou
What you payThe app’s price (subscription or credits)The provider’s per-token price
Which models you can useThe ones the app offersAny model your provider and the app support
A month you barely use itUsually the same feeA smaller bill
When you stopCancel the subscriptionDelete the key; nothing to cancel

Neither is wrong. A subscription is predictable and needs no setup. BYOK costs exactly what you use and lets you pick the model, but every token shows up on your own bill.

Where your requests go

BYOK is about who pays, but it often changes the path your data takes too. Ask one question of any BYOK app: does a request go from your device straight to the provider, or through the developer’s server first?

Some apps take your key and still route requests through their own backend, for example to add features or logging. Others send requests directly from your phone to the provider’s API, signed with your key, so the developer never sees your prompts or your key. The app’s privacy policy should say which. Look for a plain statement of what leaves the device and where it goes.

Either way, the provider still receives what you send. BYOK removes the middle, not the end. Your provider’s privacy terms and retention rules apply to your requests, under your account. If you want nothing to leave your own network for the model, some apps can point at a model on your own computer instead; see how to use Ollama or LM Studio from your phone.

Where your key should live

An API key works like a password to your billing account. Anyone who has it can send requests, and you pay for them. So where an app keeps it matters.

On a phone, the right place is the operating system’s secure storage: the Keychain on iPhone and the Keystore on Android. Both keep secrets encrypted and readable only by the app that stored them. A key in a plain settings file, a synced note or a chat message is a key someone else might read.

A few habits help:

  • Make a separate key for each app, and name it after the app. If one leaks, you delete that key and nothing else breaks.
  • Never paste a key into a chat, an email or a support form. A legitimate developer won’t ask for it.
  • If a key might have leaked, delete it at the provider first, then make a new one.

How to create a key and set a spending limit

Every provider’s console looks a little different, but the steps are much the same.

  1. Sign in to the provider’s developer console (its API platform), not the consumer chat app. A chat app subscription is usually billed separately from the API.
  2. Set up billing. Some providers work on prepaid credits; others charge a card each month for what you used.
  3. Create an API key and give it a name you’ll recognize, such as “phone agent”. Copy it straight away: many consoles show the full key only once.
  4. Set a limit. Depending on the provider, that can be a monthly spending cap, a budget alert, a limit on a single key, or simply a small prepaid balance with automatic top-ups turned off.
  5. Paste the key into the app and send a test request.

Here is where the limit lives at three common providers. Consoles change, so these steps are as of November 2026, and each provider’s own page is linked.

OpenAI

At OpenAI you can set a spend limit for a whole organization or for one project, as its spend limits guide explains. A key made inside a project belongs to that project, so a project just for your phone apps, with its own limit, keeps their spending apart.

  1. For one project, open that project’s settings and choose Limits. For the whole organization, open Organization limits at platform.openai.com/settings/organization/limits.
  2. Under Spend, choose Edit spend limit and enter a monthly amount.
  3. Turn on Enforce a hard limit if requests should stop at that amount, then Save.

Once a hard limit is reached, requests fail with a 429 error until the next month, or until you raise or remove the limit. OpenAI notes that enforcement isn’t instant, so spending can end up slightly over.

Anthropic

Anthropic’s rate limits page covers the organization’s own limit in the Claude Console:

  1. Open Spend limits at platform.claude.com/settings/spend-limits.
  2. Next to Monthly spend limit, choose Adjust limit or Set limit.
  3. Enter an amount. It can’t be higher than your usage tier’s monthly cap.

When usage reaches your limit, requests are refused with a message saying you’ve reached your specified usage limit, until the next month or until you raise it. API keys are tied to the workspace they’re created in, so you can also make a workspace for an app, create its key there, and give that workspace a lower limit and an email notification. To do that, open Workspaces, select the workspace and choose Spend limits.

Google Gemini API

Paid Gemini API use is set up in Google AI Studio, which links your project to a Cloud Billing account. Its billing docs describe a monthly cap per project:

  1. Open the Spend page in Google AI Studio. You need the editor, owner or admin role on the project.
  2. Under Monthly spend cap, choose Edit spend cap and enter an amount.

Google marks project caps as experimental and says billing data can lag by about ten minutes, so a long run can go a little over the cap. New accounts start on Prepay, where you buy credits first and requests stop when the balance reaches zero. A Cloud Billing budget, under Billing · Budgets & alerts in the Google Cloud console, emails you as spending passes set thresholds, but Google’s budget docs say an alerts-only budget doesn’t cap spending.

One key for many providers

If you’d rather have one bill for models from several companies, OpenRouter gives you a single key that reaches many providers’ models, and it can put a credit limit on each key. If your organization already runs models in Azure, Azure OpenAI is the route there.

Start small

Load a small prepaid balance or set a low cap for the first week. Once you’ve seen what your usual tasks cost, raise it.

The trade-offs

BYOK isn’t free of work. Here is what you take on.

  • You manage billing. Two providers means two bills. You also keep an eye on usage yourself, though most consoles have a usage page.
  • Rate limits are yours. Providers cap how many requests and tokens an account can use per minute, and new accounts often start lower. OpenAI moves an organization to a higher usage tier as its total credit purchases pass set amounts, and Anthropic may start a new organization below its standard limits until it builds a usage history. An AI agent sends many requests in a row, so it can hit those limits on a new account. You’ll see an error mentioning 429 or “rate limit”. Waiting a minute, or moving up a tier, fixes it. A spend limit you set can also come back as a 429, so read the message.
  • There’s no flat price. A long task costs more than a short one. If you want to estimate, here is how tokens add up in an agent run.
  • Setup takes a few minutes. Making an account and a key is one more step before the first run.

And what you get for it:

  • You pay the provider’s price, with nothing added on top.
  • You choose the model, and can switch whenever a better or cheaper one comes out.
  • You can stop at any time by deleting the key. There’s no subscription to cancel.

How agenttab handles your key

agenttab is built this way. The app is free and has no subscription. You add a key from Anthropic, OpenAI, Google Gemini, Mistral, Groq, xAI, DeepSeek, OpenRouter or Azure OpenAI, or point it at your own server running Ollama, LM Studio, llama.cpp, vLLM or any OpenAI-compatible endpoint. Your provider bills you for the tokens each run uses, at its own price.

  • Storage. Keys are kept in the iOS Keychain or the Android Keystore, and sent only to the provider they belong to.
  • Request path. Requests go from your phone straight to your provider. There’s no agenttab server in between and no agenttab account to sign up for. The Model screen in Settings says the same thing in three lines: where the key is stored, that requests go from the phone to the provider, and that nothing sits in between.
  • Your OK first. Before the first run, and again when you switch provider or server, the app shows what a run sends and to whom. Nothing goes until you tap Allow.
  • A connection test. After pasting a key, one tap sends a tiny request to check that the key works.
  • Cost per run. Each run’s step log shows token counts and cost per model, so you can see what a task costs before you put it on a schedule. An optional smaller model can take the routine navigation steps.
agenttab’s Your model screen with Provider key selected over Your server. Provider chips list Anthropic, OpenAI, Google Gemini, Mistral, Groq, xAI, DeepSeek, OpenRouter and Azure OpenAI, with Anthropic picked. Below are a model field with suggested model chips and an API key field noting the key is saved in the iOS Keychain on this phone only and never goes to agenttab.
Settings · Model in agenttab. Choose a provider and a model, then paste your key; the note under the key field says where it’s kept.

agenttab will never ask you for your key, in email or anywhere else (support has the details). To remove a key, delete it in Settings · Model, then delete it at your provider. On iPhone, do this before uninstalling, because iOS can keep an app’s Keychain items after the app is gone. The privacy policy lists everything that leaves the phone, and the your key section on the home page has the short version.

FAQ

Is bring your own key cheaper than a subscription?

It depends on how much you use it. With your own key you pay per token, so a quiet month costs little and a busy one costs more. A subscription costs the same either way.

Is it safe to paste my API key into an app?

It’s as safe as the app’s handling of it. Check that the key is kept in the phone’s secure storage and sent only to the provider, never to the developer. Use a key made just for that app, with a spending limit, so a problem costs little and is fixed by deleting one key.

Can I use my AI chat subscription instead of an API key?

Usually not. A subscription to a provider’s consumer chat app is generally billed separately from its API. You’ll need an account on the provider’s developer platform and a key from there.

What should I do if my API key leaks?

Delete or revoke the key in your provider’s console straight away, then create a new one and paste it into your apps. Check the usage page for requests you don’t recognize. A spending limit on the account caps the damage while you sort it out.

Keep reading

  • Models
  • Basics

AI agent cost per task: how tokens add up

What an AI agent costs per task: the tokens each step sends, a formula to estimate one run, a worked example, and the settings that cut the bill.

6 min read