How to Use LongCat 2.0 Online: API, OpenRouter & Claude Code Guide
Learn three ways to use LongCat 2.0: the LongCat 2.0 Online Playground and API, OpenRouter when available, and Claude Code configuration.
You can use LongCat 2.0 in a browser, through an API, or inside a coding agent. The best route depends on whether you want a quick model test, an application integration, or a terminal workflow that can inspect and edit a repository.
This guide starts with the services available on LongCat 2.0 Online, then explains OpenRouter availability and the official Claude Code configuration. Provider listings can change, so verify the current provider page before moving a production workload.
Prerequisites and expected result
You need an account for the Playground or this site's API, and a separate provider key for OpenRouter or the official Claude Code gateway. By the end, you should be able to choose one route, run a test prompt, and identify which account is billed. Do not reuse a key across unrelated providers.
Option 1: try LongCat 2.0 in the browser
The fastest route is the LongCat 2.0 Online Playground. It is built into the homepage and does not require local code.
- Open the Playground.
- Log in with the available account provider.
- Enter a focused prompt.
- Run the model and review the output.
- Check the credit summary shown above the answer.
New accounts receive 2,000 starter credits. Daily login adds 100 credits, up to 1,000 login credits per month. Gift credits expire after 30 days. The Playground checks the account balance before sending a request and deducts credits only after a successful model response.
The current Playground output cap is 4,096 tokens. If LongCat 2.0 stops because it reaches that limit, the interface displays a warning. Use a follow-up prompt for the next section or move to the API when you need more control over output length.
A better first prompt
Avoid asking “Are you good at coding?” Give LongCat 2.0 a task with a result you can inspect:
Review this TypeScript function for correctness, explain the two highest-risk
bugs, then provide a revised implementation with three small test cases.This tests explanation, code editing, and consistency in one short request. Do not paste API keys, customer data, or private repository credentials into a public browser prompt.
Option 2: use the LongCat 2.0 Online API
Choose the API when your application needs to call LongCat 2.0 programmatically. The site's route follows the OpenAI chat completions format, so many existing SDK examples work after changing the base URL and API key.
First, log in and open the API key dashboard. Give the key a name that identifies the application or environment. Copy it immediately because the full secret is shown only once. The database stores a hash rather than the original key.
The endpoint is:
POST https://longcat20.online/api/v1/chat/completionsExample with cURL:
curl -X POST https://longcat20.online/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_LONGCAT20_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "LongCat-2.0",
"messages": [
{"role": "user", "content": "Explain this stack trace"}
],
"max_tokens": 1200
}'Example with the OpenAI Python SDK:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_LONGCAT20_API_KEY",
base_url="https://longcat20.online/api/v1"
)
response = client.chat.completions.create(
model="LongCat-2.0",
messages=[{"role": "user", "content": "Review this function"}],
max_tokens=1200,
)
print(response.choices[0].message.content)The API requires available credits. Input, cached input, and output have separate rates. Review the current numbers on the LongCat 2.0 API documentation and compare packages on the pricing page. Invalid keys, rejected requests, and upstream failures are not intended to consume successful-response credits.
Option 3: use OpenRouter when LongCat 2.0 is listed
Availability warning: LongCat 2.0 is not guaranteed to have a current OpenRouter listing. Verify the live directory before following any older setup guide.
LongCat 2.0 was associated with the stealth owl-alpha route during its preview period, and community users reported running that model through OpenRouter. A past route does not guarantee a current public listing.
Before configuring OpenRouter:
- Search the OpenRouter model directory for
LongCat-2.0. - Confirm the provider, context length, price, and model slug.
- Check whether tool calling and prompt caching are supported by that route.
- Use the exact slug shown on the current model page.
If no current listing exists, do not reuse an old Owl Alpha slug. Use the official LongCat API or the LongCat 2.0 Online API instead. OpenRouter is useful when you want one gateway for several models, but a gateway adds another layer for availability, logging, pricing, and privacy.
Option 4: connect LongCat 2.0 to Claude Code
Claude Code normally uses Anthropic's API, but it can connect to compatible gateways. The official LongCat platform publishes an Anthropic-compatible endpoint and a Claude Code settings example.
The official configuration uses values similar to:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your_longcat_api_key",
"ANTHROPIC_BASE_URL": "https://api.longcat.chat/anthropic",
"ANTHROPIC_MODEL": "LongCat-2.0",
"ANTHROPIC_SMALL_FAST_MODEL": "LongCat-2.0"
}
}Use the official LongCat platform key for that Anthropic endpoint. The API on this website is currently OpenAI-compatible and should not be substituted into an Anthropic Claude Code configuration.
Test the setup in a disposable repository. Keep normal permission prompts enabled, ask Claude Code to explain its plan before editing, and inspect the resulting diff. A one-million-token context window does not remove the need for good repository hygiene or careful tool permissions.
Which route should you choose?
| Goal | Recommended route |
|---|---|
| Quick browser test | LongCat 2.0 Online Playground |
| Build an application | LongCat 2.0 Online API |
| Compare several providers | OpenRouter, if a current listing exists |
| Terminal coding agent | Official LongCat Claude Code endpoint |
| Inspect or self-host weights | Official Hugging Face repository |
Start online, save one or two representative prompts, and move to the API only when you know what response shape and output length your application needs. That sequence gives you a clearer estimate of quality and cost than beginning with a large integration.