Streaming responses

Consume incremental AI responses reliably from your server.

Overview

Streaming endpoints deliver incremental AI output using server-sent events. Your server should parse complete event frames, handle reconnects, and only persist the final result after the stream signals completion.

Do not assume each network chunk is a complete event. Buffer until the blank-line delimiter, inspect the event type, then decode its JSON payload. Set an application-level timeout and surface partial-output failures clearly.

Next steps

Use the final result identifier to retrieve durable output and its citations.

On this page