Chat completions
POST /v1/chat/completions is the OpenAI chat surface, re-exported by the
gateway. If your SDK already speaks OpenAI, only baseURL and the model group
change.
Try it
Try a completion
POST /v1/chat/completionsResponse
No response yet.
Request
{
"model": "deepseek-flash",
"messages": [
{ "role": "system", "content": "You are concise." },
{ "role": "user", "content": "What is an LLM gateway?" }
],
"temperature": 0.7,
"max_tokens": 1024,
"stream": false
}| Field | Notes |
|---|---|
model | A model group or one of its aliases. |
messages | Standard OpenAI roles: system, user, assistant. |
temperature | 0–2; forwarded to the provider. |
max_tokens | Upper bound on the completion, up to the group's max output. |
stream | true returns SSE chunks; recommended for slow reasoning. |
reasoning_effort | DeepSeek groups: none, low, high (default), max. |
Response
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "deepseek-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "...",
"reasoning_content": "..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 61,
"total_tokens": 85
}
}usage is what the gateway meters against the key's budget. The model field
echoes the group you requested; it does not identify the provider or a fallback
that served the call.
Streaming
With "stream": true the response is text/event-stream. Each chunk is a
data: {...} line; the stream ends with data: [DONE].
curl -N -sS "https://llms.party/v1/chat/completions" \
-H "Authorization: Bearer $LLMS_PARTY_KEY" \
-H "content-type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"stream": true,
"messages": [{"role": "user", "content": "Plan a migration in three bullets."}]
}'const stream = await client.chat.completions.create({
model: 'deepseek-v4-pro',
stream: true,
messages: [{ role: 'user', content: 'Plan a migration in three bullets.' }],
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}stream = client.chat.completions.create(
model="deepseek-v4-pro",
stream=True,
messages=[{"role": "user", "content": "Plan a migration in three bullets."}],
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")Vision
deepseek-flash accepts images in the standard OpenAI content-part shape:
{
"model": "deepseek-flash",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "What is in this image?" },
{
"type": "image_url",
"image_url": { "url": "https://example.com/chart.png" }
}
]
}
]
}Reasoning
deepseek-flash and deepseek-v4-pro both run with thinking enabled by
default. Set reasoning_effort to control how much work the model does before
it answers.
reasoning_effort | Behaviour |
|---|---|
none | Thinking off. Fastest, lowest token count. |
low | Short trace. A small latency and token cost. |
high | Default. A full trace for most prompts. |
max | Longest trace. Use it for hard multi-step problems. |
The trace comes back in reasoning_content. Its size is reported in
usage.completion_tokens_details.reasoning_tokens, and the tokens count toward
the completion and the key's budget.
| Response field | Meaning |
|---|---|
choices[].message.reasoning_content | The model's thinking trace, when thinking is on. |
usage.completion_tokens_details.reasoning_tokens | Tokens spent on the trace. |