# Use your own AI key or subscription

> Connect your Claude, ChatGPT, Kimi or other AI account, or your own endpoint, so your Agents run on it.

Source: https://air.build/docs/team/use-your-own-ai-key/

Your Agents can run on an AI account you already pay for: a Claude subscription, ChatGPT's Codex, a Kimi coding plan and others, or any server that speaks the OpenAI or Anthropic API. You set this up in **Settings** › **Connections** › **Custom Keys**.

Usage is billed directly by each provider. On the [pricing page](https://air.build/pricing/), the **Basic** plan is the one built around this: "Bring your own API key", with "API usage billed by your provider".

## Open Custom Keys

Open **Settings** and choose **Custom Keys**, listed under **Connections**.

The page has two parts:

- **Default Model**: the model every Agent runs on unless you chose a model for that Agent.
- **Providers**: one row per provider, with a **Search Providers** field on top. Once you connect one, it moves to a **Connected** group, and the rest stand under **More Providers**.

The providers the app lists are **Claude Pro or Max**, **ChatGPT Codex**, **GitHub Copilot**, **Cursor**, **Grok**, **Kimi For Coding**, **Kimi For Coding Global**, **Z.ai**, **BigModel**, **Kiro**, **Qoder**, **Qoder CN**, **WorkBuddy**, **WorkBuddy AI**, **Devin** and **Custom Endpoint**. Tap a row to open it.

## Connect a subscription

1. Tap the provider, for example **ChatGPT Codex** or **Kimi For Coding**.
2. Tap **Sign In with** and the provider's name, for example **Sign In with ChatGPT Codex**.
3. Sign in on the provider's page and allow access. For Kimi and Grok, the app shows a code under **Confirm this code in your browser**; check that the page shows the same code.
4. Back in the app, the provider's row shows it as connected.

**iPhone**

On iPhone and iPad, the provider's sign-in page opens inside the app.

**Mac**

The provider's sign-in page opens in your web browser, where you may already be signed in to the provider.

While it waits, the app shows **Waiting for browser sign-in…**. If the browser didn't open, or you closed it, tap **Restart Sign-In**, or **Cancel Sign-In** to go back. On iPhone and iPad, **Restart Sign-In** is a row under **Waiting for browser sign-in…**, and **Cancel** is at the top left.

After you connect, the app may ask **Switch Default Model?** and offer one of that provider's models. Tap **Switch** to make it your Default Model, or **Cancel** to keep the one you have.

## Connect a Claude subscription

**Claude Pro or Max** offers two ways in. On iPhone and iPad they're two rows under the provider's name; on the Mac they're two buttons of the same width under the card, one above the other:

- **Sign In with Claude Pro or Max** signs you in on Claude's page, the same way as the steps above.
- **Paste Setup Token…** uses a token from Claude Code instead.

To use a setup token:

1. On a computer that has Claude Code, run this in Terminal and sign in:

   ```bash
   claude setup-token
   ```

2. Copy the token it prints.

3. In AirBuild, open **Claude Pro or Max** and tap **Paste Setup Token…**. Once Claude is connected, it's the row under **Sign In Again**, in the **Connection** card.

4. Tap **Paste**, then **Save**.

The token lasts about a year and replaces your current Claude sign-in. When it runs out, paste a new one the same way. The row's **Connection** card shows **Authentication** as **Claude Code Token** and the day it **Expires**.

## See what's left of a subscription

For subscriptions that report it, the provider's page shows **Subscription Usage**: each window, such as **5-Hour Window** or **Weekly Window**, with how much is left and when it resets. To check again, pull down on iPhone and iPad, or click **Refresh** on the Mac. Until the provider reports anything, it says **No data available yet**.

## Use your own endpoint

**Custom Endpoint** is for any server that speaks the OpenAI or Anthropic API. It's a form, not a sign-in.

1. Tap **Custom Endpoint**.
2. Under **Endpoint**, choose the **API**: **OpenAI Chat Completions**, **OpenAI Responses** or **Anthropic Messages**.
3. Enter the **Base URL** and the **Model ID**. **Name** is optional. The footer shows where requests will go.
4. Under **Authentication**, choose the **Method**: **Bearer Token**, **API Key Header** or **None**, and enter the **API Key** unless you chose **None**.
5. Tap **Save**.

**Headers** lets you add headers to each request with **Add Header**. **Advanced Options** shows more settings: **Compatibility**, **Extra Body Fields** and **Pricing**. **Pricing** is only used for the cost shown under each turn; your provider bills you.

To change the endpoint later, open it again. The **API Key** field says **Saved, leave blank to keep**, so you only type a key to replace it.

> [!NOTE]
> If the **Base URL** is a private network address, the form says **For security reasons, cloud workspaces can't reach private network addresses**. Only Agents in a local Team, on your Mac, can use that endpoint; Agents in a cloud Team can't. (The app labels a Team a "workspace" in some places, as here.) See [Choose where your Agents run](https://air.build/docs/get-started/where-agents-run/).

## Choose the Default Model

Under **Default Model**, tap **Model** and pick a model. The list includes the models of the providers you connected. **Platform Default** follows AirBuild's own default. The choice applies right away; there's no Save. Agents without a model of their own switch after their current step.

If you have a provider connected and pick one of AirBuild's own models, the app asks **Use your AirBuild AI quota?**: "This model won't use the model account you connected. It uses your AirBuild AI quota instead." Tap **Use AirBuild Model** to go ahead, or **Cancel** to keep your model.

A model from your own provider doesn't switch to AirBuild's models when the login stops working: your Agent stops with an error instead, so you can sign in again.

## Remove a login

1. Open the provider.
2. Tap **Remove This Login**, in a card of its own at the bottom of the page.
3. Confirm with **Remove**.

Agents will no longer be able to use that provider. Your account with the provider is not affected.

For **Custom Endpoint**, tap **Remove This Endpoint** (the trash at the bottom left on iPhone and iPad, and a button with that name at the bottom left on the Mac), then **Remove**. Agents set to that endpoint stop until you give them another model.

## When something goes wrong

| What you see | What to do |
| --- | --- |
| **This login is no longer accepted. Sign in again.** | The provider stopped accepting the login. Tap **Sign In Again**. |
| **Sign-in was cancelled.** | Start the sign-in again. |
| **The provider refused the sign-in. Try again.** | Sign in again, with the account that has the subscription. |
| **The provider response could not be read. Try again.** | Try the sign-in again. |
| **Another sign-in process is still completing. Please wait a moment and try again.** | Wait a moment, then tap **Restart Sign-In**. |
| **Unable to open browser to sign in.** | Check that a web browser is available, then try again. |
| **Sign-in timed out. Try again.** | Start again and finish the sign-in on the provider's page. |
| **That doesn't look like a token from claude setup-token.** | Run `claude setup-token` again and paste the whole token it prints. |
| **Enter the API key for this endpoint, or set Authentication to None.** | Enter the **API Key**, or set **Method** to **None** if your server needs no key. |
| **This is not a JSON object.** | Fix **Extra Body Fields** so it's a single JSON object, like `{"store": false}`. |

In a chat, an Agent that can't use your provider shows what happened with a button: **Sign In Again** opens the provider's sign-in, **Open Model Settings** opens Custom Keys, and **Switch Model**, shown when you reached your provider's usage limit, opens Custom Keys so you can pick another model until the limit lifts.

## Questions

**Who bills me for this usage?**

Your provider. Usage is billed directly by each provider, and it doesn't use your AirBuild AI quota.

**Does removing a login cancel my subscription?**

No. Removing it only stops your Agents from using it. Your account with the provider is not affected.

**Can one Agent use a different model from the rest?**

Yes. The Default Model is for every Agent that has no model of its own. See [Add an Agent to your Team](https://air.build/docs/team/add-an-agent/).
