> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dari.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat Completions API

> Send a routed OpenAI-compatible chat completion request

<ParamField header="Authorization" type="string" required>
  `Bearer` plus a Routing API key.
</ParamField>

<ParamField body="model" type="string" required>
  Must be `dari/routing`.
</ParamField>

<ParamField body="messages" type="array" required>
  OpenAI-style messages.
</ParamField>

<ParamField body="stream" type="boolean">
  Stream with Server-Sent Events.
</ParamField>

<ParamField body="tools" type="array">
  OpenAI-style tool definitions.
</ParamField>

<ParamField body="reasoning_effort" type="string">
  Require the selected model to use exactly `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. Models that do not support that level are ineligible.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://routing.dari.dev/v1/chat/completions \
    -H "Authorization: Bearer $DARI_ROUTING_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "dari/routing",
      "messages": [{"role": "user", "content": "Hello from Dari"}]
    }'
  ```
</RequestExample>

The response follows the OpenAI Chat Completions shape. `dari_routing` adds `selected_model`, `reasoning_effort`, `reason`, and `conversation_id`.

The `/v1` endpoint uses your organization's default router. To address a specific router instead, send the same request to `https://routing.dari.dev/{router_id}/chat/completions`.
