the CLI learns the API it talks to
DeepSeek's own documentation now ships inside the binary, and the two numbers this tool exists to report are measured rather than repeated.
docs — the API, explaining itself
Every page of api-docs.deepseek.com plus the FAQ. 67 pages in about 85KB, answering offline.
ds docs search "context cache"
ds docs ask "when must I send reasoning_content back?"
ds docs changelog # what DeepSeek shipped, newest first
ds docs sync # refresh from the mirrorThe FAQ is not on the docs site at all — it lives at static.deepseek.com as an mdast blob inside a content-hashed JavaScript chunk, so it covers things api-docs never mentions: invoices, refunds, leaked keys, rate-limit increases.
ask selects pages locally, sends them whole, and requires the answer to cite the page — so every claim traces to a URL rather than to what a model remembers about an API that changes monthly. It is also the honest demo of the cost accounting: the same pages lead every request, so a follow-up question hits the context cache and the usage line shows it.
$ ds docs ask "when must I send reasoning_content back?"
Send reasoning_content back only when the model performed a tool call during
that turn. In that case it must be passed back in all subsequent turns, or the
API returns a 400 error (guides/thinking_mode).
answered from guides/thinking_mode, api/create-chat-completion · docs built in, fetched today
· flash · 5.3k in (39% cached) · 116 out · ~$0.000778 · 2.2stokens — exact counts, not estimates
DeepSeek publishes no count-tokens endpoint and no Go tokenizer. But the FIM endpoint takes a raw prompt with no chat template around it and reports prompt_tokens for exactly the bytes sent, plus one BOS token — verified constant from 1 character to 1,800. Subtract the one and the count is exact for the tokenizer that will bill you.
ds tokens --file main.go --file main_test.go
git diff | ds tokens
ds tokens --offline --file huge.log # free local estimate, labelled an upper boundMeasuring is a real, billed request, and the cost prints every time.
chat --interactive
A prompt for follow-ups instead of retyping --continue. Built on the session machinery, so leaving loses nothing — ds chat -c resumes it and ds session show last reads it. ^C abandons an answer and keeps the conversation.
status
Is the API up, with this key, from here. Two calls that generate no tokens, so it costs nothing and is safe in a loop. DeepSeek's incident page is linked rather than scraped.
A correction
This project previously published that thinking costs a flat 79 input tokens. That is only true for flash at the default effort. Re-measured at two prompt lengths, twice each — the surcharge is exactly constant across prompt length, but not across effort:
--effort |
flash | pro |
|---|---|---|
none |
+0 · thinking off | +0 · thinking off |
minimal, low |
+0 | +0 |
medium, high, xhigh |
+79 | +0 |
max |
+92 | +79 |
So --effort low on flash removes the entire input surcharge and the model still reasons. none and minimal are accepted by the API and documented nowhere; none disables thinking exactly as --think off does.
Also fixed: a tool declaring strict: true was being sent to the stable path, where the server ignores it and the JSON Schema guarantee silently does not hold. It now routes to /beta, like a prefix does. --user-id, tool counts and tool names are validated against the API's documented rules before a request is spent learning them.
The docs site gains a theme toggle, following the system by default.
174 tests, 69% covered.
curl -sL https://raw.githubusercontent.com/thevibeworks/deepseek-cli/main/install.sh | sh
go install github.com/thevibeworks/deepseek-cli/cmd/deepseek@v0.3.0