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

# On Failover • AI Agent SDK

> on_failover: Register a callback for failover events.

# on\_failover

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**FailoverManager**](../classes/FailoverManager) class in the [**failover**](../modules/failover) module.

Register a callback for failover events.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def on_failover(callback: Callable[[AuthProfile, AuthProfile], None]) -> None
```

## Parameters

<ParamField query="callback" type="Callable" required={true}>
  Function called with (failed\_profile, new\_profile)
</ParamField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/llm/failover.py#L365">
  `praisonaiagents/llm/failover.py` at line 365
</Card>
