# π³ Whale Meter Β· dsh-whale-meter
**An electricity meter for your whale β usage & cost dashboard for DeepSeek Harness**
One-line install Β· Zero config Β· Old-vs-new price comparison Β· Shareable "AI Bill" cards
[δΈζ](README.md)
---
> **DeepSeek raised prices on 2026-08-17**: v4-flash cache-miss input went Β₯1 β Β₯3, output Β₯2 β Β₯9 (peak tier).
> Which raises the only question anyone actually has: **how much more is my agent costing me now?**
>
> Whale Meter prices the same usage under both the old and new tables side by side, shows what the cache is saving you, which model is burning money β and renders a bill card pretty enough to post.
## Install in 30 seconds
```bash
dsh plugin --profile add dsh-whale-meter
```
Restart `dsh web` β a π³ spend chip appears in the session header. Click it for the full bill.
> From source: `dsh plugin --profile add github:Shiye-10Pages/dsh-whale-meter` (pnpm will ask you to allow the build once; pin a commit for safety).
## What it shows
- **Today / yesterday / month / all-time spend**, estimated from official DeepSeek rates (Β₯ or $)
- **π Price-change comparison**: the same usage under both tables, and the delta, right on the panel. Before 08-17 it previews ("today would cost X at the new rates"), after it looks back ("X at the old rates")
- **β‘ Peak/off-peak tiers**: from 08-17, off-peak is half of peak. Each request is priced by its own timestamp; the chip shows `β‘Β½` off-peak β **note this is not cheaper than before the hike; off-peak still costs more than the old flat rate**
- **Correct across the price change**: rates are organized by effective era, so 08-16 usage bills at old rates and 08-17 at new ones β history is never repriced with one blunt table
- **Cache ledger**: hit rate + "saved by cache Β₯X" β the cache is worth more after the hike, since the hit/miss gap widened too
- **Per-model / per-session bills** β failed retries are billed too, so they are counted too
- **14-day trend**, account balance (with API key), and a **daily budget line**
- **π³ Bill share card**: one click renders a deep-sea style PNG β monthly spend, a fun equivalent ("β 2.3 bottles of iced tea"), cache savings β save or copy and post it
## Configuration (optional)
Works with zero config. To tweak, override in your profile's `cordis.patch.yml`:
```yaml
- update:
- id: whale-meter
config:
currency: USD # or CNY (default)
budgetDaily: 1
apiKey: sk-... # balance lookup only; falls back to DEEPSEEK_API_KEY
prices:
my-model: { hit: 0.5, miss: 4, out: 12 } # per million tokens
```
## How it works & privacy
- Consumes usage records from dsh session logs (`assistant/chunk usage` authoritative, `assistant/message.usage` fallback, deduplicated per the official accounting rules), appended to `~/.dsh/whale-meter/usage-YYYY-MM.jsonl`
- **Raw tokens only, never baked-in prices** β pricing table updates retroactively reprice your history
- **Everything stays on your machine.** No telemetry. The only outbound request is the optional balance lookup against DeepSeek's official endpoint
- A meter must never sink the ship: the collector is fully defensive and degrades silently instead of disturbing your agent
## FAQ
**Will the numbers match my platform bill exactly?** They're estimates from official rates per-request; usually very close. The [platform bill](https://platform.deepseek.com) is authoritative. Pricing lives in one file (`src/pricing.data.ts`, versioned `2026-08-14`) β PRs welcome when rates change.
**Third-party models?** Tokens are always counted; unknown models are marked *unpriced* instead of guessing β add your own rates via `prices`.
**TUI / headless?** Collection is host-side; `curl http://127.0.0.1:3080/whale-meter/api/summary` works anywhere. A standalone TUI view is on the roadmap.
## Roadmap
Backfill of pre-install sessions Β· monthly report export Β· off-peak scheduling hints Β· built-in rates for more providers Β· TUI view
## Disclaimer
Community plugin, not affiliated with DeepSeek. dsh is a developer preview; when upstream breaks things, this plugin follows up fast (file an issue to nudge).
**If it helps, a β means a lot to an indie dev shipping at 2am.**
## License
[MIT](LICENSE) Β© 2026 shiye (ει‘΅)