dsh-billing-cn
其他 活跃维护

dsh-billing-cn

LM20230311/dsh-billing-cn

支持国内六大主流模型计费,统一按人民币结算,消费等级从🐟到🌊生动展示,插件化设计接入简单,让中文用户直观掌握模型消费

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
TypeScript
主要语言
MIT
开源协议
10 KB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:LM20230311/dsh-billing-cn
git clone https://github.com/LM20230311/dsh-billing-cn.git
git clone git@github.com:LM20230311/dsh-billing-cn.git
README.md main

dsh-billing-cn

DeepSeek Harness 中文计费插件 — 支持国内六大模型,人民币计费,带消费等级和分享卡片

npm
dsh-plugin
license

English | 中文

功能

  • 🀄 人民币计费 — 按国内模型官方定价换算,不是美元
  • 🏭 六大厂商 — DeepSeek、阿里通义、腾讯混元、字节豆包、百度文心、智谱 GLM
  • 🐟 消费等级 — 🐟→🐠→🐡→🦈→🐳→🌊,可分享到朋友圈
  • 📊 多维统计 — 按模型、按会话查看消费明细
  • 🔌 一行接入 — 标准 Cordis 插件,cordis.yml 配置即可
  • 💬 /bill 命令 — 随时在 dsh 里输入 /bill 查看账单

安装

npm install dsh-billing-cn

快速开始

在你的 cordis.yml 里加一段:

- id: billing-cn
  plugin: dsh-billing-cn
  config:
    defaultModel: deepseek-chat   # 默认模型(当会话未指定时使用)
    printOnSessionEnd: true        # 每次会话结束后打印摘要

然后在 dsh 里输入 /bill 随时查看:

📊 dsh-billing-cn 账单摘要
────────────────────────────────────────
  总消费:¥0.0234
  总 Token:18.3K
  会话数:5
  等级:🐠 热带鱼  [████░░░░░░░░░░░░░░░░]
  距下一级还需 ¥9.9766
────────────────────────────────────────
  deepseek-chat: ¥0.0234 (18.3K tokens, 5 次会话)

支持的模型

厂商 模型 ID 输入价(元/百万 token) 输出价(元/百万 token)
DeepSeek deepseek-chat 1 2
DeepSeek deepseek-reasoner 4 16
阿里云 qwen-max 40 120
阿里云 qwen-plus 4 12
阿里云 qwen-turbo 0.3 0.6
腾讯 hunyuan-pro 30 100
字节跳动 doubao-pro-32k 0.8 2
字节跳动 doubao-lite-32k 0.3 0.6
百度 ernie-4.0 120 120
智谱 glm-4 100 100
智谱 glm-4-flash 0 0

定价基于 2026-08 各厂商官网公开数据,如有变动欢迎提 PR。

消费等级

等级 累计消费
🐟 小鱼苗 < ¥1
🐠 热带鱼 ¥1 – ¥10
🐡 河豚 ¥10 – ¥50
🦈 鲨鱼 ¥50 – ¥100
🐳 蓝鲸 ¥100 – ¥500
🌊 海王 ≥ ¥500

在代码中使用

import { BillingCnService, getCostTier, MODEL_PRICES } from 'dsh-billing-cn'

// 直接调用计费逻辑
const tier = getCostTier(12.5)
console.log(tier.emoji, tier.label) // 🐡 河豚

// 查看所有模型定价
console.log(MODEL_PRICES['deepseek-chat'])

贡献

欢迎提 PR 更新定价或添加新模型!见 CONTRIBUTING.md。

License

MIT