> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Outputs and retries

> Validate Python agent outputs and retry bounded model failures.

Use final-output validation when downstream Python code expects structured data. Validation callbacks should be deterministic and should raise when the final value does not meet the application contract.

Configure bounded retries with `AgentModelRetryConfig`:

```python theme={null}
retry = AgentModelRetryConfig(max_retries=2, backoff_ms=250)
```

The completed step retains its final model-attempt count. Tool errors use their own policy and are not retried as model requests.

The gateway client accepts structured output, routing, provider, reasoning, managed-tool, plugin, prompt-cache, and additional request options.

## Related

* [Dynamic turns](./agent-sdk-dynamic-turns)
* [Stop conditions](./agent-sdk-stop-conditions)
* [Errors and troubleshooting](./agent-sdk-observability)
