> ## 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 .NET agent outputs and retry bounded model failures.

Use final-output validation when downstream .NET code expects a structured value. Treat validation failures as contract errors rather than transient transport failures.

Configure bounded retries with `ModelRetryConfig`:

```csharp theme={null}
ModelRetry = new ModelRetryConfig
{
    MaxRetries = 2,
    Backoff = TimeSpan.FromMilliseconds(250),
}
```

The completed step retains its final model-attempt count. Local tool failures are handled separately and are not retried as model requests.

`GatewayAgentClientOptions` carries structured response, routing, provider, reasoning, tool-choice, 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)
