Skip to content

Models

Streaming concepts

Receive output incrementally as it is generated.

With streaming enabled, the response arrives as a series of events instead of a single payload. This lets interfaces show text as it is produced.

json
{ "model": "modelport-demo/atlas-chat", "stream": true, "messages": [...] }

Handling streams

  • Read events until a final done event arrives.
  • Concatenate content deltas in order.
  • Usage totals are reported in the final event.
  • Handle disconnects by retrying the whole request.