Skip to content

API Key 增加计费倍率#634

Open
Hao-IANWY wants to merge 1 commit into
fawney19:mainfrom
Hao-IANWY:Multiplier
Open

API Key 增加计费倍率#634
Hao-IANWY wants to merge 1 commit into
fawney19:mainfrom
Hao-IANWY:Multiplier

Conversation

@Hao-IANWY
Copy link
Copy Markdown

主要改动

  • api_keys 表新增 billing_multiplier 字段,默认值为 1.0
  • 管理端支持创建、更新、查看用户 API Key 和独立余额 Key 的计费倍率。
  • 普通用户 API Key 页面只读展示倍率,不允许自行修改。
  • usage 计费链路带入 API Key 倍率:
    • total_cost_usd 保留原始模型成本。
    • actual_total_cost_usd 使用 provider 倍率和 API Key 倍率后的实际扣费。
  • free_tier 上游仍保持实际成本为 0
  • billing metadata 记录最终倍率、provider 倍率和 API Key 倍率,便于审计。
  • 前端管理端表单、列表和详情页增加计费倍率展示与编辑入口。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant