LongCat Provider Setup for LongCat-2.0 API
Learn how to install the LongCat plugin, generate an API key, and configure LongCat-2.0 for coding and agentic tasks. This guide is for developers integrating LongCat's hosted reasoning model.
Read this when
- You want to use LongCat-2.0 with OpenClaw
- You need the LongCat API key or model limits
LongCat offers a hosted API for LongCat-2.0, a reasoning model tailored to coding and agentic tasks. The official LongCat plugin for OpenClaw connects to LongCat's OpenAI-compatible endpoint.
| Property | Value |
|---|---|
| Provider | longcat |
| Auth | LONGCAT_API_KEY |
| API | OpenAI-compatible Chat Completions |
| Base URL | https://api.longcat.chat/openai |
| Model | longcat/LongCat-2.0 |
| Context | 1,048,576 tokens |
| Max output | 131,072 tokens |
| Input | Text |
Install plugin
Get the official package installed, then restart Gateway:
openclaw plugins install @openclaw/longcat-provider
openclaw gateway restart
Getting started
Create an API key
Head to the LongCat API Platform and generate a key from the API Keys section.
Run onboarding
openclaw onboard --auth-choice longcat-api-key
Verify the model
openclaw models list --provider longcat
During onboarding, the hosted catalog gets added and longcat/LongCat-2.0 becomes the default selection when no primary model exists yet.
Non-interactive setup
openclaw onboard --non-interactive --accept-risk --skip-health \
--mode local \
--auth-choice longcat-api-key \
--longcat-api-key "$LONGCAT_API_KEY"
Reasoning behavior
Binary thinking control is exposed by LongCat. Enabled thinking levels are translated by OpenClaw into thinking: { type: "enabled" } and /think off, mapping to thinking: { type: "disabled" }. Since reasoning_effort isn't documented by LongCat at this time, OpenClaw omits it from requests.
Reasoning comes back in reasoning_content from LongCat. That field is preserved by OpenClaw when replaying assistant tool-call turns, keeping multi-turn agent sessions aligned with the provider's expected message format.
Pricing
List prices from LongCat's pay-as-you-go catalog, in USD per million tokens, drive the built-in catalog: $0.75 for uncached input, $0.015 for cached input, and $2.95 for output. Temporary discounts may appear from LongCat; the pricing page and your billing statements are the final authority.
Self-hosted LongCat-2.0
LongCat's hosted API is what the longcat provider targets. For the open weights available on Hugging Face, run the model through an OpenAI-compatible runtime and rely on OpenClaw's existing vLLM or SGLang provider.
When self-hosting, keep the exact model identifier from the runtime in the provider catalog; avoid sending a local deployment through longcat/LongCat-2.0.
Troubleshooting
The key works in a shell but not in the Gateway
Interactive shell variables aren't fully inherited by daemon-managed Gateway processes. Set LONGCAT_API_KEY in ~/.openclaw/.env, configure it via onboarding, or reference an approved secret.
Requests fail with 402 or 429
Insufficient token quota on the account triggers 402. A rate limit on the API key causes 429. Review LongCat usage and wait out the provider's backoff window before retrying rate-limited calls.
The model does not appear
Execute openclaw plugins list and verify the longcat plugin is active, then run openclaw models list --provider longcat.
Related
-
Model providers, Provider setup, model references, and failover handling.
-
LongCat API docs, Hosted API endpoints, authentication, limits, and usage examples.
-
LongCat-2.0 model card, Architecture, deployment notes, and model specifics.
-
Secrets, Keep provider credentials out of plaintext config.