Skip to main content

Chat Completion Object

/v1/chat/completions returns chat.completion for non-streaming requests and chat.completion.chunk for streaming requests. This page focuses on the most stable, broadly useful OpenAI-compatible response structure on Crazyrouter today.

Non-streaming object

Minimal production request:
cURL
curl https://crazyrouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.4",
    "messages": [
      {
        "role": "user",
        "content": "Explain what a REST API is in one sentence."
      }
    ],
    "max_tokens": 64
  }'
Typical production response skeleton:
{
  "id": "chatcmpl-xxx",
  "object": "chat.completion",
  "created": 1774177466,
  "model": "gpt-5.4",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "...",
        "reasoning_content": null,
        "tool_calls": null
      },
      "finish_reason": "stop"
    }
  ]
}

How to read it

  • message.content is the final text answer
  • message.tool_calls only appears when the model is requesting tool execution
  • message.reasoning_content may appear for some models or routes, but should not currently be treated as a guaranteed field

Streaming object

For streaming requests, the server returns chat.completion.chunk SSE events:
{
  "id": "chatcmpl-xxx",
  "object": "chat.completion.chunk",
  "created": 1774177466,
  "model": "gpt-5.4",
  "choices": [
    {
      "index": 0,
      "delta": {
        "role": "assistant",
        "content": "..."
      },
      "finish_reason": null
    }
  ]
}
Common SSE shape:
data: {"object":"chat.completion.chunk",...}
data: {"choices":[{"delta":{"content":"..."}}],...}
data: [DONE]

Fields you will usually care about

FieldMeaning
objectchat.completion for non-streaming, chat.completion.chunk for streaming
modelThe actual model used for the response
choices[].message.contentFinal non-streaming text
choices[].message.tool_callsNon-streaming tool requests
choices[].delta.contentStreaming text delta
choices[].finish_reasonStop reason such as stop, length, or tool_calls
Upstream models may pass through extra fields. Client code should rely on the stable common fields first rather than assuming every model exposes the same extensions.