# Bring your own key (/docs/fleet/byok)

> For AI agents, the [documentation index](https://bitrouter.ai/llms.txt) lists all pages. Append .md to a documentation URL to read its Markdown.

With your own key saved in the console, you can call your Claude or OpenAI models through the same Spare
API and key you use for Spare models: one base URL for everything, with usage for both in **Activity**.

For the [Cost routing](https://bitrouter.ai/docs/fleet/cost-routing) and [fallback chains](https://bitrouter.ai/docs/fleet/fallbacks),
which run in the CLI on your machine, give the CLI your provider key or
subscription instead.

To use models on your own GPUs instead, see [Local models](https://bitrouter.ai/docs/fleet/local).

BYOK is free. Calls made with your key are billed by your provider, at your rates, and never appear on
your Spare invoice. We add no markup and no fee.

## Add a key \[#add-a-key]

Open **Providers** in the console, pick Anthropic or OpenAI, and paste the key. It is encrypted in
your browser before it is sent, and only ever shown back as its last four characters. You can save more
than one key per provider, give each a name, and choose which one is the default.

## Which provider gets called \[#which-provider-gets-called]

The provider comes from the model id you name:

| Model id                      | Provider  |
| ----------------------------- | --------- |
| `anthropic/claude-sonnet-4.6` | Anthropic |
| `openai/gpt-5-mini`           | OpenAI    |

Once a key is saved, [`GET /v1/models`](https://bitrouter.ai/docs/api/models) called with your Spare key lists the models it
unlocks.

A request for a Claude or OpenAI model without a key saved for its provider fails with `404`: the model
isn't available to you.

## How we handle your key \[#how-we-handle-your-key]

* It is used only to call the provider it belongs to, for requests you send.
* It never appears in request logs, error messages or support tools.
* Requests made with it pass through Spare to your provider. We don't store their bodies; we keep token
  counts and costs for your usage records.

## Rotate or remove a key \[#rotate-or-remove-a-key]

Add the new key in the console, then delete the old one; requests in flight finish on the key they
started with. Deleting the default key stops requests to that provider straight away.

To check, switch or remove keys from code, use the [provider keys API](https://bitrouter.ai/docs/api/provider-keys). Adding a
key is done in the console.