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.

PropertyValue
Providerlongcat
AuthLONGCAT_API_KEY
APIOpenAI-compatible Chat Completions
Base URLhttps://api.longcat.chat/openai
Modellongcat/LongCat-2.0
Context1,048,576 tokens
Max output131,072 tokens
InputText

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.

505 words · updated Aug 17, 2026