> ## 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 OpenAI-compatible Chat Completions requests through a router.

```bash 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"}]
  }'
```

Use `/v1` for your default router. For a specific router, send the same body to `https://routing.dari.dev/{router_id}/chat/completions`.

The response follows the OpenAI Chat Completions format and adds `dari_routing`, which identifies the selected model and reasoning effort.

## Streaming

Set `stream: true`. Dari returns Server-Sent Events in the OpenAI stream format, with `dari_routing` in the first event and `data: [DONE]` at the end.

## Tool Calls

Send standard OpenAI `tools` and `tool_choice` fields. If the selected model calls a tool, append the result as a `tool` message and send the complete message history again.

See the [Chat Completions API Reference](/api-reference/router/chat-completions) for supported fields.
