快速开始
回退行为
识别哪个模型响应了
响应中的model 字段始终反映实际生成响应的模型。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
指定一个按优先级排列的回退模型列表。如果主模型失败或不可用,ARouter 会自动使用列表中的下一个模型进行重试。
{
"model": "openai/gpt-5.4-pro",
"models": ["openai/gpt-5.4-pro", "openai/gpt-5.4", "anthropic/claude-sonnet-4.6"],
"messages": [{"role": "user", "content": "Hello"}]
}
| 场景 | 操作 |
|---|---|
主模型返回 5xx | 使用下一个模型重试 |
主模型被限流(429) | 使用下一个模型重试 |
| 主模型不可用 | 使用下一个模型重试 |
主模型返回 4xx(错误请求) | 立即返回错误 |
| 所有模型都失败 | 返回最后一个尝试模型的错误 |
model 字段始终反映实际生成响应的模型。
{
"model": "openai/gpt-5.4-pro",
"models": ["openai/gpt-5.4-pro", "openai/gpt-5.4"],
"provider": {"order": ["Azure", "OpenAI"], "allow_fallbacks": true}
}
{"models": ["anthropic/claude-opus-4.5", "anthropic/claude-sonnet-4.6", "openai/gpt-5.4-pro"]}
{"models": ["openai/gpt-5.4:free", "meta-llama/llama-4-maverick:free", "openai/gpt-5.4"]}