doublemolu/dsh-costometer1

dsh-costometer

花知多少:DSH 费用与余额计量器,支持账户余额、充值历史、单次与累计消耗、低余额守护及 8 种语言与货币切换。

AI 分析

核心用途是多币种、多维度的 API 费用审计。适合对预算控制要求高、使用多模型或跨国货币结算的用户。支持低余额警报与实时刷新。

套件
dsh-costometer
版本
1.2.8
授權
MIT
最近更新
2026年9月1日

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

Usage

Sidebar stateWhat you see
Wide sidebarFull card: balance, granted/topped-up split, latest call usage, conversation total, model-call count, segmented progress bar, recharge button
Collapsed rail (56px)Small status dot (green / amber / red) with a tooltip summary
  • Balance refreshes every 15s; conversation totals every 8s (cached fold of the session log). Use the ⟳ button on the card to refresh immediately.
  • Click 充值 ↗ to open .
  • Hover the progress bar to see 剩余 ¥xx / 充值 ¥xx; hover 本会话累计 to see per-model breakdown.
  • A ▼/▲ ¥xx indicator next to the balance shows recent changes; the card footer shows the last refresh time.

Configuration (v1.1.0+)

All tunables live in $DSH_HOME/dsh-costometer.json (auto-generated with defaults on first run). Edit and save — the plugin picks changes up within ~10s.

{
  "segmentBase": 50,
  "redThreshold": 15,
  "warnLow": 10,
  "warnDanger": 3,
  "fxCny": 7.1,
  "lang": "zh-CN",
  "currency": "CNY",
  "prices": {
    "deepseek-v4-flash": { "peak": { "in": 3.0, "inHit": 0.10, "out": 9.0 }, "off": { "in": 1.5, "inHit": 0.05, "out": 4.5 } },
    "deepseek-v4": { "peak": { "in": 3.0, "inHit": 0.10, "out": 9.0 }, "off": { "in": 1.5, "inHit": 0.05, "out": 4.5 } },
    "deepseek-chat": { "peak": { "in": 2.0, "inHit": 0.20, "out": 3.0 }, "off": { "in": 1.0, "inHit": 0.10, "out": 1.5 } },
    "deepseek-reasoner": { "peak": { "in": 4.0, "inHit": 1.0, "out": 16.0 }, "off": { "in": 2.0, "inHit": 0.5, "out": 8.0 } }
  }
}
KeyMeaningDefault
segmentBaseProgress-bar segment amount (yuan)50
redThresholdRightmost segment turns red below this (yuan)15
warnLow / warnDangerLow-balance alert thresholds (yuan)10 / 3
fxCnyOnly used for the secondary approximate USD figure of cost estimates (estUsd); costs themselves are priced directly in CNY7.1
langUI language: zh-CN / zh-TW / en-US / en-GB / de / ja / ko / ruzh-CN
currencyDisplay currency: CNY / TWD / USD / GBP / EUR / JPY / KRW / RUB (auto-updated rates against CNY)CNY
ratesBuilt-in fallback exchange rates (1 CNY → currency); live rates auto-fetch from a free API (multi-endpoint fallback), 6h cache, zero token costbuilt-in
pricesOfficial CNY peak/off-peak pricing per model, per million tokens (peak / off sets)official