Server-Sent Events

When you set stream: true on /v1/chat/completions, the Gateway streams the upstream provider response as OpenAI-format SSE chunks.

Request#

Add "stream": true. With curl, pass -N so the output isn't buffered.

Try in Studio
curl -N https://api.atptoken.ai/v1/chat/completions \
  -H "Authorization: Bearer $ATP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID",
    "messages": [{"role": "user", "content": "hi"}],
    "stream": true
  }'

Usage and the end of the stream#

The final chunk contains the usage object; the stream ends with data: [DONE].

Was this page helpful?