Skip to main content
A ready-to-run example is available here!

Pausing Execution

Pause the agent from another thread or after a delay using conversation.pause(), and Resume the paused conversation after performing operations by calling conversation.run() again.

Ready-to-run Example

This example is available on GitHub: examples/01_standalone_sdk/09_pause_example.py
Pause agent execution mid-task by calling conversation.pause():
examples/01_standalone_sdk/09_pause_example.py
You can run the example code as-is.
The model name should follow the LiteLLM convention: provider/model_name (e.g., anthropic/claude-sonnet-4-5-20250929, openai/gpt-4o). The LLM_API_KEY should be the API key for your chosen provider.
ChatGPT Plus/Pro subscribers: You can use LLM.subscription_login() to authenticate with your ChatGPT account and access Codex models without consuming API credits. See the LLM Subscriptions guide for details.

Next Steps