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 Name | API Format | Description |
|---|---|---|
| LongCat-2.5 | OpenAI/Anthropic | High-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):
brew install --cask cc-switchUpgrade later with:
brew upgrade --cask cc-switchOr 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.
- Open CC Switch and select Claude Code in the left sidebar.

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

- 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) ishttps://api.longcat.chat/anthropic, and Model Mapping already maps every role and the default fallback model toLongCat-2.5.

Keep Upstream Format on the default Anthropic Messages (Native). You can also click Fetch Models to pull available models from the endpoint.
- Click Add to save. The resulting
~/.claude/settings.jsonwritten by CC Switch looks like:
{
"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",
}
}- On the Longcat provider card, click Switch (the ▶ icon). The card then shows a blue border and an In use label.

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.
- Select Codex in the left sidebar.

Click + Add Provider, search for
longcat, and select the Longcat preset under Model vendors.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 includesLongCat-2.5.

Click Add to save. CC Switch writes the following files.
~/.codex/config.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:
{
"OPENAI_API_KEY": "your_longcat_api_key"
}- 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:
claudeEnter 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:
codexTip: 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.jsoncontainsANTHROPIC_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.5and the endpoint ishttps://api.longcat.chat/anthropic.
Codex provider not working?
- Confirm Codex is selected in the left sidebar, and that
~/.codex/config.tomlcontainsbase_url = "https://api.longcat.chat/openai/v1"withwire_api = "responses". - Confirm
~/.codex/auth.jsoncontains your LongCat API Key underOPENAI_API_KEY. - Fully quit and restart Codex after switching providers (on macOS press ⌘Q) so it reloads the config.