← Back to home@LM20230311

dsh-billing-cn

DeepSeek Harness 中文计费插件 — 支持国内六大模型,人民币计费,消费等级 🐟→🌊

Stars
0
Language
TypeScript
Created
Aug 19, 2026
Updated
Aug 19, 2026

Introduction

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)
DeepSeekdeepseek-chat12
DeepSeekdeepseek-reasoner416
阿里云qwen-max40120
阿里云qwen-plus412
阿里云qwen-turbo0.30.6
腾讯hunyuan-pro30100
字节跳动doubao-pro-32k0.82
字节跳动doubao-lite-32k0.30.6
百度ernie-4.0120120
智谱glm-4100100
智谱glm-4-flash00

定价基于 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