API reference
Chat completions
Create a model response for a conversation. OpenAI-compatible.
POST https://cinder-pn3.pages.dev/v1/chat/completions
Request body
| Field | Type | Description |
|---|---|---|
model | string | Required. Model ID, e.g. deepseek-v4-flash. |
messages | array | Required. List of messages with role (system, user, assistant, tool) and content. |
stream | boolean | Stream partial deltas as SSE. Default false. |
temperature | number | Sampling temperature, 0–2. Default 1. |
top_p | number | Nucleus sampling, 0–1. Default 1. |
max_tokens | integer | Max tokens to generate in the response. |
tools | array | Function/tool definitions the model may call. |
response_format | object | Set { "type": "json_object" } to force valid JSON output. |
Example request
curl https://cinder-pn3.pages.dev/v1/chat/completions \
-H "Authorization: Bearer $CINDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [
{ "role": "system", "content": "You are concise." },
{ "role": "user", "content": "Name three primary colors." }
],
"temperature": 0.7
}'
Response
{
"id": "chatcmpl-9f3a...",
"object": "chat.completion",
"created": 1718841600,
"model": "deepseek-v4-flash",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Red, blue, and yellow." },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 22, "completion_tokens": 7, "total_tokens": 29 }
}
Streaming
With "stream": true, the response is a sequence of data: SSE lines, each a
chat.completion.chunk with a delta. The stream ends with data: [DONE].
data: {"choices":[{"delta":{"content":"Red"}}]}
data: {"choices":[{"delta":{"content":", blue"}}]}
data: [DONE]
Errors
| Status | Meaning |
|---|---|
401 | Missing or invalid API key. |
402 | Insufficient balance — top up on the platform. |
429 | Rate limited. Back off and retry. |
400 | Malformed request body. |