Skip to content

价目字段

本页说明模型价目的计费单位、实际扣费计算方式和成本估算示例。

模型价目 API 见 获取价目


计费单位

charge_unit适用模态说明
tokentext按 token 数量计费。输入(prompt)和输出(completion)分别计价。部分模型还支持缓存输入(cached_input),价格低于普通输入。
image_countimage按图片张数计费。不同分辨率对应不同档位价格。
video_secondvideo按视频时长(秒)计费。不同分辨率对应不同档位价格。

实际扣费计算

生文(token

实际扣费由消耗量 × 对应的分段单价计算:

扣费金额 = input_tokens × input_unit_price + output_tokens × output_unit_price
  • 如果模型使用缓存输入(prompt caching),缓存部分按 cached_input 单价计算,而非 input 单价。
  • 单价按上下文长度分段:短上下文的输入/输出价格较低,长上下文价格较高。
  • 价格单位 /per_million_tokens 表示每百万 token 的价格。

示例

python
# 模型: gpt-5.5(context_length_range)
# 输入: 10K tokens(≤ 272K 区间,$5/百万 tokens)
# 输出: 500 tokens(≤ 272K 区间,$30/百万 tokens)

input_cost = (10_000 / 1_000_000) * 5      # = $0.05
output_cost = (500 / 1_000_000) * 30        # = $0.015
total = input_cost + output_cost            # = $0.065

生图(image_count

扣费金额 = 图片张数 × 对应分辨率档位单价

不同分辨率档位价格差异显著。例如:

模型分辨率单价1 张费用4 张费用
GG-2.51k$0.0414/张$0.0414$0.1656
GG-2.54k$0.0635/张$0.0635$0.2540

生视频(video_second

扣费金额 = 视频时长(秒) × 对应分辨率档位单价

例如 5 秒 1080p 视频:

模型分辨率单价5 秒费用
kling-2.6720p$0.042/秒$0.21
kling-2.61080p$0.14/秒$0.70

缓存输入(cached_input)

部分生文模型支持 prompt caching。当请求的输入与前序请求的输入部分重合时,缓存部分按 cached_input 价格计费,通常低于 input 价格。

  • 缓存输入在 price_groups 中以 token_kind: "cached_input" 标识,结构同 input / output
  • 缓存命中由平台自动判断,无需客户端配置。

分段计价示例

context_length_range 模式的模型为例,价格随上下文长度变化:

上下文范围输入单价输出单价
0 – 128K tokens$2/百万$10/百万
128K – 272K tokens$5/百万$30/百万
> 272K tokens$10/百万$45/百万

假如某次调用消耗了 150K input tokens + 1K output tokens

python
# input: 150K tokens → 落在 128K–272K 区间,单价 $5/百万
input_cost = (150_000 / 1_000_000) * 5    # = $0.75

# output: 1K tokens → 落在 0–128K 区间,单价 $10/百万
output_cost = (1_000 / 1_000_000) * 10    # = $0.01

total = input_cost + output_cost           # = $0.76

变体价目(price_variants)

部分模型支持分时折扣等其他价目变体。effective_variant 指示当前生效的变体。登录后,价目 API 返回的 amount 为该变体下的实际价格。折前原价见 list_amount


相关

© Trinity AI