> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.beatapi.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.beatapi.io/_mcp/server.

# Using BeatAPI in CC-Switch

> Manage the BeatAPI provider for Claude Code and Codex CLI from one desktop app and switch between providers without editing config files.

# Using BeatAPI in CC-Switch

CC-Switch is an open-source desktop app that manages provider configuration for several AI coding CLIs — Claude Code, Codex CLI, Gemini CLI — in one place. Adding BeatAPI once lets you switch to it, and away from it, in a click instead of an editor.

## Prerequisites

1. **At least one supported CLI installed** — [Claude Code](/integrations/claude-code) or [Codex CLI](/integrations/codex-cli).
2. **A BeatAPI API key** — create one in [Dashboard → API Keys](https://beatapi.io/dashboard/apikeys).

## Step 1: Install CC-Switch

#### macOS

```bash
brew tap farion1231/ccswitch
brew install --cask cc-switch
```

A signed `.dmg` is also available from GitHub Releases. Requires macOS 12 or later.

#### Windows

Download the `.msi` installer or the portable `.zip` from GitHub Releases. Requires Windows 10 or later.

#### Linux

From GitHub Releases: `.deb` for Debian and Ubuntu, `.rpm` for Fedora and RHEL, or the universal `.AppImage`. On Arch: `paru -S cc-switch-bin`.

On first launch CC-Switch detects the CLIs already installed and can import their current configuration as the default provider.

## Step 2: Add BeatAPI

The tool groups are selected at the top of the main window. Configure whichever CLIs you use.

### For Claude Code

1. Select the **Claude Code** group.
2. Click **+** at the top right.
3. Fill in the form:

| Field        | Value                    |
| ------------ | ------------------------ |
| Name         | `BeatAPI`                |
| Endpoint URL | `https://api.beatapi.io` |
| API Key      | Your BeatAPI API key     |
| API Format   | `Anthropic Messages`     |

4. Click **Add**.

### For Codex

1. Select the **Codex** group.
2. Click **+** at the top right.
3. A Codex provider is two blocks. In the `auth.json` block:

```json
{
  "OPENAI_API_KEY": "<BEATAPI_API_KEY>"
}
```

In the `config.toml` block:

```toml
model = "gpt-5.6-sol"
model_provider = "beatapi"

[model_providers.beatapi]
name = "BeatAPI"
base_url = "https://api.beatapi.io/v1"
wire_api = "responses"
requires_openai_auth = true
```

4. Name it `BeatAPI` and click **Add**. CC-Switch validates both the JSON and the TOML before saving.

> **Note**
>
> The two URLs are deliberately different and mixing them up is the most common setup failure. Claude Code uses the Anthropic-native format at `https://api.beatapi.io` — **no** `/v1`, because the client appends `/v1/messages` itself. Codex uses the OpenAI-compatible format at `https://api.beatapi.io/v1` — **with** `/v1`.

## Step 3: Switch

From the main window: select **BeatAPI** in the provider list and click **Enable**. A confirmation toast appears.

From the system tray: click the CC-Switch icon and pick the provider from the menu.

Claude Code hot-switches — a new session picks up the change. Codex needs the terminal or the agent restarted.

## Models

| Model ID           | Available in | Choose it for                                              |
| ------------------ | ------------ | ---------------------------------------------------------- |
| `claude-fable-5-1` | Claude Code  | The newest generation — the default for agentic coding     |
| `claude-opus-5`    | Claude Code  | The heaviest reasoning tier                                |
| `claude-sonnet-5`  | Claude Code  | Balanced capability and speed                              |
| `gpt-5.6-sol`      | Codex        | The strongest coding tier                                  |
| `gpt-6-astra`      | Codex        | The newest generation; higher rate above 272K input tokens |

Switch models with `/model` inside either CLI. The full catalogue is on the [Text API](/text-api) pages, and rates on the [pricing page](https://beatapi.io/pricing).

## FAQ

### Switching had no effect

* **Claude Code** — start a new session; if it persists, restart the agent.
* **Codex** — restart the terminal or Codex itself.

### The key is rejected

1. Confirm the key was copied in full, with no leading or trailing whitespace.
2. Confirm it is active in [Dashboard → API Keys](https://beatapi.io/dashboard/apikeys).
3. Re-check the endpoint URL against the note above — Claude Code without `/v1`, Codex with it.

### Format error when adding a Codex provider

CC-Switch validates `auth.json` as JSON and `config.toml` as TOML. Check for a missing brace or comma, a misspelled field, and typographic quotes pasted from a document.

### Which files does it write?

* Claude Code: `~/.claude/settings.json`
* Codex: `~/.codex/config.toml` and `~/.codex/auth.json`

CC-Switch backs these up before each switch, so hand-editing them is unnecessary.

## Support

Open a support ticket from the [dashboard](https://beatapi.io/dashboard) and include the `request_id` from the failing response.