>thevibeworks/deepseek-cli

Cost

DeepSeek's headline feature is a disk-backed context cache that makes a repeated prompt prefix roughly fifty times cheaper. That saving is invisible unless something is counting — so this counts.

The rate card

USD per 1M tokens, as published on 2026-08-02:

ModelInput (cached)Input (miss)Output
deepseek-v4-flash$0.0028$0.14$0.28
deepseek-v4-pro$0.003625$0.435$0.87

ds models prints this next to the live model list, so the price is on screen when you pick.

What the cache is worth

On flash, a cache hit costs 1/50th of a miss. The same 3,200-token prompt, sent twice:

measured, not illustrative
$ ds chat "..." --system @prefix.txt
one
· flash · 3.2k in · 1 out · ~$0.000450 · 0.84s

$ ds chat "..." --system @prefix.txt
two
· flash · 3.2k in (100% cached) · 1 out · ~$0.000011 · 1.04s

A 40× drop, for changing nothing but sending the same prefix again. 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.

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.

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

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-08-05T05:18:12Z","api":"chat","model":"deepseek-v4-flash",
 "in":3242,"cache_hit":3200,"cache_miss":42,"out":1,
 "cost_usd":0.0000109,"saved_usd":0.000439,"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-v4-flash  184    2.1M   78%     94k    $0.19
deepseek-v4-pro    12     88k    41%     11k    $0.03
total              196    2.2M   77%     105k   $0.22

by format: chat 170, anthropic 14, responses 8, fim 4
context cache saved ~$0.23 (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.
  • Peak pricing is not applied. DeepSeek has announced a 2× multiplier for 09:00–12:00 and 14:00–18:00 Beijing time, with no effective date. Applying it now would double every estimate on a guess, so it is deliberately left out until the date is announced.
  • A broader repricing is coming. On 2026-08-06 DeepSeek gave notice in the platform console that all API services will be repriced soon, with a substantial rise expected and no numbers yet. Until there is a new published card, estimates stay on the card above — details on the news page.
  • 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.