# Chat completions · Quanteex

## Chat completions

POST /v1/chat/completions

### Request

Send model and a nonempty messages array. Current GPT routes work with standard authentication headers; the output-policy header in examples is optional. Native max_tokens or max_completion_tokens hints are forwarded, but do not guarantee a limit. Only one completion per request is supported.

### Example request

Start with a text request. The reply is in choices[0].message.content. Optional tools and structured output depend on the selected model.

```
curl "https://api.quanteex.com/v1/chat/completions" \
  -H "Authorization: Bearer $QUANTEEX_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Quanteex-Output-Policy: provider_maximum" \
  --data '{
  "model": "gpt-6-astra",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ]
}'
```

### Streaming

Set stream: true. Read choices[0].delta.content as it arrives. Set stream_options.include_usage to true for final token usage, and read until [DONE].

Make your first request with Quanteex.

Retry only when the outcome is safe to repeat.

