DOCS / V1 / CORE API
CORE API

Streaming

Receive the answer as it is generated, as server-sent events.

Enable streaming

The response is text/event-stream: a series of data: chunks ending with data: [DONE].

ParameterTypeDescription
streamrequiredbooleanSet to true to stream. Defaults to false.
stream_options.include_usagebooleanAdds token usage to the final chunk. Enabled automatically; set to false to opt out.
curl -N https://api.eggsplain.com/v1/chat/completions \
  -H "Authorization: Bearer $EGGSPLAIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "auto",
  "stream": true,
  "messages": [
    { "role": "user", "content": "Tell me a story." }
  ]
}'

Raw events

Each event is a JSON chunk prefixed with data:. The cURL tab above (with -N to disable buffering) prints them as they arrive.

Reasoning tokens and tool-call deltas arrive on the same stream; the tester renders them under [reasoning] and [tool_call].