You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Off-peak (17h/day): the list rates currently in src/pricing.ts.
Peak = 2x, Mon-Fri 01:00-04:00 and 06:00-10:00 UTC.
Weekends are entirely off-peak, regardless of hour.
src/pricing.ts hardcodes the off-peak numbers (its own comment says so) and calculateCommandCodeCost has no access to the request timestamp, so every
peak call is billed at half its real cost in local usage.cost.
model
off-peak in/out (cached)
peak in/out (cached)
deepseek/deepseek-v4-pro
$0.66 / $1.98 / $0.022
$1.32 / $3.96 / $0.044
deepseek/deepseek-v4-flash
$0.22 / $0.66 / $0.007
$0.44 / $1.32 / $0.014
deepseek/deepseek-v4-flash-vision-exp
$0.22 / $0.66 / $0.007
$0.44 / $1.32 / $0.014
(cache-read peak derived as the same 2x ratio; input/output are documented.)
Evidence
Across 99 consecutive deepseek/deepseek-v4-flash calls recorded in ~/.pi/agent/usage.jsonl, every one landed inside a peak window
(03:13-03:24 UTC on a Thursday) and every recorded usage.cost matched the off-peak rate to within 1e-9. Repricing with the peak multiplier gives
exactly 2.00x ($0.1495 provider-reported -> $0.2991), which is what the
usage page bills.
Suggested fix
Make the rate lookup time-aware for the DeepSeek V4 family, e.g. extend CommandCodeModelCost with optional peak windows (or a rateFor(model, at)
helper in pricing.ts) and call it from calculateCommandCodeCost using Date.now(). The existing tiers mechanism is context-length based, so it
does not cover this.
A cheaper stop-gap: document that DeepSeek V4 local cost is off-peak-only, but
that still silently under-reports 7 hours a day.
Thanks for the thorough analysis! Version 0.7.0 updates the base rates, but it does not add time-aware peak pricing, so this issue remains open. The displayed costs currently use the documented off-peak rates.
If you’d like to contribute a fix, a focused PR would be very welcome. This could be a good task to work through with an AI coding assistant: start with deterministic tests for the UTC window boundaries and weekends, then wire the rate selection into the relevant cost-calculation paths.
Please use the current official rates, as some have changed since this report, and cover both Pi and OMP behavior where applicable. Your existing investigation is a great starting point!
Activity
ThomasByr commentedon Sep 10, 2026
It is already documented: https://github.com/patlux/pi-commandcode-provider#pricing-display
patlux commentedon Sep 15, 2026
Thanks for the thorough analysis! Version 0.7.0 updates the base rates, but it does not add time-aware peak pricing, so this issue remains open. The displayed costs currently use the documented off-peak rates.
If you’d like to contribute a fix, a focused PR would be very welcome. This could be a good task to work through with an AI coding assistant: start with deterministic tests for the UTC window boundaries and weekends, then wire the rate selection into the relevant cost-calculation paths.
Please use the current official rates, as some have changed since this report, and cover both Pi and OMP behavior where applicable. Your existing investigation is a great starting point!