zh667/TokenLedger

Token usage accounting for DeepSeek Harness, reconciled against New API and Sub2API relay-site billing

TokenLedger tracks DeepSeek Harness token usage and attributes each request to the relay site (provider baseURL) that actually served it — no configuration, no credentials. The Usage Ledger panel shows balance, subscription quota windows (hourly/weekly/monthly with reset times), per-project breakdowns (grouped by workspace directory), usage analytics (today/month/cumulative with model drill-down, cache hit rate, year-long activity heat map), cost estimates with date-segmented rate tables, and CSV/JSON export. All data stays local via read-only loopback endpoints.

Other ★ 119 updated 2026-08-17 ⏳ pending
View on GitHub ↗

Install

dsh plugin --profile web add "github:zh667/TokenLedger"

Requires DeepSeek Harness web profile (dsh >= 0.1.0-rc.6). After install, restart dsh web and hard-refresh the browser. The 'Usage Ledger' entry appears at the bottom of the sidebar. Run /tokenledger diagnostics in DSH to debug relay attribution.

Compatibility

Requires DeepSeek Harness web profile, dsh >= 0.1.0-rc.6. To pin a specific version, use the full 40-character commit SHA (short SHAs are not supported by the package resolver).

Details

Recent updates

Supports DeepSeek official API, New API, and Sub2API balance checking. Subscription quota tracking for time-windowed plans. Heat map shows daily token usage for 365 days. Diagnostics command: /tokenledger diagnostics prints current relay attribution and index routes.

FAQ

How do I install TokenLedger?
Run: dsh plugin --profile web add "github:zh667/TokenLedger". Requires dsh >= 0.1.0-rc.6 with the web profile. Restart dsh web and hard-refresh the browser — the Usage Ledger entry appears at the bottom of the sidebar.
How does TokenLedger attribute token usage to relay sites?
It reads provider baseURLs from dsh's existing provider config and normalizes them to origin-level relay sites — multiple API keys to the same site merge into one row. It reads only baseURLs, never touches credentials.
What if my relay site isn't showing up in TokenLedger?
Run /tokenledger diagnostics in any DSH conversation — it prints current relay attribution and index routes. If your provider's baseURL is configured in dsh, it should appear; if not, check that dsh recognizes the provider.

Alternatives

Han-1413141/dsh-cost-meter · bowenliang123/dsh-context

More plugins in Other

Browse more in Other

Guides for Other plugins