价格目录 API

价格目录 API

GET /x-pricing

返回价格目录。价格表本身是公开数据,可匿名访问;携带 API Key 时返回该账号的最终价格。

请求

方式目录所属租户倍率
携带 Authorization: Bearer <key>该账号所属租户账号的 rates × factor
匿名,带 ?oid=<租户 ID>(或 ?owner=、?public_key=pk-Xvs...)指定租户1
匿名,无参数默认租户1
# 公开目录
curl "$BASE_URL/x-pricing"

# 当前账号的最终价格
curl "$BASE_URL/x-pricing" -H "Authorization: Bearer $API_KEY"
  • public_key 是账号的公开标识,可从 GET /dashboard/status 获取;格式错误返回 400 invalid public_key,找不到返回 404 public key not found。oid 与 owner 必须是正整数,否则返回 400 owner id must be a positive integer。
  • 携带了 Authorization 但 Key 无效时直接返回 401,不会退回公开目录。
  • 只接受 GET;OPTIONS 返回 204;其他方法返回 405 method not allowed。
  • 响应带 Cache-Control: no-cache。

响应

{
  "object": "pricing_catalog",
  "oid": 1,
  "public": false,
  "currency": "USD",
  "unit_notes": {
    "per_1m_tokens": "Token prices are displayed per 1M tokens.",
    "per_minute": "Voice duration is displayed per minute and billed per second.",
    "per_image": "Image size prices are displayed per generated image.",
    "per_second": "Video resolution prices are displayed per generated second.",
    "per_call": "Call prices are displayed per request."
  },
  "generated_at": "2026-11-20T00:00:00Z",
  "user": {"id": 42, "oid": 1, "rates": 1, "factor": 1, "multiplier": 1},
  "data": [
    {
      "id": "gpt-6.2-sol",
      "category": "ChatPricing",
      "kind": "chat",
      "unit": "per_1m_tokens",
      "base": {"InputText": 2, "CachedText": 0.1, "CacheWrite": 2.5, "OutputText": 10, "FastTokenMultiplier": 2, "Rates": 1},
      "effective": {"InputText": 2, "CachedText": 0.1, "CacheWrite": 2.5, "OutputText": 10, "FastTokenMultiplier": 2, "Rates": 1},
      "final": {"InputText": 2, "CachedText": 0.1, "CacheWrite": 2.5, "OutputText": 10, "FastTokenMultiplier": 2},
      "rates": {"model": 1, "user": 1, "factor": 1, "effective": 1},
      "override": false,
      "custom": false
    }
  ]
}

示例已省略长上下文档位 ContextTiers;各模型实际包含的价格字段以实时响应为准。

字段说明
user仅携带 Key 时出现
data[].category、kind价格表分类:ChatPricing/chat、ImgPricing/image、VideoPricing/video、AudioPricing/audio、RerankPricing/rerank、CallPricing/call、FineTuningPricing/fine_tuning
data[].unitper_1m_tokens、per_image、per_second、per_minute、per_call
base系统默认价格
effective叠加租户自定义价格后的价格
final最终价:价格字段 × 模型 Rates(长上下文档位可有自己的 Rates)× 账号 rates × factor;对话、微调与 Rerank 的 Call 只乘账号倍率;InputThreshold、FastTokenMultiplier 保留原值,不含 Rates 字段
rates模型倍率、账号倍率、价格系数及其乘积
override是否与系统默认不同
custom是否为租户新增的模型

currency 为目录的基准货币 USD;价格系数不为 1 的账号按该系数换算,以人民币结算。final 中的 Token 单价尚未应用快速档位(fast/ultrafast)倍率,见《Router API》。

相关文档