>thevibeworks/deepseek-cli

Four wire formats

DeepSeek exposes the same two models – deepseek-flash and deepseek-v4-pro – through four different request shapes, so that existing ecosystems can point at it without code changes. They are not interchangeable.

Which one to use

FormatPathReach for it when
OpenAI chat
ds chat
/chat/completionsDefault. Widest tool support, and the only format with chat prefix completion.
Anthropic Messages
ds anthropic
/anthropic/v1/messagesThe surrounding tooling speaks Anthropic – Claude Code, the Anthropic SDKs, the Claude desktop app.
OpenAI Responses
ds respond
/responsesYou need JSON Schema output. Also what Codex speaks. (Its server-side web search was removed upstream on 2026-09-10.)
FIM
ds fim
/beta/completionsFill-in-the-middle code completion. No chat structure at all.

What actually differs

chatanthropicrespondfim
Auth headerBearerx-api-keyBearerBearer
max_tokensoptionalrequiredoptionaloptional
Thinking togglethinking.typethinking.typereasoning.effort: nonenever thinks
Effort controlreasoning_effortoutput_config.effortreasoning.effort
JSON Schema outputyes
Server-side web searchremoved 2026-09-10
Prefix completionyes (beta path)
Modelsbothbothbothboth
Stream terminatordata: [DONE]message_stopresponse.completeddata: [DONE]

The token-accounting trap

This is the one that silently corrupts cost tracking, and it is not stated in the published docs. The formats disagree about what input_tokens means.

verified against the live API

The same prompt, sent both ways. /chat/completions reported prompt_tokens: 289. /anthropic/v1/messages reported input_tokens: 33 with cache_read_input_tokens: 256.

33 + 256 = 289. On the Anthropic endpoint, input_tokens excludes cache reads. On the OpenAI chat and Responses endpoints, the input count includes them.

FormatFull prompt isCached portion
chatprompt_tokensprompt_cache_hit_tokens
anthropicinput_tokens + cache_read_input_tokenscache_read_input_tokens
respondinput_tokensinput_tokens_details.cached_tokens

Get it backwards and a heavily-cached Anthropic call looks 8× cheaper than it was. deepseek-cli normalises all three into one shape before pricing anything, and pins the difference in tests using those exact numbers.

Claude model names

The Anthropic endpoint accepts Claude model names and remaps them server-side, which is what lets tools with hard-coded model lists work:

You sendYou get
claude-opus-*deepseek-v4-pro
claude-sonnet-*, claude-haiku-*deepseek-flash
anything unrecogniseddeepseek-flash

Because billing follows the model that actually ran, the usage line prints both names:

$ ds anthropic "hello" --model claude-opus-4-1
· claude-opus-4-1→pro · 10 in · 8 out · ~$0.000011 · 0.9s

The reasoning round-trip

In thinking mode the chain of thought comes back alongside the answer. What you do with it on the next turn is not optional:

Sessions in this CLI keep the reasoning stored either way, and decide per request whether to put it on the wire.

Shared limits