Integrate with CC Switch ​

CC Switch is a free, open-source cross-platform desktop app that centrally manages providers for AI coding tools such as Claude Code, Codex, OpenCode, and more. It lets you add, switch, and speed-test API providers from a single interface, and writes the tool's config file for you (e.g. ~/.claude/settings.json) — no manual editing required. Official website: ccswitch.io.

I. Prerequisites ​

Obtain your API Key from the LongCat Platform, and confirm on the Usage page that your account has sufficient token quota.

The LongCat API platform currently provides the following models:

Model NameAPI FormatDescription
LongCat-2.5OpenAI/AnthropicHigh-performance agentic model

II. Install CC Switch ​

CC Switch supports Windows 10+ and macOS 12 (Monterey)+. Install it with a package manager or download it manually.

macOS ​

Homebrew (recommended):

bash
brew install --cask cc-switch

Upgrade later with:

bash
brew upgrade --cask cc-switch

Or download the .dmg from the Releases page and drag CC Switch.app into Applications. The macOS build is signed and notarized by Apple, so no extra security steps are needed.

Windows ​

Download the .msi installer (or the portable .zip) from the Releases page and run it.

Only download from ccswitch.io or the GitHub Releases. Any site asking for payment, top-ups, or login credentials is not official.

III. Add LongCat to Claude Code (Anthropic Protocol) ​

CC Switch adds LongCat to Claude Code via the Anthropic-compatible protocol and writes the configuration for you.

  1. Open CC Switch and select Claude Code in the left sidebar.

cc-switch-select-app

  1. Click + Add Provider in the top-right corner, search for longcat, and select the Longcat preset under Model vendors.

cc-switch-add-provider

  1. On the configuration page, fill in only the API Key with your LongCat API Key; keep the other pre-filled fields as they are: the API Endpoint (ANTHROPIC_BASE_URL) is https://api.longcat.chat/anthropic, and Model Mapping already maps every role and the default fallback model to LongCat-2.5.

cc-switch-config-form

Keep Upstream Format on the default Anthropic Messages (Native). You can also click Fetch Models to pull available models from the endpoint.

  1. Click Add to save. The resulting ~/.claude/settings.json written by CC Switch looks like:
json
{
  "env": {
      "ANTHROPIC_AUTH_TOKEN": "your_longcat_api_key",
      "ANTHROPIC_BASE_URL": "https://api.longcat.chat/anthropic",
      "ANTHROPIC_DEFAULT_FABLE_MODEL": "LongCat-2.5",
      "ANTHROPIC_DEFAULT_FABLE_MODEL_NAME": "LongCat-2.5",
      "ANTHROPIC_DEFAULT_HAIKU_MODEL": "LongCat-2.5",
      "ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME": "LongCat-2.5",
      "ANTHROPIC_DEFAULT_OPUS_MODEL": "LongCat-2.5",
      "ANTHROPIC_DEFAULT_OPUS_MODEL_NAME": "LongCat-2.5",
      "ANTHROPIC_DEFAULT_SONNET_MODEL": "LongCat-2.5",
      "ANTHROPIC_DEFAULT_SONNET_MODEL_NAME": "LongCat-2.5",
      "ANTHROPIC_MODEL": "LongCat-2.5",
  }
}
  1. On the Longcat provider card, click Switch (the ▶ icon). The card then shows a blue border and an In use label.

cc-switch-enabled

IV. Add LongCat to Codex (OpenAI Protocol) ​

CC Switch can also manage Codex, which talks to LongCat over the OpenAI-compatible protocol. For Codex it writes ~/.codex/config.toml and ~/.codex/auth.json instead of ~/.claude/settings.json.

  1. Select Codex in the left sidebar.

cc-switch-openai-open-setting

  1. Click + Add Provider, search for longcat, and select the Longcat preset under Model vendors.

  2. Fill in only the API Key with your LongCat API Key; keep the other pre-filled fields as they are: the API Request URL (Base URL) is https://api.longcat.chat/openai/v1, and Models already includes LongCat-2.5.

cc-switch-openai-config

  1. Click Add to save. CC Switch writes the following files.

    ~/.codex/config.toml:

toml
model_provider = "custom"
model = "LongCat-2.5"
disable_response_storage = true
web_search = "disabled"
model_reasoning_effort = "high"
model_supports_reasoning_summaries = true

[model_providers.custom]
name = "custom"
base_url = "https://api.longcat.chat/openai/v1"
wire_api = "responses"
requires_openai_auth = true

~/.codex/auth.json:

json
{
  "OPENAI_API_KEY": "your_longcat_api_key"
}
  1. On the Longcat provider card, click Switch (the ▶ icon). The card shows an In use label, and the status bar reads "Direct is active · connected to Longcat".

V. Switch and Test ​

Claude Code supports hot reload, so after switching providers there is no need to restart your terminal — the change takes effect immediately.

Start Claude Code and send a test message:

bash
claude

Enter a test message such as: "Hello, please introduce yourself". If the configuration is correct, you will receive a response from the LongCat model.

Codex does not support hot reload, so after switching providers fully quit and restart Codex (on macOS press ⌘Q — closing the window alone is not enough) before sending a test message:

bash
codex

Tip: Use Manage & Test on the provider configuration page to check endpoint latency (🟢 <500ms / 🟡 500–1000ms / 🔴 >1000ms).

VI. FAQ ​

The provider does not take effect after enabling?

  • Confirm the correct app (Claude Code) is selected in the left sidebar, and that the LongCat card shows the In use label.
  • Verify ~/.claude/settings.json contains ANTHROPIC_BASE_URL: https://api.longcat.chat/anthropic.

Authentication failure or 401/403?

  • Verify the API Key is a valid LongCat API Key, and that you did not swap the API Key and Endpoint URL fields.

Model not found or 404?

  • Verify the model is exactly LongCat-2.5 and the endpoint is https://api.longcat.chat/anthropic.

Codex provider not working?

  • Confirm Codex is selected in the left sidebar, and that ~/.codex/config.toml contains base_url = "https://api.longcat.chat/openai/v1" with wire_api = "responses".
  • Confirm ~/.codex/auth.json contains your LongCat API Key under OPENAI_API_KEY.
  • Fully quit and restart Codex after switching providers (on macOS press ⌘Q) so it reloads the config.