Enable streaming
To start streaming responses, setstream=True in your request to the Responses endpoint:
Read the responses
If you’re using our SDK, every event is a typed instance. You can also identity individual events using thetype property of the event.
Some key lifecycle events are emitted only once, while others are emitted multiple times as the response is generated. Common events to listen for when streaming text are: