API DocsAPI Docs
LongCat API Platform
  • English
  • 简体中文
LongCat API Platform
  • English
  • 简体中文
  • Quick Start
  • API Docs
  • Claude Code Configuration
  • FAQ
  • Change Log

Claude Code Configuration

Overview

This guide provides detailed instructions on configuring the Claude Code CLI tool to use the services of the LongCat API Platform. The LongCat API Platform is fully compatible with the Anthropic Claude API format, allowing you to easily access LongCat series model capabilities within the Anthropic API ecosystem through simple configuration.

Prerequisites

1. Obtain an API Key

Before you begin the configuration, you need to:

  1. Visit the LongCat API Platform
  2. Register and complete your account creation
  3. After logging in, go to the API Keys page
  4. Obtain your API Key (a key named "default" is created automatically)

2. Confirm Claude Code is Installed

Ensure that you have the Claude Code CLI tool installed. If not, please refer to the official documentation for installation.

Configuration Method

Claude Code supports fine-grained control through a configuration file.

1. Create a Configuration File

Create or edit the Claude Code configuration file at ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "your_longcat_api_key",
    "ANTHROPIC_BASE_URL": "https://api.longcat.chat/anthropic",
    "ANTHROPIC_MODEL": "LongCat-Flash-Chat",
    "ANTHROPIC_SMALL_FAST_MODEL": "LongCat-Flash-Chat",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "LongCat-Flash-Chat",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "LongCat-Flash-Chat",
    "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "6000",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1
  },
  "permissions": {
    "allow": [],
    "deny": []
  }
}

2. Supported Models

The LongCat API Platform currently offers the following models:

Model NameAPI FormatDescription
LongCat-Flash-ChatOpenAI/AnthropicHigh-performance, general-purpose conversational model
LongCat-Flash-ThinkingOpenAI/AnthropicDeep-thinking model

Test Claude Code

Start Claude Code and send a simple test message:

claude

Then, enter a test message, such as: "Hello, please introduce yourself"

If the configuration is correct, you should receive a response from the LongCat model.

Last Updated: 9/18/25, 4:58 PM
Contributors: zhuqi09
Prev
API Docs
Next
FAQ