>thevibeworks/deepseek-cli

> deepseek-cli

DeepSeek serves the same two models through four different wire formats. Every other client picks one. This speaks all four – from one binary, with the multi-turn bookkeeping kept straight and a running tally of what each call cost.

Latest release API coverage: 6 of 6 endpoints 302 tests, 70 percent covered Built against the DeepSeek API docs of 2026-08-05 Models: deepseek-flash and deepseek-v4-pro

~/work
$ ds chat "explain this diff" --file changes.patch
The patch swaps the retry loop for exponential backoff, and stops
retrying 4xx responses – those would fail identically on a second try.
· flash · 3.2k in (87% cached) · 412 out (180 think) · ~$0.000178 · 2.1s

You do not need an API key to start

Most tools open with "get an API key". This one opens with an answer.

~/work
$ deepseek free
The free tier relays your prompts to DeepSeek through a gateway run by
this project. No account, no API key.

  gateway   https://freeseek.1lm.io
  model     deepseek-flash
  per day   30 requests · 60k input · 20k output tokens
  privacy   prompts are relayed, not stored; only token counts are recorded

Minting an anonymous token (20 bits of proof-of-work)…
  solved 20 bits in 0.4s (1.0M hashes)

Enrolled.

$ deepseek chat "why is the sky blue"
Sunlight is scattered by the atmosphere, and shorter wavelengths scatter
far more – Rayleigh scattering.
· flash · 93 in · 46 out (7 think) · ~$0.000026 · 1.56s

About a second of CPU stands in for the signup – a proof-of-work puzzle, which is the whole enrolment. No email, no card, no dashboard. There is a browser playground on the same free tier that shows you the equivalent command for whatever you set up in it.

A real API key always takes precedence, so this is a fallback for not having one rather than a way around having one. The gateway is in the repository and meant to be self-hostable; its design notes include the part most services leave out – why per-user quota is not what keeps it solvent, and what is.

Why this exists

Wrapping six HTTP endpoints is not interesting on its own. Two things are, and they are the reason this is not a shell function around curl.

Quick start

curl -sL https://github.com/thevibeworks/deepseek-cli/raw/main/install.sh | sh

export DEEPSEEK_API_KEY=sk-...
ds check                      # is everything reachable?
ds chat "why is the sky blue"

check calls all six endpoints once and reports which answered. It is the first thing to run when something is wrong and you do not yet know whether the problem is the key, the balance, the network, a proxy in between, or one specific endpoint.

ds check
https://api.deepseek.com

ok    GET /models                  141ms  deepseek-flash, deepseek-v4-pro
ok    GET /user/balance            126ms  18.48 CNY
ok    POST /chat/completions       651ms  5 in / 1 out
ok    POST /anthropic/v1/messages  590ms  5 in / 1 out
ok    POST /responses              595ms  5 in / 9 out
ok    POST /beta/completions       379ms  4 in / 1 out

all endpoints reachable

The API, explaining itself

The tool that talks to an API should be able to answer questions about it. This one carries DeepSeek's own documentation – 67 pages, about 85KB compressed – and asks DeepSeek to answer from it.

ds docs ask
$ 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.2s

Pages are selected locally and sent whole, with an instruction to answer only from them. The same pages lead every request, so the second question about an area hits the context cache – which is the cost feature on this site demonstrating itself. Search, read and the change log cost nothing and need no network:

ds docs search "context cache"
ds docs show guides/kv_cache
ds docs changelog              # what DeepSeek shipped, newest first
ds docs sync                   # refresh the snapshot

The commands

One per endpoint, named for what it does rather than for its path. Full reference on the commands page.

CommandEndpointWhat it is for
chatPOST /chat/completionsThe default. OpenAI format, the one most tools speak.
anthropicPOST /anthropic/v1/messagesWhat Claude Code and the Anthropic SDKs speak.
respondPOST /responsesWhat Codex speaks. JSON Schema output lives only here.
fimPOST /beta/completionsFill in the middle – the shape editors use for inline completion.
modelsGET /modelsAvailable models, joined with the published rate card.
balanceGET /user/balanceWhat is left, per currency.
tokensPOST /beta/completionsExact token counts, from the model's own tokenizer.
docslocalDeepSeek's own documentation, in the binary. Search, read, ask.
usagelocalWhat this CLI has spent, from its own ledger.
pricinglocalThe rate card, the schedule, and the billing period right now.
sessionlocalThe conversations chat --continue replays.
statusGET /models, /user/balanceIs it up, for this key, from here. Costs nothing.
checkall sixPreflight.
rawanythingEscape hatch – any path, with auth and retries.

What it does not do

Worth knowing before you install it: