API reference

Chat completions

Create a model response for a conversation. OpenAI-compatible.

POST   https://cinder-pn3.pages.dev/v1/chat/completions

Request body

FieldTypeDescription
modelstringRequired. Model ID, e.g. deepseek-v4-flash.
messagesarrayRequired. List of messages with role (system, user, assistant, tool) and content.
streambooleanStream partial deltas as SSE. Default false.
temperaturenumberSampling temperature, 0–2. Default 1.
top_pnumberNucleus sampling, 0–1. Default 1.
max_tokensintegerMax tokens to generate in the response.
toolsarrayFunction/tool definitions the model may call.
response_formatobjectSet { "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

StatusMeaning
401Missing or invalid API key.
402Insufficient balance — top up on the platform.
429Rate limited. Back off and retry.
400Malformed request body.