This page is for developers who need to process prices in bulk, compare, or estimate costs. To pick models in a UI, the model catalog is faster; for how charges are calculated, see Billing.
不需要认证
这个接口不校验身份,返回全站模型目录,包含当前账号用不到的部分。
这一点和 /v1/models 不同:那边只返回你所在分组能用的模型,这边返回全部。两者按 model_name 与 id 对应。
This endpoint doesn't verify identity and returns the whole site's model catalog, including parts the current account can't use.
That differs from /v1/models: that one returns only models available to your group, while this one returns everything. The two correspond via model_name and id.
响应
返回体是 data 数组,每个模型一项。顶层还有 vendors、group_ratio、usable_group、supported_endpoint、pricing_version 等辅助表,见本节末尾。
身份与能力
模型 ID,与模型列表接口返回的 id 对应。
能力标签,逗号分隔。常见取值有 Reasoning(推理)、Tools(工具调用)、Files(文件输入)、Vision(图像输入)、Audio(音频)、Open Weights(开放权重)、Deprecated(已弃用),以及 128K / 400K / 1M 这类上下文窗口标记。部分模型没有标签,按空值处理。
英文说明,介绍模型定位与适用场景。
厂商图标标识,配合顶层 vendors 使用。
厂商 ID,对应顶层 vendors 数组里的 id。
该模型支持的调用方言,与 /v1/models 返回的同名字段一致。
计费模式
计费模式。0 按倍率计费,看 model_ratio;1 按次计费,看 model_price。站内按倍率的约占八成,图像与视频多为按次。
输入倍率,仅 quota_type=0 时有效。它相对的是该模型未含分组倍率的基准价,本身不含分组系数;分组系数是另一层,见下方的费用算法。
单次调用价格,仅 quota_type=1 时有效,图像类模型多用这种。
输出倍率,相对输入侧。值为 8 表示输出按输入价的 8 倍计。
缓存与多模态加价
缓存命中的输入倍率,相对 model_ratio。常见取值 0.1,即命中缓存的输入按正常价的十分之一计。站内约 45 个模型有此字段。
写入缓存的价格倍率。设为缓存时按这个倍率计费,之后命中才享受 cache_ratio。站内约 21 个模型有此字段。
图像输出的价格倍率,仅对支持图像输出的模型出现。
音频输出的价格倍率,仅对支持音频输出的模型出现。
音频输出的完成倍率,与 audio_ratio 配合使用。
分组与阶梯计价
该模型开放的分组。账号所在分组不在列表里,就无法调用这个模型。
为 tiered_expr 时表示阶梯计价,此时会附带 billing_expr 给出计算公式。站内约四分之一的模型带此字段。
计费表达式,按 token 类型分段求值。仅在 billing_mode 为 tiered_expr 时出现。
计费用量的结构定义,仅在少数按用量分档计费的模型上出现。
顶层还有几张辅助表:
| 字段 | 内容 |
|---|---|
vendors | 厂商表,含 id、name、icon与模型里的 vendor_id 对应 |
group_ratio | 各分组的倍率系数。你所在分组的系数以控制台显示的为准 |
usable_group | 分组说明,与 group_ratio 的键对应 |
supported_endpoint | 各方言对应的调用路径 |
pricing_version | 本次报价的版本号,可用它判断数据是否变化 |
The body is a data array with one entry per model. There are also top-level helper tables — vendors, group_ratio, usable_group, supported_endpoint, pricing_version — described at the end of this section.
Identity and capabilities
The model ID, corresponding to id returned by the models list endpoint.
Capability tags, comma-separated. Common values include Reasoning, Tools, Files, Vision, Audio, Open Weights, Deprecated, plus context-window markers such as 128K, 400K, and 1M. Some models have no tags; treat that as empty.
An English description of the model's positioning and use cases.
The vendor icon identifier, used with the top-level vendors.
The vendor ID, matching id in the top-level vendors array.
The call dialects this model supports, the same field as in /v1/models.
Billing mode
The billing mode. 0 bills by ratio, using model_ratio; 1 bills per call, using model_price. About 80% of the site's models bill by ratio, while most image and video models bill per call.
The input ratio, valid only when quota_type=0. It's relative to the model's base price before the group ratio and doesn't itself include the group factor; the group factor is a separate layer, see the cost math below.
The per-call price, valid only when quota_type=1; most image models use this.
The output ratio, relative to the input side. A value of 8 means output bills at 8× the input price.
Cache and multimodal surcharges
The input ratio for cache hits, relative to model_ratio. A common value is 0.1, meaning cached input bills at one tenth the normal price. About 45 models on the site have this field.
The price ratio for writing to the cache. Setting the cache bills at this ratio, and only later hits enjoy cache_ratio. About 21 models on the site have this field.
The price ratio for image output; appears only on models that support image output.
The price ratio for audio output; appears only on models that support audio output.
The completion ratio for audio output, used together with audio_ratio.
Groups and tiered pricing
The groups this model is open to. If your account's group isn't in the list, you can't call this model.
When tiered_expr, it means tiered pricing, accompanied by billing_expr giving the formula. About a quarter of the site's models carry this field.
The billing expression, evaluated in segments by token type. Appears only when billing_mode is tiered_expr.
The structure definition for metered usage; appears on only a few models billed by usage tiers.
There are also several top-level helper tables:
| Field | Contents |
|---|---|
vendors | The vendor table, with id, name, iconCorresponds to each model's vendor_id |
group_ratio | The ratio coefficient for each group. Your group's coefficient is whatever the console shows |
usable_group | Group descriptions, keyed the same as group_ratio |
supported_endpoint | The call path for each dialect |
pricing_version | The version identifier for this price sheet; use it to detect data changes |
怎么用这些字段算钱
一个按倍率计费的模型,一次调用的实际扣费:
输入单价 = 基准价 × model_ratio
输出单价 = 基准价 × model_ratio × completion_ratio
输入费用 = 输入 token 数 × 输入单价
输出费用 = 输出 token 数 × 输出单价
缓存读费 = 缓存命中 token 数 × 基准价 × model_ratio × cache_ratio
缓存建费 = 写入缓存 token 数 × 基准价 × model_ratio × create_cache_ratio
实际扣费 = (四项之和) × 分组系数model_ratio 与 completion_ratio 都是相对基准价的倍数,不含分组系数;分组系数是最后一层,单独乘。基准价与分组系数都可以在模型广场和 GET /api/pricing 里查到,不同分组看到的实际价格不同,差别在分组系数,不在基准价。
按次计费的模型直接用 model_price 乘分组系数,不看 token 数。
分组系数取你自己账号的那一个,控制台能看到。同一个模型,不同分组下的实际价格不同,但要算你自己的账,只需要乘你所在分组的系数即可。
For a model billed by ratio, the actual charge for one call:
input price = base price × model_ratio
output price = base price × model_ratio × completion_ratio
input cost = input tokens × input price
output cost = output tokens × output price
cache read = cached tokens × base price × model_ratio × cache_ratio
cache write = cache write tokens × base price × model_ratio × create_cache_ratio
actual charge = (sum of the four) × group coefficientmodel_ratio and completion_ratio are both multiples of the base price and exclude the group coefficient; the group coefficient is the final layer, multiplied separately. Both the base price and the group coefficient are visible in the model catalog and GET /api/pricing; different groups see different actual prices, and the difference is the group coefficient, not the base price.
For models billed per call, multiply model_price by the group coefficient and ignore token counts.
Use your own account's group coefficient, visible in the console. The same model costs different amounts under different groups, but to compute your own bill you only need your group's coefficient.
错误码
For error response formats, status codes, and retry guidance see Error codes and rate limits; for troubleshooting steps on common errors see the FAQ.
使用示例
只取价格最低的几个模型
按 model_ratio 升序取前五个,先看便宜的:
curl -s https://api.oairoute.com/api/pricing \
| jq -r '.data | sort_by(.model_ratio) | .[0:5][] | "\(.model_name)\t\(.model_ratio)"'筛出支持工具调用的模型
tags 是逗号分隔的字符串,用 contains 判断:
curl -s https://api.oairoute.com/api/pricing \
| jq -r '.data[] | select(.tags | contains("Tools")) | .model_name'结合可用清单挑模型
先取账号能用的模型,再按价格排序,得到「能用且便宜」的清单:
curl -s 'https://api.oairoute.com/v1/models' \
-H "Authorization: Bearer YOUR_OAIRoute_KEY" > /tmp/models.json
curl -s 'https://api.oairoute.com/api/pricing' > /tmp/pricing.json
jq -r --slurpfile usable /tmp/models.json '
($usable[0].data | map(.id)) as $ids
| .data
| map(select(.model_name as $m | $ids | index($m)))
| sort_by(.model_ratio)
| .[0:5][]
| "\(.model_name)\t\(.model_ratio)"
' /tmp/pricing.jsonTake the five cheapest models
Sort by model_ratio ascending and take the first five to see the cheap end:
curl -s https://api.oairoute.com/api/pricing \
| jq -r '.data | sort_by(.model_ratio) | .[0:5][] | "\(.model_name)\t\(.model_ratio)"'Find models that support tool calling
tags is a comma-separated string; test it with contains:
curl -s https://api.oairoute.com/api/pricing \
| jq -r '.data[] | select(.tags | contains("Tools")) | .model_name'Combine with the available list
Fetch the models the account can use, then sort by price to get a list that's both usable and cheap:
curl -s 'https://api.oairoute.com/v1/models' \
-H "Authorization: Bearer YOUR_OAIRoute_KEY" > /tmp/models.json
curl -s 'https://api.oairoute.com/api/pricing' > /tmp/pricing.json
jq -r --slurpfile usable /tmp/models.json '
($usable[0].data | map(.id)) as $ids
| .data
| map(select(.model_name as $m | $ids | index($m)))
| sort_by(.model_ratio)
| .[0:5][]
| "\(.model_name)\t\(.model_ratio)"
' /tmp/pricing.json示例
真实返回,截取一个模型与顶层辅助表:
{
"data": [
{
"model_name": "gpt-5.2-2025-12-11",
"description": "Latest flagship model, strong reasoning and long context",
"icon": "OpenAI",
"tags": "Reasoning,Tools,Vision,Files,400K",
"vendor_id": 6,
"quota_type": 0,
"model_ratio": 0.875,
"model_price": 0,
"completion_ratio": 8,
"cache_ratio": 0.1,
"enable_groups": ["<分组名>"],
"supported_endpoint_types": ["openai"],
"pricing_version": "5a90f2b86c08bd983a9a2e6d66c255f4eaef9c4bc934386d2b6ae84ef0ff1f1f"
}
],
"group_ratio": { "<分组名>": 1.0 },
"usable_group": { "<分组名>": "<分组说明>" },
"supported_endpoint": { "openai": "/v1/chat/completions" },
"success": true
}A real response, trimmed to one model plus the top-level helper tables:
{
"data": [
{
"model_name": "gpt-5.2-2025-12-11",
"description": "Latest flagship model, strong reasoning and long context",
"icon": "OpenAI",
"tags": "Reasoning,Tools,Vision,Files,400K",
"vendor_id": 6,
"quota_type": 0,
"model_ratio": 0.875,
"model_price": 0,
"completion_ratio": 8,
"cache_ratio": 0.1,
"enable_groups": ["<group name>"],
"supported_endpoint_types": ["openai"],
"pricing_version": "5a90f2b86c08bd983a9a2e6d66c255f4eaef9c4bc934386d2b6ae84ef0ff1f1f"
}
],
"group_ratio": { "<group name>": 1.0 },
"usable_group": { "<group name>": "<group description>" },
"supported_endpoint": { "openai": "/v1/chat/completions" },
"success": true
}