Back to directory

tokenledger

Curated pickMaintenance: Active

zh667/tokenledger

Relay-site attributed token usage for DeepSeek Harness — zero config, no credentials

View on GitHubHomepage
$ dsh plugin --profile web add "github:zh667/TokenLedger"

202

stars

18

forks

JavaScript

Language

MIT

License

2026-08-14

Created

2026-09-15

Last push

A DeepSeek Harness (dsh web) plugin that attributes token usage to the relay site per request, with per-project grouping, balances, subscription quotas, analytics, cost estimation and CSV/JSON export — zero config, no credentials.

DSH integration

Compatible

Author-claimed

Safety audit

Unaudited

Last verified

2026-08-24

License

MIT

01What can it help you accomplish?

  • Attribute DeepSeek Harness token usage to the relay site that actually served each request, with per-project grouping and cost estimation

    A web-panel "usage ledger": relay-site attribution, per-project usage, balances, subscription quotas, usage analytics and CSV/JSON export

    DeepSeek Harness (dsh web) users who run traffic through relay sites (New API / Sub2API / official DeepSeek) and need to account for token spend

02How to install into DeepSeek Harness

Prerequisites

  • DeepSeek Harness `web` profile — `@deepseek-ai/dsh >= 0.1.0-rc.6`
  • A relay site whose `baseURL` is already configured in the host's provider config (the plugin discovers it, no credentials needed)

Installation steps

  1. 01

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

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

  2. 02

    Restart the running `dsh web` and hard-refresh the browser; a "usage ledger" entry appears at the bottom of the sidebar

    $ dsh web

  3. 03

    To pin a version use the full 40-character commit SHA, e.g. `github:zh667/TokenLedger#<sha>`

  4. 04

    Upgrade with `dsh plugin --profile web update dsh-tokenledger`; remove with `dsh plugin --profile web remove dsh-tokenledger`

    $ dsh plugin --profile web update dsh-tokenledger

Verify the integration

Not specified by the author

Rollback

  • dsh plugin --profile web remove dsh-tokenledger

03DSH integration and capability boundaries

DSH integrationCompatible

Installs into the DeepSeek Harness web profile via the dsh plugin CLI; registers a "usage ledger" entry in the sidebar. Requires `@deepseek-ai/dsh >= 0.1.0-rc.6`.

  • Relay-site attribution

    host provider config (baseURL per provider)→usage grouped by normalized relay origin; multiple keys to one site collapse to one row, named by domain

  • Per-project attribution

    session launch directory→usage grouped by the directory a session started in (workspace title if registered, else directory name; nested sessions included)

  • Zero-config discovery

    host provider configuration→relay sites read from the host config; only `baseURL` is read, credentials are never touched

  • Balances

    one ordinary API key per account (DeepSeek official / New API / Sub2API)→balances shown; unlimited keys report "used" rather than a fake balance

  • Subscription quota

    relay accounts sold as plans rather than balances→5-hour / weekly / monthly rolling quotas each with their own progress bar and reset time

  • Usage analytics

    recorded usage→today / this-month / cumulative windows, drill-down by site and model, cache hit rate, one-year activity heatmap

  • Cost estimation

    effective-date-segmented rate table, tiered pricing, peak/off-peak→estimated cost; unpriced models show a dash instead of 0

  • Export & diagnostics

    recorded usage→CSV / JSON export, index health, rows that could not be attributed listed separately

  • Read-only loopback

    loopback GET requests→two endpoints accept loopback GET only, guarded on peer socket address; never reads prompts, tool args or response bodies

    exposes two loopback-only GET endpoints

04Who is it for? When not to use it?

Good for

  • DeepSeek Harness (dsh web) users who run traffic through relay sites (New API / Sub2API / official DeepSeek) and need to account for token spend

Not for

  • To pin a version you MUST use the full 40-character commit SHA. The package manager matches ref against `git ls-remote`; short SHAs match nothing and fail with `Could not resolve`.

05Compatibility, maintenance and safety notes

  • The plugin never sends API keys or raw upstream responses to the browser, and never reads prompts, tool args or response content.
  • To pin a version you MUST use the full 40-character commit SHA. The package manager matches ref against `git ls-remote`; short SHAs match nothing and fail with `Could not resolve`.
  • Requires the DeepSeek Harness web profile (`@deepseek-ai/dsh >= 0.1.0-rc.6`). The panel shows in `dsh web` only.
2026-08-142026-08-22v0.1.0

MIT · active (latest release v0.1.0, 2026-08-15)

06Frequently asked questions

Do I need to enter my API keys into TokenLedger?

No. The plugin reads only the `baseURL` from your host's provider config to discover relay sites; it never touches the credentials next to them, nor sends API keys or raw upstream responses to the browser.

How do I pin a specific version when installing?

Use the full 40-character commit SHA in the spec, e.g. `github:zh667/TokenLedger#<sha>`. Short SHAs are not in the reference list that the package manager checks against `git ls-remote`, so they fail with `Could not resolve`.

Which relay sites are supported for balances and quotas?

DeepSeek official, New API and Sub2API — one ordinary API key per account. Unlimited-quota keys report "used" rather than a fabricated balance; subscription plans show rolling 5-hour / weekly / monthly quota bars.

What does TokenLedger never read or send?

Its two endpoints accept loopback GET only and are guarded on the peer socket address. It never reads prompts, tool arguments or response content, and never sends API keys or upstream raw responses to the browser.

How do I upgrade or remove the plugin?

Run `dsh plugin --profile web update dsh-tokenledger` to upgrade and `dsh plugin --profile web remove dsh-tokenledger` to remove. Re-adding the same spec re-resolves the latest `main`.

08Data and sources

  • Author-claimedgithub.com87b3d1806ac4…

    需要 DeepSeek Harness `web` profile(`@deepseek-ai/dsh >= 0.1.0-rc.6`)。

  • Author-claimedgithub.com87b3d1806ac4…

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

This page is generated from the project’s public documentation, repository metadata and a structured parse of DSH Plugins; last verified on 2026-08-24. Found an error? Submit a correction.

🏆

Best DeepSeek Harness Plugins

Twelve plugins worth installing first — picked from the whole catalog, across every category.

DSH Plugins is an independent community directory of DeepSeek Harness plugins. Not affiliated with or endorsed by DeepSeek. Third-party plugins are not security-audited — review the source before installing.

New DeepSeek Harness plugins, weekly. No spam.