Chat

Create chat completion

OpenAI-compatible hosted chat completion. See the chat completions reference for the exact forwarding contract.

post/chat/completions

Request body

modelstring required

Model id returned by GET /v1/models.

streamboolean

When true, the response is a server-sent event stream.

temperaturenumber
max_tokensinteger
max_completion_tokensinteger
top_pnumber
ninteger
best_ofinteger
{"stackTrail":"components:schemas:ChatCompletionRequest:properties:tool_choice","oasType":"schema","type":"unknown"}
reasoning_effort'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'

Reasoning effort for this request. Which of these values a model honors, and which it rejects, is model specific and is stated on that model's page; deepseek-v4-flash applies max when the field is omitted and sends high and xhigh upstream as max. On a model that cannot enforce a response format while it is reasoning, a request carrying response_format is refused with 400 hosted_parameter_not_supported and param response_format unless it also sends reasoning_effort none.

{"stackTrail":"components:schemas:ChatCompletionRequest:properties:response_format","oasType":"schema","type":"unknown"}

Example request

{
  "model": "deepseek-v4-flash"
}

Response

Chat completion (or SSE stream if stream=true)

idstring required
objectstring required
createdinteger required
modelstring required

Example response

{
  "id": "chatcmpl_abc123",
  "object": "chat.completion",
  "choices": [
    {
      "runinfra": {
        "output_status": {
          "message": "The model reached its generation limit before producing answer content. Increase max_tokens or max_completion_tokens if the model limit allows, or shorten the prompt, then retry."
        }
      }
    }
  ],
  "usage": {
    "cost": 0.00294,
    "runinfra": {
      "cost_microcents": 294000
    }
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.