Docs · Providers

Meituan LongCat in Claude Code and Codex

LongCat is Meituan's model platform, serving its own LongCat models at api.longcat.chat. Accounts from longcat.chat and longcat.ai share that host: Chat Completions and Responses under /openai/v1, Anthropic Messages under /anthropic. Add LongCat in magpie, and Claude Code's, Codex's, Gemini CLI's and OpenCode's requests go as they are, with magpie's local gateway on 127.0.0.1:3425 routing them and holding the key.

Add LongCat

  1. Add the providerOn Providers, click + Add provider, pick LongCat, paste the key and save.
  2. Pick it for a toolOn Agents, pick a model such as LongCat-2.0 on a tool's row.

Keys are made at longcat.chat/platform/api_keys.

Terminal
magpie claude longcat/LongCat-2.0
magpie codex longcat/LongCat-2.0
magpie opencode longcat/LongCat-2.5-Preview

Endpoints

APIEndpoint
Chat Completionshttps://api.longcat.chat/openai/v1
Responseshttps://api.longcat.chat/openai/v1
Anthropic Messageshttps://api.longcat.chat/anthropic
/modelshttps://api.longcat.chat/openai/v1/models

Both take the key as Authorization: Bearer; with x-api-key alone LongCat answers missing_api_key, and magpie's Anthropic requests carry the key in both x-api-key and a Bearer by default, so they pass. An entry another app has at these endpoints is imported as LongCat.

Models

magpie gives LongCat-2.0 and LongCat-2.5-Preview, then reads LongCat's list from /openai/v1/models and serves that. Model names are case-sensitive; write them as the list does.

In each agent

FAQ

How do I use LongCat in Claude Code?

Add LongCat in magpie with your longcat.chat platform key, then pick LongCat-2.0 on Claude Code's row, or run magpie claude longcat/LongCat-2.0. Requests go to https://api.longcat.chat/anthropic.

Does LongCat work in Codex?

Yes. LongCat serves Responses under /openai/v1, so magpie passes Codex's requests through. Run magpie codex longcat/LongCat-2.0.

Why does Claude Code get missing_api_key from LongCat directly?

LongCat takes the key only as Authorization: Bearer and refuses x-api-key alone. Through magpie, the key goes in both x-api-key and a Bearer by default.

Does a longcat.ai account work?

Yes. longcat.chat and longcat.ai accounts share api.longcat.chat; add LongCat in magpie for either.

The same for other providers: StepFun, Xiaomi MiMo, DeepSeek, GLM Coding Plan, Kimi, DeepSeek, Qwen. Hit an error? See troubleshooting, or ask on Discord.