这一页面向需要用程序批量获取模型清单的开发者。如果只是想浏览有哪些模型、多少钱、支持什么能力,直接看模型广场更直观,那里用的是同一份数据,只是渲染成了界面。
This page is for developers who need to fetch model lists programmatically. If you just want to browse which models exist, what they cost, and what they support, the model catalog is more direct — it renders the same data as a UI.
认证
All endpoints authenticate with a Bearer token.
Get an API key: open the console and create one.
Add it to the request header:
Authorization: Bearer YOUR_OAIRoute_KEY响应
返回体为列表结构,模型条目在 data 数组里,顶层另有 object、success 等标识字段。
每个模型条目包含以下字段:
模型 ID。调用其他接口时原样填入 model 字段。
对象类型,固定为 model。
创建时间戳,Unix 秒。这是占位值,不反映模型的实际上线时间,不要用它排序或判断新旧。
上游归属方,用于标注模型来源,不参与路由。常见取值如 openai、claude、google gemini 等,以接口实际返回为准。
该模型支持的调用方式。不同模型取值不同,同一模型也可能同时支持多种,是选择接口路径的依据。
The body is a list structure: model entries are in the data array, alongside top-level marker fields such as object and success.
Each model entry contains the following fields:
The model ID. Put it into the model field of other endpoints verbatim.
The object type, always model.
A creation timestamp in Unix seconds. This is a placeholder and doesn't reflect when the model actually launched; don't sort or judge age by it.
The upstream owner, marking model provenance and not used for routing. Common values include openai, claude, and google gemini; go by what the endpoint actually returns.
The call styles this model supports. Values differ by model, and one model may support several at once; this is what you base the endpoint path choice on.
调用方式与路径
supported_endpoint_types 的常见取值与实际调用路径对应如下:
| 取值 | 说明 | 典型路径 |
|---|---|---|
openai | OpenAI 兼容格式,覆盖面最广对话、嵌入、图像等各自的 /v1/... 路径 | |
anthropic | Claude 原生格式POST /v1/messages | |
gemini | Gemini 原生格式POST /v1beta/models/{model}:generateContent | |
image-generation | 图像生成POST /v1/images/generations |
这只是常见取值,不是全部。Seedance 系列另有视频类取值(如与 video、Official 相关的项),具体以接口返回为准。
同一个模型可能同时支持多种格式。例如 Claude 系模型通常同时返回 anthropic 与 openai,既可以用原生格式调用,也可以走 OpenAI 兼容格式,按你的代码习惯选一种即可。
Common values of supported_endpoint_types and the actual call paths they correspond to:
| Value | Notes | Typical path |
|---|---|---|
openai | OpenAI-compatible format, the broadest coverageThe relevant /v1/... paths for chat, embeddings, images, etc. | |
anthropic | Claude native formatPOST /v1/messages | |
gemini | Gemini native formatPOST /v1beta/models/{model}:generateContent | |
image-generation | Image generationPOST /v1/images/generations |
These are common values only, not the complete set. The Seedance series has its own video-related values (such as items involving video and Official); go by what the endpoint actually returns.
One model may support several formats at once. Claude-family models, for example, usually return both anthropic and openai, so you can call them natively or via the OpenAI-compatible format — pick whichever fits your code.
如何选模型
三个维度配合看:
- 能不能调 —— 看
/v1/models里有没有这个id。列表只返回当前账号可用的模型,换 Key 或换分组结果会变 - 怎么调 —— 看
supported_endpoint_types。要 OpenAI 兼容就挑带openai的,要用原生格式就挑对应的取值 - 多少钱 —— 见模型价格与分组接口,按
model_ratio结合所在分组换算
Look at three dimensions together:
- Can you call it — check whether
/v1/modelslists thatid. The list returns only models available to the current account, and a different key or group changes the result - How to call it — check
supported_endpoint_types. For OpenAI-compatible, pick one withopenai; for native format, pick the matching value - What it costs — see Model pricing and groups, converting with
model_ratioand your group
注意事项
- 列表范围由账号决定,不是全站模型。Key 的限制与分组不同,看到的清单也会不同
created不反映真实上线时间,各模型返回的值基本相同,不能用来排序- 筛选在客户端做。清单一次返回全部可用模型,按
supported_endpoint_types或模型名在本地过滤即可 - 模型清单会变动,新增或下线不需要改代码,按
id直接调用即可 - 本接口只提供模型的身份信息。能力标签、价格、分组在模型价格与分组接口里,每个模型的请求体参数见各自接口页,比如对话模型看「通用对话接口」的请求参数一节
- The list's scope depends on the account, not the whole site. Different key restrictions and groups see different lists
createddoesn't reflect real launch timing — the values returned are essentially the same across models and can't be used for sorting- Filter client-side. The list returns every available model at once; filter locally by
supported_endpoint_typesor model name - The catalog changes. Models come and go without code changes; call them directly by
id - This endpoint only provides model identity. Capability tags, prices, and groups are in Model pricing and groups; request body parameters per model are on each endpoint page — for chat models, see the request parameters section of "Chat completions"
错误码
For error response formats, status codes, and retry guidance see Error codes and rate limits; for troubleshooting steps on common errors see the FAQ.
使用示例
拉取全部可用模型
最简形式:一次拿全当前账号可用的模型。
只取模型 ID
组装模型选择器时通常只需要 ID 列表,用 jq 过滤即可。
curl -s --request GET \
--url 'https://api.oairoute.com/v1/models' \
--header 'Authorization: Bearer YOUR_OAIRoute_KEY' \
| jq -r '.data[].id'按调用方式筛模型
想在本地只保留支持原生 Claude 格式的模型,按 supported_endpoint_types 过滤。
curl -s --request GET \
--url 'https://api.oairoute.com/v1/models' \
--header 'Authorization: Bearer YOUR_OAIRoute_KEY' \
| jq -r '.data[] | select(.supported_endpoint_types | index("anthropic")) | .id'只保留图像生成模型
同理,筛出带 image-generation 的模型,用于图像接口的模型下拉。
curl -s --request GET \
--url 'https://api.oairoute.com/v1/models' \
--header 'Authorization: Bearer YOUR_OAIRoute_KEY' \
| jq -r '.data[] | select(.supported_endpoint_types | index("image-generation")) | .id'List all available models
The simplest form: fetch every model available to the current account in one call.
Take only model IDs
When building a model picker you usually need just the ID list; filter with jq.
curl -s --request GET \
--url 'https://api.oairoute.com/v1/models' \
--header 'Authorization: Bearer YOUR_OAIRoute_KEY' \
| jq -r '.data[].id'Filter by call style
To keep only models supporting native Claude format locally, filter on supported_endpoint_types.
curl -s --request GET \
--url 'https://api.oairoute.com/v1/models' \
--header 'Authorization: Bearer YOUR_OAIRoute_KEY' \
| jq -r '.data[] | select(.supported_endpoint_types | index("anthropic")) | .id'Keep only image-generation models
Similarly, filter for models with image-generation for an image endpoint's model dropdown.
curl -s --request GET \
--url 'https://api.oairoute.com/v1/models' \
--header 'Authorization: Bearer YOUR_OAIRoute_KEY' \
| jq -r '.data[] | select(.supported_endpoint_types | index("image-generation")) | .id'示例
真实返回,截取两条:
{
"data": [
{
"id": "gpt-5-nano",
"object": "model",
"created": 1626777600,
"owned_by": "openai",
"supported_endpoint_types": ["openai"]
},
{
"id": "claude-haiku-4-5-20251001",
"object": "model",
"created": 1626777600,
"owned_by": "claude",
"supported_endpoint_types": ["anthropic", "openai"]
}
],
"object": "list",
"success": true
}A real response, trimmed to two entries:
{
"data": [
{
"id": "gpt-5-nano",
"object": "model",
"created": 1626777600,
"owned_by": "openai",
"supported_endpoint_types": ["openai"]
},
{
"id": "claude-haiku-4-5-20251001",
"object": "model",
"created": 1626777600,
"owned_by": "claude",
"supported_endpoint_types": ["anthropic", "openai"]
}
],
"object": "list",
"success": true
}