切换外观
查询模型与已开放接口
GET/public/models- 鉴权
- Bearer API Key
- 执行方式
- 按所调用的完整地址执行
接口说明
无需 API Key 查询当前公开模型、价格与已开放接口。apiInterfaces 是有效已发布操作的去重并集;Responses 生成与 Compact 独立声明,接口开放不代表支持全部可选能力。
请求
方法:
GET鉴权:无需登录或 API Key。
请求头
无需鉴权请求头。
路径参数:无
查询参数:无
请求字段:无
请求报文:无请求体
响应
成功状态:200
响应头
| 名称 | 值或类型 | 说明 |
|---|---|---|
Content-Type | application/json | 响应媒体类型 |
响应字段
| 字段 | 类型 | 必填 | 说明 | 示例或约束 |
|---|---|---|---|---|
models | object[] | 是 | 当前公开模型列表;无公开模型时为空数组。 | 示例:[{"apiInterfaces":[{"id":"ANTHROPIC_MESSAGES","operations":[{"id":"ANTHROPIC_... |
models[].apiInterfaces | object[] | 是 | 已开放接口及具体操作,按有效已发布配置去重聚合。 | 示例:[{"id":"ANTHROPIC_MESSAGES","operations":[{"id":"ANTHROPIC_MESSAGES_CREATE","... |
models[].apiInterfaces[].id | string | 是 | 客户 API 接口类别。 | 示例:"ANTHROPIC_MESSAGES";可选值:"OPENAI_CHAT_COMPLETIONS"、"OPENAI_RESPONSES"、"OPENAI_IMAGES"、"ANTHROPIC_MESSAGES" |
models[].apiInterfaces[].operations | object[] | 是 | 该类别下已正式开放的独立操作。 | 示例:[{"id":"ANTHROPIC_MESSAGES_CREATE","method":"POST","path":"/anthropic/v1/mess... |
models[].apiInterfaces[].operations[].id | string | 是 | 独立操作标识;生成、压缩和图片编辑分别声明。平台本地 Token 预估不在此列。 | 示例:"ANTHROPIC_MESSAGES_CREATE";可选值:"OPENAI_CHAT_CREATE"、"OPENAI_RESPONSES_CREATE"、"OPENAI_RESPONSES_COMPACT"、"OPENAI_IMAGES_GENERATE"、"OPENAI_IMAGES_EDIT"、"ANTHROPIC_MESSAGES_CREATE" |
models[].apiInterfaces[].operations[].method | string | 是 | 请求的 HTTP 方法。 | 示例:"POST";可选值:"POST" |
models[].apiInterfaces[].operations[].path | string | 是 | 普通余额入口的实际客户请求路径,相对于 API 域名。 | 示例:"/anthropic/v1/messages" |
models[].cachedInputPriceYuan | string | 是 | 当前缓存命中输入最终单价,十进制字符串;未提供时为 null。 | 示例:null;可为 null |
models[].capability | string | 是 | 模型能力分类;不代表任意接口的全部可选能力。 | 示例:"CHAT" |
models[].contextLength | string | 是 | 公开上下文规格;未提供时为 null。 | 示例:null;可为 null |
models[].description | string | 是 | 公开模型说明;未提供时为 null。 | 示例:null;可为 null |
models[].displayName | string | 是 | 模型展示名称。 | 示例:"示例模型" |
models[].docsPath | string | 是 | 模型文档站内路径;未提供时为 null。 | 示例:null;可为 null |
models[].inputModalities | string | 是 | 公开输入模态说明;未提供时为 null。 | 示例:null;可为 null |
models[].inputPriceYuan | string | 是 | 当前输入最终单价,十进制字符串;未提供时为 null。 | 示例:null;可为 null |
models[].manufacturer | string | 是 | 模型厂商名称。 | 示例:"示例厂商" |
models[].maxOutputTokens | string | 是 | 公开最大输出规格;未提供时为 null。 | 示例:null;可为 null |
models[].modelId | string | 是 | 请求使用的精确模型 ID。 | 示例:"YOUR_MODEL_ID" |
models[].modelSize | string | 是 | 模型规模说明;未提供时为 null。 | 示例:null;可为 null |
models[].officialPricing | object | 是 | 官网参考价与平台折扣;未配置时为 null。 | 示例:null;可为 null |
models[].officialPricing.cachedInputPriceYuan | string | 是 | 官网缓存输入参考单价,十进制字符串。 | — |
models[].officialPricing.discountBasisPoints | integer (int32) | 是 | 折扣基点,10000 表示原价;最终单价已含折扣。 | 最小值:1;最大值:10000 |
models[].officialPricing.inputPriceYuan | string | 是 | 官网输入参考单价,十进制字符串。 | — |
models[].officialPricing.outputPriceYuan | string | 是 | 官网输出参考单价,十进制字符串。 | — |
models[].outputModalities | string | 是 | 公开输出模态说明;未提供时为 null。 | 示例:null;可为 null |
models[].outputPriceYuan | string | 是 | 当前输出最终单价,十进制字符串;未提供时为 null。 | 示例:null;可为 null |
models[].timePricing | object | 是 | 峰谷两档实际价格与当前档位;未启用时为 null。 | 示例:null;可为 null |
models[].timePricing.activePeriod | string | 是 | 当前时段,PEAK 或 OFF_PEAK。 | — |
models[].timePricing.nextSwitchAt | string (date-time) | 是 | 下一次价格档位切换时间。 | — |
models[].timePricing.offPeak | object | 是 | 低谷最终价格。 | — |
models[].timePricing.offPeak.cachedInputPriceYuan | string | 是 | 本时段缓存输入最终单价,十进制字符串;未提供时为 null。 | 可为 null |
models[].timePricing.offPeak.inputPriceYuan | string | 是 | 本时段输入最终单价,十进制字符串。 | — |
models[].timePricing.offPeak.officialPricing | object | 是 | 本时段官网参考价与折扣;未提供时为 null。 | 可为 null |
models[].timePricing.offPeak.officialPricing.cachedInputPriceYuan | string | 是 | 官网缓存输入参考单价,十进制字符串。 | — |
models[].timePricing.offPeak.officialPricing.discountBasisPoints | integer (int32) | 是 | 折扣基点,10000 表示原价;最终单价已含折扣。 | 最小值:1;最大值:10000 |
models[].timePricing.offPeak.officialPricing.inputPriceYuan | string | 是 | 官网输入参考单价,十进制字符串。 | — |
models[].timePricing.offPeak.officialPricing.outputPriceYuan | string | 是 | 官网输出参考单价,十进制字符串。 | — |
models[].timePricing.offPeak.outputPriceYuan | string | 是 | 本时段输出最终单价,十进制字符串。 | — |
models[].timePricing.peak | object | 是 | 高峰最终价格。 | — |
models[].timePricing.peak.cachedInputPriceYuan | string | 是 | 本时段缓存输入最终单价,十进制字符串;未提供时为 null。 | 可为 null |
models[].timePricing.peak.inputPriceYuan | string | 是 | 本时段输入最终单价,十进制字符串。 | — |
models[].timePricing.peak.officialPricing | object | 是 | 本时段官网参考价与折扣;未提供时为 null。 | 可为 null |
models[].timePricing.peak.officialPricing.cachedInputPriceYuan | string | 是 | 官网缓存输入参考单价,十进制字符串。 | — |
models[].timePricing.peak.officialPricing.discountBasisPoints | integer (int32) | 是 | 折扣基点,10000 表示原价;最终单价已含折扣。 | 最小值:1;最大值:10000 |
models[].timePricing.peak.officialPricing.inputPriceYuan | string | 是 | 官网输入参考单价,十进制字符串。 | — |
models[].timePricing.peak.officialPricing.outputPriceYuan | string | 是 | 官网输出参考单价,十进制字符串。 | — |
models[].timePricing.peak.outputPriceYuan | string | 是 | 本时段输出最终单价,十进制字符串。 | — |
models[].timePricing.schedule | string | 是 | 峰谷时间表标识。 | — |
models[].timePricing.timezone | string | 是 | 选档时区。 | — |
priceUnit | string | 是 | 价格计价单位。 | 示例:"元/百万 tokens" |
返回报文
媒体类型:application/json
json
{
"models": [
{
"apiInterfaces": [
{
"id": "ANTHROPIC_MESSAGES",
"operations": [
{
"id": "ANTHROPIC_MESSAGES_CREATE",
"method": "POST",
"path": "/anthropic/v1/messages"
}
]
}
],
"cachedInputPriceYuan": null,
"capability": "CHAT",
"contextLength": null,
"description": null,
"displayName": "示例模型",
"docsPath": null,
"inputModalities": null,
"inputPriceYuan": null,
"manufacturer": "示例厂商",
"maxOutputTokens": null,
"modelId": "YOUR_MODEL_ID",
"modelSize": null,
"officialPricing": null,
"outputModalities": null,
"outputPriceYuan": null,
"timePricing": null
}
],
"priceUnit": "元/百万 tokens"
}错误
| 适用完整地址 | 状态 | 错误码 | 常见触发 | 重试 | 建议动作 | 结果风险 |
|---|---|---|---|---|---|---|
https://api.tokenfactory.cn/v1/public/models | 500 | COMMON_001 | 模型目录读取失败 | 是,退避后 | 稍后重新查询;不要把失败当作空目录 | 无 |
https://api.tokenfactory.cn/v1/public/models | 405 | COMMON_004 | 使用 GET 以外的请求方法 | 否 | 改用 GET /v1/public/models | 无 |
错误返回报文
适用完整地址
https://api.tokenfactory.cn/v1/public/models
HTTP 405;Content-Type: application/json
json
{
"code": "COMMON_004",
"message": "操作不被允许",
"success": false,
"timestamp": "2026-09-11T00:00:00Z"
}限制与计费
| 适用完整地址 | 限制或计费说明 |
|---|---|
https://api.tokenfactory.cn/v1/public/models | 无需登录或 API Key,不调用供应商,不产生模型调用费用。 目录缓存最多 60 秒;新查询或页面刷新获取当前缓存结果。 只返回已上架且存在有效已发布操作的模型,不暴露供应商、路线或凭证。 Responses 生成与 Compact 独立;本地 Token 预估不作为模型生成支持。 接口开放不等于全部可选参数可用,也不承诺临时健康状态。 |
调用示例
cURL · https://api.tokenfactory.cn/v1/public/models
sh
curl --request GET "https://api.tokenfactory.cn/v1/public/models" --silent --show-error --fail-with-body --max-time 60相关说明
这是匿名公开目录查询,不调用供应商、不扣费;缓存最多 60 秒。以 apiInterfaces 中具体操作为准,Responses 生成与 Compact 独立。读取失败不能当成空目录,接口开放不代表全部可选能力均可用。