Skip to content

查询模型与已开放接口

GET/public/models
鉴权
Bearer API Key
执行方式
按所调用的完整地址执行
查看调用示例

接口说明

无需 API Key 查询当前公开模型、价格与已开放接口。apiInterfaces 是有效已发布操作的去重并集;Responses 生成与 Compact 独立声明,接口开放不代表支持全部可选能力。

请求

  • 方法:GET

  • 鉴权:无需登录或 API Key。

请求头

无需鉴权请求头。

路径参数:无

查询参数:无

请求字段:无

请求报文:无请求体

响应

成功状态:200

响应头

名称值或类型说明
Content-Typeapplication/json响应媒体类型

响应字段

字段类型必填说明示例或约束
modelsobject[]当前公开模型列表;无公开模型时为空数组。示例:[{"apiInterfaces":[{"id":"ANTHROPIC_MESSAGES","operations":[{"id":"ANTHROPIC_...
models[].apiInterfacesobject[]已开放接口及具体操作,按有效已发布配置去重聚合。示例:[{"id":"ANTHROPIC_MESSAGES","operations":[{"id":"ANTHROPIC_MESSAGES_CREATE","...
models[].apiInterfaces[].idstring客户 API 接口类别。示例:"ANTHROPIC_MESSAGES";可选值:"OPENAI_CHAT_COMPLETIONS"、"OPENAI_RESPONSES"、"OPENAI_IMAGES"、"ANTHROPIC_MESSAGES"
models[].apiInterfaces[].operationsobject[]该类别下已正式开放的独立操作。示例:[{"id":"ANTHROPIC_MESSAGES_CREATE","method":"POST","path":"/anthropic/v1/mess...
models[].apiInterfaces[].operations[].idstring独立操作标识;生成、压缩和图片编辑分别声明。平台本地 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[].methodstring请求的 HTTP 方法。示例:"POST";可选值:"POST"
models[].apiInterfaces[].operations[].pathstring普通余额入口的实际客户请求路径,相对于 API 域名。示例:"/anthropic/v1/messages"
models[].cachedInputPriceYuanstring当前缓存命中输入最终单价,十进制字符串;未提供时为 null。示例:null;可为 null
models[].capabilitystring模型能力分类;不代表任意接口的全部可选能力。示例:"CHAT"
models[].contextLengthstring公开上下文规格;未提供时为 null。示例:null;可为 null
models[].descriptionstring公开模型说明;未提供时为 null。示例:null;可为 null
models[].displayNamestring模型展示名称。示例:"示例模型"
models[].docsPathstring模型文档站内路径;未提供时为 null。示例:null;可为 null
models[].inputModalitiesstring公开输入模态说明;未提供时为 null。示例:null;可为 null
models[].inputPriceYuanstring当前输入最终单价,十进制字符串;未提供时为 null。示例:null;可为 null
models[].manufacturerstring模型厂商名称。示例:"示例厂商"
models[].maxOutputTokensstring公开最大输出规格;未提供时为 null。示例:null;可为 null
models[].modelIdstring请求使用的精确模型 ID。示例:"YOUR_MODEL_ID"
models[].modelSizestring模型规模说明;未提供时为 null。示例:null;可为 null
models[].officialPricingobject官网参考价与平台折扣;未配置时为 null。示例:null;可为 null
models[].officialPricing.cachedInputPriceYuanstring官网缓存输入参考单价,十进制字符串。
models[].officialPricing.discountBasisPointsinteger (int32)折扣基点,10000 表示原价;最终单价已含折扣。最小值:1;最大值:10000
models[].officialPricing.inputPriceYuanstring官网输入参考单价,十进制字符串。
models[].officialPricing.outputPriceYuanstring官网输出参考单价,十进制字符串。
models[].outputModalitiesstring公开输出模态说明;未提供时为 null。示例:null;可为 null
models[].outputPriceYuanstring当前输出最终单价,十进制字符串;未提供时为 null。示例:null;可为 null
models[].timePricingobject峰谷两档实际价格与当前档位;未启用时为 null。示例:null;可为 null
models[].timePricing.activePeriodstring当前时段,PEAK 或 OFF_PEAK。
models[].timePricing.nextSwitchAtstring (date-time)下一次价格档位切换时间。
models[].timePricing.offPeakobject低谷最终价格。
models[].timePricing.offPeak.cachedInputPriceYuanstring本时段缓存输入最终单价,十进制字符串;未提供时为 null。可为 null
models[].timePricing.offPeak.inputPriceYuanstring本时段输入最终单价,十进制字符串。
models[].timePricing.offPeak.officialPricingobject本时段官网参考价与折扣;未提供时为 null。可为 null
models[].timePricing.offPeak.officialPricing.cachedInputPriceYuanstring官网缓存输入参考单价,十进制字符串。
models[].timePricing.offPeak.officialPricing.discountBasisPointsinteger (int32)折扣基点,10000 表示原价;最终单价已含折扣。最小值:1;最大值:10000
models[].timePricing.offPeak.officialPricing.inputPriceYuanstring官网输入参考单价,十进制字符串。
models[].timePricing.offPeak.officialPricing.outputPriceYuanstring官网输出参考单价,十进制字符串。
models[].timePricing.offPeak.outputPriceYuanstring本时段输出最终单价,十进制字符串。
models[].timePricing.peakobject高峰最终价格。
models[].timePricing.peak.cachedInputPriceYuanstring本时段缓存输入最终单价,十进制字符串;未提供时为 null。可为 null
models[].timePricing.peak.inputPriceYuanstring本时段输入最终单价,十进制字符串。
models[].timePricing.peak.officialPricingobject本时段官网参考价与折扣;未提供时为 null。可为 null
models[].timePricing.peak.officialPricing.cachedInputPriceYuanstring官网缓存输入参考单价,十进制字符串。
models[].timePricing.peak.officialPricing.discountBasisPointsinteger (int32)折扣基点,10000 表示原价;最终单价已含折扣。最小值:1;最大值:10000
models[].timePricing.peak.officialPricing.inputPriceYuanstring官网输入参考单价,十进制字符串。
models[].timePricing.peak.officialPricing.outputPriceYuanstring官网输出参考单价,十进制字符串。
models[].timePricing.peak.outputPriceYuanstring本时段输出最终单价,十进制字符串。
models[].timePricing.schedulestring峰谷时间表标识。
models[].timePricing.timezonestring选档时区。
priceUnitstring价格计价单位。示例:"元/百万 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/models500COMMON_001模型目录读取失败是,退避后稍后重新查询;不要把失败当作空目录
https://api.tokenfactory.cn/v1/public/models405COMMON_004使用 GET 以外的请求方法改用 GET /v1/public/models

错误返回报文

适用完整地址

https://api.tokenfactory.cn/v1/public/models

HTTP 405Content-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 独立。读取失败不能当成空目录,接口开放不代表全部可选能力均可用。

Token Factory · 国产合规 AI Gateway