With opencode auth login and an opencode.json file, OpenCode can use LongCat-2.0. The official announcement says the model is available for free on OpenCode; the same page also explains how to toggle LongCat's thinking mode in OpenCode.
Suitable tasks: Use LongCat-2.0 as the coding model in OpenCode; explicitly control thinking mode in OpenCode (the thinking field)
Unsuitable tasks: Non-OpenCode environments (the configuration only applies to the OpenCode CLI)
Applicable model version: LongCat-2.0
Applicable client, agent, or API: OpenCode CLI (curl -fsSL https://opencode.ai/install | bash or npm i -g opencode-ai)
Recommended reasoning level and parameters: The official recommendation is to disable thinking by default in OpenCode (thinking: {"type": "disabled"}) to speed up iteration; use the /models command to switch models
curl -fsSL https://opencode.ai/install | bash
# Or: npm i -g opencode-ai
opencode auth login
# Select Other for Provider, then enter longcat
# Enter the LongCat API Key
# The key is saved at macOS/Linux: ~/.local/share/opencode/auth.json{
"$schema": "https://opencode.ai/config.json",
"provider": {
"LongCat": {
"npm": "@ai-sdk/openai-compatible",
"name": "LongCat",
"options": {
"baseURL": "https://api.longcat.chat/openai/v1"
},
"models": {
"LongCat-2.0": {
"name": "LongCat-2.0",
"options": {
"thinking": {
"type": "disabled"
}
}
}
}
}
}
}Note: LongCat's thinking mode is controlled by the thinking field in the request body: {"type":"enabled"} enables it (the default), while {"type":"disabled"} disables it. The example above disables thinking in OpenCode; change it to "enabled" when thinking is needed.
opencode
# Enter /models to switch to LongCat-2.0
# Start a conversationThe configuration and commands are transcribed verbatim from the official documentation (collected 2026-08-18).
Free access: On 2026-08-05, @Meituan_LongCat announced that “LongCat-2.0 is now available for free on @opencode” (the free OpenRouter endpoint is meituan/longcat-2.0:free; the Nous Portal directory also lists it at $0.00/1M).
A user test on r/opencodeCLI (early August 2026) generated a browser-based Ubuntu desktop demo in OpenCode in one shot; the prompt and output are reproducible (see prompt directory 08).
“Free access” is provided through OpenRouter's :free endpoint and may be rate-limited, concurrency-limited, or adjusted over time; refer to the OpenRouter page.
@ai-sdk/openai-compatible covers only the OpenAI-compatible protocol; the thinking-mode toggle inside OpenCode depends on the provider supporting the thinking field.
LongCat 2.0