Response Id for canceled streams before completion

Hello everyone,

If you cancel a stream before it’s complete, can the response id you get in the created event be used as the previous_response_id in the next run? Getting HTTP 400 (invalid_request_error: previous_response_not_found) error.

In streaming, closing the connection is a termination of the generation.

You would have to use “background” mode on the Responses API:

  • streaming will termate on you if it runs for more than a few minutes
  • slower startup
  • then GET and poll the status to see if transitions to completed with a useful output array (or subscribe to webhook).
1 Like