API 参考
GET /v1/models
列出可调用的模型、能力标签与各模型可用的端点;按能力或端点过滤,或按 ID 查询单个模型。
请求
curl https://api.unioapi.com/v1/models \
-H "Authorization: Bearer $UNIO_API_KEY"响应(节选)
{
"object": "list",
"data": [
{
"id": "gpt-5.6-sol",
"object": "model",
"type": "model",
"owned_by": "openai",
"display_name": "GPT-5.6 Sol",
"created_at": "2026-11-01T00:00:00Z",
"capabilities": ["file.input", "image.input", "prompt_cache", "reasoning.effort", "service_tier", "stream", "text.input", "text.output", "tools.function"],
"protocols": ["openai"],
"endpoint_capabilities": ["openai.chat_completions", "openai.responses"],
"endpoints": ["openai.chat_completions", "openai.responses"],
"operations": ["openai.chat_completions", "openai.responses", "openai.responses.compact"],
"context_window": 1050000
},
{
"id": "claude-sonnet-5",
"object": "model",
"type": "model",
"owned_by": "anthropic",
"display_name": "Claude Sonnet 5",
"created_at": "2026-06-30T00:00:00Z",
"capabilities": ["file.input", "image.input", "prompt_cache", "stream", "text.input", "text.output", "tools.function"],
"protocols": ["anthropic"],
"endpoint_capabilities": ["anthropic.messages"],
"endpoints": ["anthropic.messages"],
"operations": ["anthropic.messages", "anthropic.messages.count_tokens"],
"context_window": 1000000
}
]
}字段语义
- 列表范围:返回当前可以调用的模型,不按你本次请求所用的协议过滤。
id:请求时填写的模型标识,与厂商官方模型 ID 相同(不带日期的主模型 ID)。owned_by:模型厂商,openai或anthropic。created_at:模型的官方发布日期;官方未公布时为模型上架时间。endpoint_capabilities:该模型可用的端点。endpoints是同一集合的简写,operations另外列出各端点的辅助操作 (如openai.responses.compact、anthropic.messages.count_tokens)。protocols:兼容字段,由endpoint_capabilities推出(openai/anthropic),判断能否调用请以endpoint_capabilities为准。capabilities:模型能力标签,如text.input、image.input、file.input、tools.function、reasoning.effort、response_format.json_schema、prompt_cache、service_tier、stream。按字母顺序排列。context_window:上下文窗口(token),未知时省略。- 模型出现在列表里不保证此刻一定有容量;调用时如遇 OpenAI 形状 503
server_is_overloaded或 Anthropic 形状 529overloaded_error,稍后重试即可,见错误码。
价格、服务档位与长上下文规则不在本接口中,见官网模型与定价与计费与用量。
过滤
?capability= 对能力标签执行 AND 过滤,可重复传参,也可用逗号分隔:
curl "https://api.unioapi.com/v1/models?capability=tools.function&capability=image.input" \
-H "Authorization: Bearer $UNIO_API_KEY"?endpoint= 只返回提供该端点的模型:
curl "https://api.unioapi.com/v1/models?endpoint=openai.responses" \
-H "Authorization: Bearer $UNIO_API_KEY"GET /v1/models/{model}
按 ID 返回单个模型对象,字段与列表中的元素相同。模型不存在时返回 404 invalid_request_error,code 为 model_not_found。
curl https://api.unioapi.com/v1/models/gpt-5.6-sol \
-H "Authorization: Bearer $UNIO_API_KEY"计费说明
本端点不产生费用,也不创建请求记录,但与其他 /v1 接口共享请求准入,高频轮询可能收到 429。