At a glance
What it does
A DSH web plugin that shows token, cache, and estimated cost details inside the context popover.
Web Profile
Not declared in supplied evidence
Evidence-verified
Checked Sep 13, 2026, 2:13 PM UTC
Code-evidenced contributions
What it adds to DSH
Adds live session, turn, and request cost and token statistics to DSH's context-usage popover.
Mechanism evidence ↗Before you choose it
Axia Cache Billing adds a billing panel to DSH's existing context-usage popover rather than opening a separate page. It reports current-step, current-turn, and whole-session totals, breaking costs into cached input, uncached input, and output; it also presents event-counted context metrics and token totals. Its settings support configured providers/models, a price catalog, manual pricing, peak/off-peak prices, and popover-only font sizing.
Best for
DSH users who want to inspect the cost and cache-token makeup of an active conversation.
Common tasks
- Compare cached, uncached, and output-token costs for the current request, turn, or session.
- Review session event counts such as turns, steps, tool calls, images, pruning, injections, and compression.
- Select or customize provider/model prices, including peak/off-peak and CNY/USD entries.
Permissions and data
Operates as a DSH web plugin and may use configured provider/model information, session events, token usage, pricing entries, and exchange-rate data to display billing estimates.
Permissions- Injects into the DSH web client settings-plugin UI.
- Is enabled in a profile layer through the bundle patch.
- Uses session-log events for context metrics and token/cost presentation.
- Caches exchange-rate and price-catalog data locally according to the README.
- Requests exchange rates from open.er-api.com; the README says it falls back to parallel currency display if rates are unavailable.
- No credential requirement is declared in the supplied evidence.
Limitations
- Exact DSH Harness version compatibility is not declared.
- Cost figures depend on configured or catalog pricing and available exchange rates.
- Installation and runtime behavior were not executed during this curation.
What DSHub checked
- The pinned source contains a structurally verified DSH bundle patch that enables the plugin.
- The manifest declares a web client injection and exports built library paths.
- Git-bundle distribution at the pinned commit is verified.
What DSHub did not check
- Successful installation, restart behavior, UI rendering, and calculation accuracy were not tested.
- Actual exchange-rate requests, local caching, and fallback behavior were not tested.
Pinned install
Install Axia Cache Billing
This plugin bundle does not have a DSH Plugin install action. Use its source documentation for the delivery method.
Maintainer source
Project README
虾算账 · dsh-axia-cachebilling
Token 计费 & 缓存监控 —— 挂在 DSH 上下文弹层里的实时账单。
DSH 里聊得越久,上下文越长,钱就越花在缓存上:一算下来,账单里 90% 以上可能都是缓存读取。 虾算账把这件事实时摊开给你看 —— 每次请求、每一轮、整个会话,命中多少、未命中多少、输出多少,各花了多少钱;再配上按会话事件真实统计的上下文指标。
它是什么
一个 DSH Web 插件(宿主半身 + 浏览器半身),把自己贴进 DSH 自带的上下文占用弹层里,不新开页面、不挡聊天。
弹层里看到什么
| 区块 | 内容 |
|---|---|
| 当前会话统计 | 三档账单:当前步 / 当前轮 / 本会话,每档给出合计与 命中 / 未命中 / 输出 三笔明细;底部一行模型胶囊(provider/model · 谷价/峰价 · 货币) |
| 上下文统计 | 8 项按会话日志事件真实计数的指标:轮次、步数、工具调用、图片、剪枝、注入、压缩(+ 预估费用);不是估算、不是占比推算 |
| Token 统计 | 总 token 一行 + 缓存输入 / 未缓存输入 / 输出三行,给百分比与绝对量 |

金额口径:
- 多币种自动统一:按实时汇率把「元」与「美元」折算成当前条目计费币种单一展示(汇率取自
open.er-api.com,带本地缓存与失败回退;取不到就退化为并列展示,绝不瞎算); - 峰谷价:支持按峰谷时段分别计价;
- 第三方中转同样计费,按价目表匹配模型。
设置页能做什么

- 供应商 / 模型从 DSH 已配置的列表里挑,可一键拉取模型清单;
- 价目目录:内置 Open Code / Command Code / GLM / Kimi / MiniMax / MiMo 等模型价格,新增条目或改动模型时自动填价,也可手动「刷新价格」;
- 自定义条目(一口价 / 峰谷价、元或美元),改完即时生效,无需重启;
- 弹层字号档位(标准 / 大 / 超大 / 巨大)——只作用于弹层,设置页保持标准大小。
安装
dsh plugin --profile web add github:Animal2404/dsh-axia-cachebilling
装完重启 DSH,打开任意会话的上下文占用弹层即可看到账单。
给维护者
- 构建只在 GitHub Actions 进行:
.github/workflows/build.yml在main的 push 上执行npm install+npm run build(esbuild),把产物lib/回写进仓库并上传为 artifact;本地只需git pull拿产物,不需要本地构建。 - 源码:
src/index.ts(宿主投影:按会话事件流计价与计数)、src/client.ts(弹层 UI)、src/settings.ts(设置页 UI)、src/prices.ts(价目目录拉取与匹配); - 价目目录:仓库根
price-catalog.json,客户端按需拉取并缓存。
贡献者
| 贡献者 | 角色 |
|---|---|
| @Animal2404 | 本仓库维护者 |
| @Phant0Meow | 最初 dsh-cache-billing 的作者(三档账单思路与实现基础) |
| @better-er | 大幅重写者(三级账单、第三方中转支持、缓存失效统计) |
致谢与出处
本插件基于同生态下的 MIT 项目演进而来,特此注明:
- 最初的
dsh-cache-billing(作者 Phant0Meow):三档账单的原始思路与实现基础; - better-er 的大幅重写:三级账单、第三方中转支持、缓存失效统计等。
按 MIT 许可要求,上游版权声明保留在 LICENSE 中。
许可
MIT —— 见 LICENSE。
Operate deliberately
Install and manage
Prerequisites and target Profile
Target: Web Profile
Delivery: Dsh Bundle Git — Animal2404/dsh-axia-cachebilling#deade1327ef098f4a15d6b2cafb0995bbada7dff。
Verify, update, and remove
Show lifecycle commands
dsh plugin --profile web listCompatibility and access
DSH web client bundle; exact Harness range not declared: Not declared in supplied evidence。
Review compatibility evidence ↗
Risk facts
Exchange-rate lookup
Evidence ↗Package declares a prepare build script
Evidence ↗Evidence and editorial reviewManifest, Bundle patch, distribution and freshness
Immutable evidence
Review status and source activity
MIT licensed. Prefer the pinned Git-bundle source because the supplied evidence does not find the npm package version.
AI reviewed Sep 13, 2026, 2:14 PM UTC。GitHub facts last checked Sep 13, 2026, 2:14 PM UTC。
No material source change has been recorded since this evidence baseline.