feat(pricing): weekends bill off-peak, and the vision model is on the card - #23
Merged
Conversation
… card
Two upstream changes, neither of which reached us through a changelog.
WEEKENDS. From 16:00 UTC on 2026-08-22 (00:00 Beijing, Sun 23 Aug) a
Saturday or Sunday bills off-peak for all 24 hours. Peak is 35 hours a
week, not 49, so anything reading the hour alone was reporting peak for
14 hours a week the account was being charged half for.
The weekday is read on the vendor's clock, because that is how DeepSeek
wrote it -- "Saturdays and Sundays, Beijing Time" -- which puts the
turnover at 16:00 UTC, not midnight UTC. With today's windows the UTC and
Beijing readings label all 168 hours identically (both windows close at
10:00 UTC, before the dates diverge), so the tests pin the two instants
that do discriminate; deleting the shift fails exactly one test in each
of the three copies.
Gated on its own instant rather than folded into RepriceAt. Exactly one
weekend day ever billed peak under time-of-use -- Saturday 2026-08-22,
since Sunday 08-16's windows had passed before the switchover -- and a
ledger that refunds it is inventing money.
DeepSeek published no changelog entry. The announcement sat in the
pricing-page footnote for a few days and the live page now carries only
the settled rule, so the citable source is the archived copy, recorded
next to the constant in all three places that hold it.
VISION. deepseek-v4-flash-vision-exp shipped 2026-08-21, priced exactly
as flash in both currencies, and was absent from the card -- which meters
it at zero. Added, along with a single deepseek.Models list so the next
model reaches every table at once rather than three of them.
Landing in three copies, because the gateway is a separate module and the
site is generated:
- internal/deepseek the CLI's card and clock
- gateway/…/meter its own copy; `make price-check` guards the numbers,
and it now has tests guarding the clock too. Its drift
ran the safe way (over-charging our own budget) but it
still made /economics report a cost nobody paid.
- site/build.py the schedule gained a `days` axis; pricing.js reads it,
pricing.test.js pins it. Editing the generated HTML is
what `site-check` exists to catch, and it caught me.
Also: the embedded docs corpus is repacked from the mirror, so `ds docs
show quick_start/pricing` carries the Monday-through-Friday footnote and
the third pricing column; two news entries; llms.txt.
Verified: `make check` green, and the pricing page rendered headless on a
faked Beijing Saturday reads off-peak with the next peak 46h59m out --
the same answer dsh-meter gives.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two upstream changes since 2026-08-17, neither of which reached us through a changelog.
Weekends are off-peak
From 16:00 UTC on 2026-08-22 (00:00 Beijing, Sun 23 Aug), a Saturday or Sunday bills off-peak for all 24 hours. Peak is 35 hours a week, not 49 — so anything reading the hour alone reports peak for 14 hours a week the account is charged half for.
DeepSeek published no changelog entry. The announcement sat in the pricing-page footnote for a few days before it took effect, and the live page now carries only the settled rule, so it exists nowhere on api-docs.deepseek.com today. The citable source is the archived copy, recorded next to the constant in all three places that hold it:
The weekday is read on the vendor's clock, because that last parenthesis is the rule as written — which puts the turnover at 16:00 UTC, not midnight UTC. A Friday evening in Europe is already Saturday upstream.
That choice is untestable by ordinary means and worth being explicit about. Both windows close at 10:00 UTC, well before the 16:00 UTC point where a UTC date and a Beijing date diverge, so the two readings label all 168 hours of the week identically and any test written against the published windows passes with the shift deleted. The tests therefore pin the instants that do discriminate. Verified by mutation, per copy:
internal/deepseekinternal/deepseekgateway/…/metersite/pricing.jsBEIJING_OFFSET_MS = 0onDayvectorsEach dies to a targeted test and nothing else, which is the point: without those vectors every mutant passes the whole suite.
The boundary is kept, not backdated
Gated on its own instant rather than folded into
RepriceAt. Working it through, exactly one weekend day ever billed peak under time-of-use:A ledger that refunds that Saturday is inventing money the account never got back.
TestWeekendRuleDoesNotRepriceHistorypins all three rows.The vision model was metering at zero
deepseek-v4-flash-vision-expshipped 2026-08-21, priced exactly as flash on every bucket in both currencies, and was absent from the card — so a call to it cost nothing, in the CLI's estimates and in the gateway's budget.Added, plus a single
deepseek.Modelslist, because it was missing from three separate hardcoded[]string{ModelFlash, ModelPro}iterations. The next model reaches every table at once.It lands in three copies, on purpose
internal/deepseekgateway/…/metermake price-checkguarded the numbers; nothing guarded the clock, so it now has tests that dosite/build.pydaysaxis;pricing.jsreads it,pricing.test.jspins itThe gateway's drift ran the safe direction — over-charging our own budget rather than under — but it still made
/economicsreport a cost-per-task nobody paid.One process note worth keeping: I first edited the generated
site/pricing/index.htmldirectly.make site-checkcaught it and I redid the work inbuild.py. That check earned its keep.Also in here
ds docs show quick_start/pricingcarries the Monday-through-Friday footnote and the third pricing column offline. 75 pages.site/llms.txtand the FAQ/OG metadata, which all still described a daily schedule and a two-model API.Verified
make check— green end to end: fmt, vet,go test ./..., corpus-check, price-check (5 matching rate-card rows across both modules), build, gateway-check, site-check, bans.ds pricingprints the vision row andpeak hours … Mon-Fri; all other hours, and all weekend, off-peak.🤖 Generated with Claude Code