Documentation

Your familiar SDK. A clear path from API key to first response.

Chat completions

Choose a guide or find an API method. Copy examples to your project; this page does not execute requests.

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.

Base URL
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].

Search documentation