>thevibeworks/deepseek-cli

Cost

DeepSeek's headline feature is a disk-backed context cache that makes a repeated prompt prefix thirty to fifty times cheaper. Since 2026-08-16 a second lever sits on top of it: the hour of the day, worth 2×. Neither is visible unless something is counting – so this counts.

The rate card

USD per 1M tokens. Peak hours are 01:00–04:00 and 06:00–10:00 UTC, Monday to Friday; every other hour, and the whole weekend, is off-peak at half the peak rate. The pricing page carries the full schedule and names the period you are in right now:

ModelPeriodInput (cached)Input (miss)Output
deepseek-flashoff-peak$0.003$0.15$0.60
peak$0.006$0.30$1.20
deepseek-v4-prooff-peak$0.022$0.66$1.98
peak$0.044$1.32$3.96

The retired names deepseek-v4-flash and deepseek-v4-flash-vision-exp still work: V4.1 Flash serves them, at the deepseek-flash price. ds models prints the card in force next to the live model list, so the price is on screen when you pick, and ds pricing prints the full schedule with the period you are in right now.

What the cache is worth

On flash, a cache hit costs 1/50th of a miss per token; on pro, 1/30th. The same 2,900-token prompt, sent twice, on the V4 flash card of the day, where the ratio was 1/31st:

measured 2026-08-17, off-peak
$ ds chat "..." --system @prefix.txt
one
· flash · 2.9k in · 1 out · ~$0.000642 · 580ms

$ ds chat "..." --system @prefix.txt
two
· flash · 2.9k in (97% cached) · 1 out · ~$0.000043 · 630ms

A 15× drop on the whole call, for changing nothing but sending the same prefix again. It is 15× and not 31× because the 3% that changed – the tail of the prompt, and the question itself – still bills at the miss rate: the realised saving is always the rate ratio times how much of the prompt you kept identical. On today's flash card the same call drops about 20×. Hence the practical rule: put the stable part of a prompt first – same system prompt, same files, in the same order – and let the variable part come last.

a trap worth knowing

ds tokens counts by sending the text to the FIM endpoint, so it warms the cache: measure the cache with two chat calls, or the first one is already a hit.

The thinking surcharge

Thinking mode is on by default and adds a fixed template to your input before generating a single reasoning token. The size of that template is constant regardless of prompt length – but it is not the same at every effort level, and at the low levels it is not there at all while the model still reasons.

measured against the live API, 2026-08-05

Two prompts, 10 and 36 tokens, every level run twice. The surcharge is exactly constant: 89−10 = 115−36 = 79.

--effortV4 flashprothinking
none+0+0off entirely
minimal, low+0+0on
medium, high, xhigh+79+0on
max+92+79on

The flash column is V4 Flash, which was retired on 2026-09-10. deepseek-flash, and the retired names that now route to it, have not been re-measured: a single probe on 2026-09-18 read +26 at high, not +79. Treat the column as history until the table is re-run.

Two of those levels are in no DeepSeek documentation at all. none is documented only for the Responses API, but the chat endpoint takes it and it disables thinking exactly as --think off does. minimal is undocumented everywhere. The API rejects only genuinely unknown values, with unknown variant, which is how this list was established.

The practical consequence: on flash, --effort low removes the entire input surcharge and keeps the chain of thought. On a short factual lookup at the default effort, that template is most of the bill.

ds tokens "your prompt here"           # what it costs at default effort
ds tokens "your prompt here" -e low    # what it costs without the template

The ledger

Every call prints one line to stderr and appends one row to ~/.local/state/deepseek/usage.jsonl:

{"ts":"2026-09-18T05:18:12Z","api":"chat","model":"deepseek-flash",
 "in":3242,"cache_hit":3200,"cache_miss":42,"out":1,
 "cost_usd":0.0000165,"saved_usd":0.00047,"ms":1041}

Token counts are exact and are what gets stored; the cost field is a convenience. That is deliberate – when DeepSeek changes the rate card, every historical row can be repriced.

ds usage                  # today
ds usage --since 7d
ds usage --since all --json
ds usage --entries        # individual calls
ds usage --since 7d
                 CALLS  IN     CACHED  OUT    COST
deepseek-flash   184    2.1M   78%     94k    $0.13
deepseek-v4-pro  12     88k    41%     11k    $0.06
total            196    2.2M   77%     105k   $0.19

by format: chat 170, anthropic 14, responses 8, fim 4
context cache saved ~$0.26 (1.7M of 2.2M prompt tokens replayed)
costs are estimates from the published USD rate card, not billed amounts

The savings line is the one worth watching. It is what the cached tokens would have cost at the miss rate, minus what they did cost – which is the number that tells you whether prompt structuring is paying off.

What these numbers are not

read this before quoting a figure
  • Estimates, not invoices. Computed from the published USD rate card. Your account may bill in another currency – ds balance shows which.
  • The hour is part of the price. Since 2026-08-16 16:00 UTC a call costs twice as much inside a peak window as outside it, so an estimate that ignores the clock is wrong for seven hours a day. Every call is priced at the card in force at the moment it was made, and the ledger keeps token counts rather than dollars, so history reprices correctly under whichever card was real.
  • The cache discount has moved twice. On the old flat card a cached input token cost 1/50th of a miss on flash and 1/120th on pro; the V4 card of 2026-08-16 settled both at about 1/30th; V4.1 Flash (2026-09-10) put flash back at 1/50th, and pro stayed at 1/30th. Still the biggest lever on a bill.
  • Local only. The ledger records calls made by this CLI on this machine. It knows nothing about your other clients.

--no-ledger skips the write, --no-stats hides the line, and neither ever fails the command that produced it – you asked for a completion, not for bookkeeping.