Skip to main content

Streaming responses

Set "stream": true on POST /v1/chat/completions to receive the response as a server-sent-event stream in the same shape the OpenAI SDK expects. Token usage is reported on the final chunk.

curl -sS https://api.alt.advania.ai/v1/chat/completions \
-H "Authorization: Bearer $ALT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "advania-chat-small",
"stream": true,
"messages": [{"role": "user", "content": "Write a haiku."}]
}'

The full chunk shape is in the interactive OpenAPI.