Skip to main content
Background mode submits a Responses request and polls automatically for completion. Agno stops after background_max_wait, which defaults to 600 seconds.
The source docstring overstates background-mode resilience. Polling requires connectivity, stops after background_max_wait, and surfaces polling failures.
background.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Run the example

Save the code above as background.py, then run:
Full source: cookbook/90_models/openai/responses/background.py