供应商列表导读

这个接口除了列出 provider 以外,也可以帮助你查看健康状态并理解选路与回退。

GET/v1/providers

查询参数

NameTypeRequiredDescription
include_health
string设为 true 时,返回每个 provider 的健康与延迟快照;不传时状态为 unknown。
type
string按 provider 类型过滤,例如 anthropic、openai、bedrock、azure、vertex-ai。

请求示例

bash
curl https://api.therouter.ai/v1/providers \
  -H "Authorization: Bearer $THEROUTER_API_KEY"

带健康状态的返回

bash
curl "https://api.therouter.ai/v1/providers?include_health=true" \
  -H "Authorization: Bearer $THEROUTER_API_KEY"
json
{
  "data": [
    {
      "id": "openai-api",
      "name": "OpenAI",
      "type": "openai",
      "status": "healthy",
      "models_count": 12,
      "health": {
        "latency_p50": 45,
        "latency_p99": 45,
        "error_rate": 0.0,
        "last_checked_at": "2026-02-26T10:00:00.000Z"
      }
    }
  ]
}
为什么这页重要
没有 include_health=true 时,这个接口更像静态配置视图;加上 health 后,它才更适合帮助你解释 degraded / unhealthy provider 为什么会触发回退。

下一步