Skip to main content
The Research Agent API returns a stream of typed messages. You can render them as they arrive, or you can wait for the stream to complete and print the assembled answer in one go. For a full reference of every message type and what each one carries, see Streaming responses. The example below buffers the ANSWER chunks and returns the complete answer text once the COMPLETE event arrives.
Output: