Chat Completions

Create a chat completion using the OpenAI-compatible format. Supports both streaming (stream:true, SSE) and non-streaming responses.

POSThttps://api.longcat.chat/openai/v1/chat/completions

Authorizations

Authorizationstringheaderrequired

Authentication key, passed in the request header as Bearer YOUR_API_KEY.

Bodyapplication/json

modelstringrequired

Model identifier. Currently supports LongCat-2.5.

messagesarrayrequired

Array of message objects.

rolestringrequired

Author role, one of system · user · assistant.

contentstringrequired

Message content as a plain-text string.

streambooleanoptionaldefault: false

Whether to stream the response as SSE.

max_tokensintegeroptional

Maximum number of tokens to generate. The limit varies by model — see Model Parameters.

temperaturenumberoptionaldefault: 1.0

Sampling temperature. Fixed at 1.0 with thinking enabled and 0.7 with thinking disabled; other values are overridden with the corresponding default.

top_pnumberoptionaldefault: 0.95

Nucleus sampling parameter, range (0, 1].

thinkingobjectoptional

Whether to enable thinking. {"type":"enabled"} turns thinking on, {"type":"disabled"} turns it off.