API reference

Chat completions

POST /v1/chat/completions — the primary endpoint for all models.

Request body

json
{{
  "model": "claude-sonnet-5",
  "messages": [
    {{"role": "system", "content": "You are a concise assistant."}},
    {{"role": "user", "content": "Summarise this in one line."}}
  ],
  "max_tokens": 2048,
  "temperature": 0.2
}}

Supported parameters

  • model, messages, max_tokens, temperature, top_p
  • stream, stop, presence_penalty, frequency_penalty
  • tools, tool_choice, response_format

Response

Standard OpenAI chat completion object with an added billing_usage block describing the upstream token counts used for charging.