Docs
API referenceSign in

Streaming

Receive Chat Completions deltas as server-sent events instead of waiting for the entire response.

Enable streaming

Streaming
curl -N "https://api.yourdomain.com/v1/chat/completions" \
  -H "Authorization: Bearer $UNCENSOREDLABS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"YOUR_APPROVED_MODEL_ID","messages":[{"role":"user","content":"Hello"}],"max_tokens":256,"stream":true}'

The response uses text/event-stream. An SSE parser should assemble complete events across network reads; a single network chunk is not necessarily one event.

Stream events

SSE shape
data: {"choices":[{"delta":{"content":"Hello"}}]}

data: {"usage":{"prompt_tokens":128,"completion_tokens":6,"total_tokens":134}}

data: [DONE]

Delta and usage payloads are illustrative. Ignore empty deltas, handle the terminal marker, and surface protocol or connection errors instead of treating a partial answer as complete.

Billing and disconnects

The gateway requests final usage from the provider. A disconnect does not prove the provider did no work. If trusted usage cannot be established, the reserved credit remains pending reconciliation.