LongCat-2.5 in Claude Code: Setup, Pricing, and Benchmarks
Connect LongCat-2.5 through its Anthropic-compatible endpoint or Responses API, then verify a real file-read task. Distinguish the current 1M context and 256K API output limits from client limits. Compare its published coding results with GLM-5.3, Kimi K3, and DeepSeek-V4.1-Flash, calculate session costs, and handle throttling. Check the release page's weight-download status before planning local deployment.
Contents

To set up LongCat-2.5 in Claude Code, use LongCat’s Anthropic endpoint and the exact model ID LongCat-2.5. Start with a small repository task before moving long coding sessions. Codex users can use the documented Responses API route below.
What does LongCat-2.5 change?
LongCat-2.5 is Meituan’s native multimodal model for tasks that involve many reasoning and tool-use steps. Its release post describes stronger visual understanding and coding capabilities than LongCat-2.0. It reports 1.6 trillion total parameters, with approximately 48 billion activated per token.
The blog is dated 2026-11-01. The API changelog announces availability on 2026-11-02.
As of 2026-11-06, the current model reference lists these limits:
| Limit | LongCat-2.5 |
|---|---|
| Context window | 1,048,576 tokens, or 1M |
| Maximum API output | 262,144 tokens, or 256K |
A client can impose a lower output cap or compact a conversation earlier. Neither Claude Code nor Codex automatically inherits every advertised service limit.
Try LongCat on multi-file changes or visual development tasks where you can check the output. Its published scores justify a trial, but they do not establish that it will outperform your current model.
How do you configure Claude Code?
Use LongCat’s Anthropic-compatible route, with the credential supplied through your shell. You need an installed Claude Code CLI, a LongCat account, and an API key created on the platform’s API Keys page. For pay-as-you-go access, maintain sufficient prepaid balance and top up if needed.
In Bash, collect the key without displaying it:
read -rs LONGCAT_API_KEY && export LONGCAT_API_KEY
unset ANTHROPIC_API_KEY
export ANTHROPIC_AUTH_TOKEN="$LONGCAT_API_KEY"
Merge this configuration into ~/.claude/settings.json. Keep your existing permissions and unrelated settings.
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.longcat.chat/anthropic",
"ANTHROPIC_MODEL": "LongCat-2.5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "LongCat-2.5",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "LongCat-2.5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "LongCat-2.5",
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "32000",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}
This adapts LongCat’s Claude Code configuration for a small initial test. It keeps the secret outside JSON and uses the current Haiku mapping.
| Field or variable | Purpose |
|---|---|
env | Supplies environment variables to Claude Code. |
ANTHROPIC_AUTH_TOKEN | Sends your LongCat key through bearer authentication. Set it in Bash, as shown above. |
ANTHROPIC_BASE_URL | Selects LongCat’s Anthropic route. Leave off /v1; the Messages path is appended by the client. |
ANTHROPIC_MODEL | Selects LongCat-2.5 for the main session. |
ANTHROPIC_DEFAULT_SONNET_MODEL | Maps the sonnet slot to LongCat. |
ANTHROPIC_DEFAULT_OPUS_MODEL | Maps the opus slot to LongCat. |
ANTHROPIC_DEFAULT_HAIKU_MODEL | Maps haiku and background functionality to LongCat. |
CLAUDE_CODE_MAX_OUTPUT_TOKENS | Sets this example’s starting output budget to 32000. It does not set the context window. |
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Disables nonessential client traffic. It also disables automatic updates, so arrange another update path. |
LongCat’s sample still uses ANTHROPIC_SMALL_FAST_MODEL. Anthropic’s model configuration reference deprecates it in favor of ANTHROPIC_DEFAULT_HAIKU_MODEL.
LongCat’s current sample also sets CLAUDE_CODE_MAX_OUTPUT_TOKENS to 262144. However, Anthropic’s environment reference documents a 128000 cap when Claude Code cannot resolve a model ID. In that case, larger values are clamped. The smaller budget above avoids assuming the API’s 256K ceiling is available through the client.
Remove conflicting credential entries from existing Claude settings before relying on the shell key. The unset command only clears the shell variable. Settings-file values can override shell exports.
Open a small checkout containing README.md, then launch from the same Bash session:
claude
Run /status and check the model, base URL, and credential source. Ask it to read README.md and summarize the project without editing files. Confirm an actual file-read action and a relevant answer; a greeting alone does not test tool use.
How do you test the OpenAI-compatible API?
Use a direct SDK request to check the key and endpoint independently of an agent’s configuration. The SDK base URL is https://api.longcat.chat/openai/v1.
Use Python 3.10 or newer for this example. In the same Bash session, with LONGCAT_API_KEY already exported, run:
python3 -m venv .venv-longcat
source .venv-longcat/bin/activate
python -m pip install --upgrade openai
python - <<'PY'
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["LONGCAT_API_KEY"],
base_url="https://api.longcat.chat/openai/v1",
max_retries=0,
)
response = client.chat.completions.create(
model="LongCat-2.5",
messages=[
{"role": "user", "content": "Reply with exactly LONGCAT_OK."}
],
max_tokens=1024,
extra_body={"thinking": {"type": "disabled"}},
)
print(response.model)
print(response.choices[0].message.content)
print(response.choices[0].finish_reason)
print(response.usage)
PY
The SDK appends /chat/completions, producing the endpoint in LongCat’s Chat Completions reference. Keep /v1 in this SDK base URL.
The requested answer is LONGCAT_OK. Check for nonempty content, the returned model, a normal completion, and usage data. This is a connection check, not a coding evaluation. Thinking is disabled to keep the check small.
The OpenAI Python SDK accepts additional request fields through extra_body. Here, max_retries=0 surfaces a failure immediately; the example does not automatically apply the retry policy below.
Can Codex use LongCat-2.5?
Yes. LongCat now publishes a Codex integration guide and a separate Responses API reference. Use wire_api = "responses" for this route.
With Codex installed, merge the following into ~/.codex/config.toml. Keep root keys above the first table, and update existing entries instead of duplicating them.
model = "LongCat-2.5"
model_provider = "longcat"
web_search = "disabled"
[model_providers.longcat]
name = "LongCat"
base_url = "https://api.longcat.chat/openai/v1"
wire_api = "responses"
env_key = "LONGCAT_API_KEY"
requires_openai_auth = false
The longcat identifier connects model_provider to its provider table. env_key reads the exported key. requires_openai_auth = false selects provider-key authentication for this example. OpenAI’s authentication guide warns that setting it to true makes Codex ignore env_key.
This adapts LongCat’s recipe to keep credentials out of auth.json. Web search remains disabled for the initial check.
From the same Bash session and test checkout, run:
codex --sandbox read-only
Inspect /status, then request the same README.md summary. Require an observed file read and a useful answer. The model request uses https://api.longcat.chat/openai/v1/responses; a working Chat Completions request alone does not verify this separate route.
How does it compare with GLM-5.3, Kimi K3, and DeepSeek?
Treat the official scores as a shortlist for project trials. LongCat’s release table combines its own results with externally reported competitor results.
| Benchmark | LongCat-2.5 | GLM-5.3 | kimi-k3 | DeepSeek-V4.1-Flash |
|---|---|---|---|---|
| Terminal Bench v2.1 | 88.4 | 88.2* | 88.3* | 90.6* |
| Terminal Bench v4.0 | 38.5 | 41.8* | 12.6* | 31.2* |
| Program Bench Almost Resolved | 25.5 | 19.0* | 17.5* | 20.3* |
| DeepSWE v1.1 | 64.6 | 66.9* | 67.5* | 74.2* |
| NL2Repo | 60.5 | 58.0* | 58.0* | 65.4* |
The asterisk means the competitor score comes from a public technical report, blog, or official leaderboard. Other unmarked competitor scores in the full table are LongCat’s own runs and are described as indicative. All competitor cells shown above carry an asterisk.
The published methods matter:
- LongCat-2.5 generally uses
enable_thinking=on,temperature = 1.0, andtop_p = 0.95. - Terminal Bench v2.1/v4.0, Program Bench, and NL2Repo use Claude Code
v2.1.280withmax_seq_length = 512K. - DeepSWE v1.1 uses
mini-swe-agentwithmax_seq_length = 1M. - Terminal Bench v2.1 and DeepSWE results average three independent runs.
These settings describe LongCat’s evaluation; they do not establish identical conditions for the externally sourced scores.
LongCat leads these three alternatives on Program Bench Almost Resolved. GLM-5.3 scores higher on Terminal Bench v4.0, while all three alternatives score higher on DeepSWE. Differences of 0.1 or 0.2 on Terminal Bench v2.1 do not establish a practical winner without matched tests.
For a repository repair trial, keep DeepSeek-V4.1-Flash in the comparison. For project-building tasks, include LongCat. The DeepSeek coding and benchmark guide helps keep its release variants separate.
Use the same repository commit, prompt, tool permissions, acceptance tests, and retry budget. Record accepted results, elapsed time, and total charges. Switch only if that trial improves the measures your team values.
What does LongCat-2.5 cost?
Budget with the published limited-time rates, then recheck them before committing a recurring workload. As of 2026-11-06, LongCat’s pricing page lists:
| Token category | USD per 1M tokens |
|---|---|
| Uncached input | $0.30 |
| Cached input | $0.006 |
| Output | $1.20 |
The pricing and pay-as-you-go pages state no promotion end date or regular undiscounted price. They say platform prices and billing records are authoritative. Do not turn “limited-time” into an assumed expiry date or savings percentage.
For an aggregate session across several requests, assume 1,000,000 uncached input tokens and 100,000 billed output tokens. At the listed rates, with zero cache hits and no negotiated discount:
(1,000,000 / 1,000,000 × $0.30) + (100,000 / 1,000,000 × $1.20) = $0.42
This is an estimated token charge, not a measured task cost. The quantities are session totals, not one request.
For Responses requests, usage.output_tokens includes the reasoning subset, according to the Responses API reference. Do not add that subset again. Cached input is likewise a subset of input; apply its lower rate only to usage actually reported as cached.
Token prices alone cannot establish the cheapest coding model. Use cost per accepted task when retries, long reasoning, or failed code changes affect the bill.
What should you do about 429 rate_limit_exceeded?
Reduce simultaneous requests and retry with a bounded delay policy. LongCat’s API overview says rate limits apply per API key.
The Quick Start shows this example:
{
"error": {
"code": "rate_limit_exceeded",
"message": "Request rate limit exceeded, please try again later",
"type": "rate_limit_error",
"retry_after": 60
}
}
The example’s 60 is not a promised reset deadline. Use returned retry guidance and exponential backoff.
For your own client, a reasonable starting policy is at most three retries, with increasing waits and random jitter. That is an implementation recommendation, not a LongCat quota. Queue requests that share the key, and account for any retries already performed by your SDK.
After waiting, send one small request. If it succeeds, restore concurrency gradually. If throttling continues, check the account’s applicable limits with LongCat. The reviewed public documentation gives no numeric requests-per-minute or tokens-per-minute allowance.
If the error instead says insufficient_quota, check the balance and applicable quota. Repeatedly retrying unchanged requests does not address that condition.
Are LongCat-2.5 weights available?
Plan this integration around hosted inference. As of 2026-11-06, the release page labels its GitHub and Hugging Face links “Coming soon.” Those controls provide no usable checkpoint download or dated release commitment.
That status does not make the model literally API-only: Meituan also announces access through its website. For local deployment, wait for an actual LongCat-2.5 checkpoint, license, and serving instructions.
Start with the client you already use, complete the file-read check, then test one bounded coding change. If you move an existing task, preserve its requirements and test results with a model handoff checkpoint.