Key strategy and failover
Understand gateway routing and retry boundaries.
Use the site key settings
Available groups, model restrictions and policies are subject to the API Key page. When a policy is displayed on the interface, read its description first, and do not use the “smart key” naming of the reference platform to infer that this site has exactly the same algorithm and service guarantee.
Switch between channels of the same model
Administrators can configure multiple sources for the same model and retry based on priority, weight, and error conditions. Only sources that are available and satisfy the request constraints can participate. Persistent parameter errors, insufficient permissions, or capabilities not supported by the model cannot be solved by infinite switching.
Application layer coordination
Use bounded concurrency and reasonable timeouts. Distinguish between gateway internal retries and overall application retries to avoid request amplification caused by the superposition of the two layers. After the streaming response has begun, the client should handle partial results instead of being able to seamlessly switch to replay by default.
Commitments that cannot be inferred
There is no promise of automatic migration across models, zero failures, fixed hit rates, or fixed latencies. The usability goals that the enterprise needs to determine should confirm the written scope through the site’s business or support channels.
Verify first and then adjust the strategy
First fix the Key, model and protocol to complete the small request, and then check the key policies available for the current account. Do not adjust multiple switches at the same time. After the strategy is changed, compare the error rate, time consumption and actual sources, and retain the change time for easy verification records.
Three layers of retries need to be distinguished
| Hierarchy | Scope of Responsibility | Notes |
|---|---|---|
| Gateway channel retry | Available sources that meet configuration conditions | Do not repair business parameter errors |
| SDK retries | SDK-defined temporary errors | Check default times and timeouts |
| Application business retry | Business task recovery | Prevent repeated submission of charging operations |
Retrying multiple times for each of the two tiers amplifies the actual attempts. Long tasks should save the gateway ID first and query the original task when restoring; you cannot assume that the task is idempotent by switching channels.
When a backup model is needed
It’s up to the application to explicitly decide whether to replace the model, and validate the history, tool schema, and output structure. Document the reason why the rollback occurred and the final model to avoid users unknowingly receiving results with completely different capabilities.