Routing and failover
Aikey365 API keys can include routing policies that select among eligible upstream channels and optionally fail over after errors.
Routing modes
The current client schema defines:
- balanced — general balance across reliability, latency, and cost
- economy — stronger cost preference
- stable — stronger reliability preference
These names describe strategy direction; they are not fixed guarantees of cost, latency, or availability.
Smart and manual selection
- smart lets the platform select from eligible candidates.
- manual narrows candidates to an explicitly selected set.
Start with fewer constraints, then add business-specific requirements.
Advanced constraints
The implementation includes fields for success rate, P95 latency, input/output price ranges, excluded channels, failover, and maximum attempts.
Too many constraints can result in no eligible route.
Failover
Failover may try another eligible channel after a failure, but it cannot guarantee success. For billable generation requests, avoid unlimited client-side retries because an upstream may have accepted a request before the connection failed.
Recommended process
- Verify the model has eligible candidates.
- Start with the default or balanced policy.
- Observe production success rate, latency, and cost.
- Add constraints gradually.
- Validate major policy changes with a test key first.