mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-31 08:25:35 +00:00
feat(billing): 渠道自定义定价支持图片输入 token 单价 image_input_price
渠道 token 计费模式此前无法为图片输入 token 单独定价,gpt-image-2 图片编辑等请求的图像输入被按文本 input_price 计费。新增 channel_model_pricing.image_input_price 列及全链路支持。 后端: - 迁移 178:channel_model_pricing 新增 image_input_price 列 - ChannelModelPricing 新增 ImageInputPrice 字段,repo 读写、校验补齐 - model_pricing_resolver / GetModelPricingWithChannel 映射到 ImageInputPricePerToken;未配置时归零,由 computeTokenBreakdown 回退文本输入价(向后兼容,与 image_output_price 的渠道权威规则一致) - admin / 用户侧定价 DTO 与 model-pricing 自动填充接口补充该字段 前端: - 渠道定价表单新增「图片输入」价格输入(token 模式) - API 类型、表单模型、form↔API 换算、自动填充、用户侧模型定价卡展示 - zh/en i18n 标签 相关 #4386。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015wcJTKDddxXSQrepSs3wrU
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
7c43b7327d
commit
06e03f467a
@@ -30,6 +30,7 @@ export interface ChannelModelPricing {
|
||||
output_price: number | null
|
||||
cache_write_price: number | null
|
||||
cache_read_price: number | null
|
||||
image_input_price: number | null
|
||||
image_output_price: number | null
|
||||
per_request_price: number | null
|
||||
intervals: PricingInterval[]
|
||||
@@ -154,6 +155,7 @@ export interface ModelDefaultPricing {
|
||||
output_price?: number
|
||||
cache_write_price?: number
|
||||
cache_read_price?: number
|
||||
image_input_price?: number
|
||||
image_output_price?: number
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user