jooey/dsh-usage-openrouter

Shows OpenRouter spend in the composer: lifetime credits, this key's daily/weekly/monthly usage, BYOK and remaining balance.

Puts the number that decides whether you can keep working into the composer instead of a separate tab: prepaid accounts see Balance $x · Used $y, a key with a hard limit sees Left $x · Used $y, and other keys see Used $y. The /usage-openrouter command gives the full picture — lifetime spend, this key's daily, weekly and monthly meters, BYOK usage, the key's limit and the remaining credit balance — and clicking the chip opens the OpenRouter activity log. Credential handling is the right way round: the key is resolved host-side per request, so a browser session cannot read it.

Usage & Billing ★ 0
View on GitHub ↗

Install

dsh plugin --profile web add dsh-usage-openrouter

The npm line; a local path or a built tarball also installs, and either way the Cordis contract is mounted in ~/.dsh/profiles/web/cordis.patch.yml and the profile restarted. The credential is OPENROUTER_API_KEY, resolved through the harness credentials seam (~/.dsh/.credentials.yaml) on the host, so the key never reaches the browser. It is one of a family with dsh-usage-deepseek, dsh-usage-opencode-go and dsh-usage-minimax-cn, so a multi-provider setup can read consistently.

Compatibility

An OpenRouter account and key on the OpenRouter provider; the readout only renders while the selected model's provider is openrouter, and refreshes every 60 seconds. Two endpoints back it and they fail independently — GET https://openrouter.ai/api/v1/credits for total_credits and total_usage across all keys, and GET https://openrouter.ai/api/v1/auth/key for the key label, free-tier flag, usage/usage_daily/usage_weekly/usage_monthly, byok_usage, limit and limit_remaining. The chip shows whatever arrived plus a warning when one side fails, and errors only when both do.

Details

Alternatives

AlfredChaos/dsh-usage-panel · paolomandica/dsh-cost-usage-monitor · feiyang-dev/dsh-usage-plugin

More plugins in Usage & Billing

Browse more in Usage & Billing

Guides for Usage & Billing plugins