Requirements and integration
DeepSeek Harness loads TokenLedger in the web profile. The README requires @deepseek-ai/dsh >= 0.1.0-rc.6. DeepSeek Harness exposes the plugin through the web sidebar and its command surface; restart dsh web after installation before refreshing the browser.
TokenLedger reads provider settings and uses only each provider’s baseURL for relay discovery. Credentials remain in the provider configuration. Its aggregation index records usage by session, day, site, provider, and model. The README does not specify the index file path.
Configuring TokenLedger
No configuration is normally required. Add overrides to the existing settings.yaml; changes are hot-reloaded.
| Key |
Purpose |
tokenledger.relays |
Maps a route name to a relay URL when automatic discovery cannot find it. |
tokenledger.rates |
Supplies rate buckets, effective dates, and peak/off-peak pricing for cost estimates. The default is []; unpriced models show —. |
tokenledger.fingerprint |
Controls relay fingerprint probing. The default is false; the first balance query can probe automatically. |
tokenledger.endpoints |
Declares a fallback balance endpoint for a configured provider origin. |
Custom endpoints accept origin, displayName, path, fields, and windows. path must be an absolute single-slash path. TokenLedger sends only GET, does not follow cross-origin redirects, applies response-size and timeout limits, and reads the key from the matched provider’s apiKeyEnv. raw is available where the endpoint requires an unprefixed key.
TokenLedger commands
DeepSeek Harness registers these commands:
/tokenledger [days] [site] queries all time or a day range, optionally filtered by site.
/tokenledger site lists discovered relays; site add <route> <address> and site rm <route> manage overrides.
/tokenledger export csv 30 exports data; export json is also supported.
/tokenledger diagnostics reports index health and unattributed rows.
/tokenledger reindex discards the index and rebuilds it.
Supported account queries
Built-in balance or quota readers cover DeepSeek, New API variants, Sub2API, Moonshot/Kimi, GLM/Z.ai, OpenRouter, OpenCode Go, Kimi For Coding, MiniMax Coding Plan, and Z.ai Coding Plan. OpenRouter requires a Management Key; other listed providers use the key configured for the route. ~/.local/share/opencode/auth.json is an additional fallback for OpenCode Go when no apiKeyEnv is configured.
Written from the project's own documentation and kept in sync with it. Where the two disagree, the source is authoritative — read the README on GitHub