DeepSeek Commands & Prompt Reference

46 commands & parameters · 6 categories · Sources: DeepSeek API Docs — Chat Completions API (POST /chat/completions), reference as of the 2026-09-10 change log and 9 more · Checked

Parameters, model IDs and endpoints of the DeepSeek API as documented on api-docs.deepseek.com, checked against its 2026-09-10 change log: deepseek-flash (DeepSeek-V4.1-Flash) and deepseek-v4-pro. The older IDs deepseek-chat and deepseek-reasoner were discontinued on 2026-07-24. Covered: the OpenAI-format chat call, thinking controls, beta features and core Responses API fields; response objects, pricing and Anthropic-format options are left out. Thinking is on by default, and temperature has no effect while it is.

All Commands

Models and endpoints (11)

Command / SyntaxWhat it doesNotes
deepseek-flashFlash model IDCalls DeepSeek-V4.1-Flash, released 2026-09-10; the older deepseek-v4-flash names are still routed to it.
deepseek-v4-proPro model IDLarger model, served as DeepSeek-V4-Pro-0813; the pricing table lists no vision input for it.
https://api.deepseek.comOpenAI-format base URLSet as base_url in an OpenAI SDK or tool; the model field then picks flash or pro.
https://api.deepseek.com/anthropicAnthropic-format base URLLets Anthropic SDKs and clients reach both models, which the pricing table marks as Anthropic API capable.
https://api.deepseek.com/betaBeta base URLBeta calls such as FIM completion only work when the client points here instead of the plain base URL.
POST /chat/completionsChat completion endpointMain OpenAI-format call: send a messages list, optionally streamed back as server-sent events.
POST /responsesResponses API endpointStateless: nothing is stored server-side, so every request resends the whole conversation in input.
POST /completionsFIM completion endpointBeta fill-in-the-middle call that takes prompt and suffix rather than a messages list.
GET /modelsList available modelsEach entry carries metadata such as context window, output limit and the effort levels it accepts.
GET /user/balanceCheck account balanceReports is_available plus total, granted and topped-up amounts for each currency held.
POST /filesUpload an imageStores a JPEG, PNG, GIF or WebP image and returns a file_id for later chat requests.

Chat completion parameters (16)

Command / SyntaxWhat it doesNotes
modelModel to callRequired on every request; the two accepted values are the flash and pro model IDs.
messagesConversation historyRequired array with at least one system, user, assistant or tool message.
max_tokensOutput token limitAccepts 1 to 384K; defaults to 8K without thinking, 64K with thinking and 128K at max effort.
response_formatOutput format switchSet its type to json_object for JSON Output, and ask for JSON in the prompt as well.
stopStop sequencesOne string or a list of up to 16; generation halts as soon as one of them appears.
streamStream the replySends partial deltas as server-sent events and closes with a data: [DONE] line.
stream_optionsStreaming optionsOnly valid with stream set to true, else 400; include_usage adds a usage field that stays null until the final chunk.
temperatureSampling temperatureRanges 0 to 2, default 1, and is ignored in thinking mode, so it matters only with thinking off.
top_pNucleus sampling cutoffWorks only in thinking mode, where anything under 0.95 is raised to 0.95; non-thinking calls fix it at 1.0.
toolsCallable functionsFunction tools only, each with a unique name; the model replies with JSON arguments for the one it picks.
tool_choiceTool selection modenone, auto, required or one named function; required and named choices return 400 while thinking is on.
logprobsReturn token log probabilitiesBoolean; when true, each output token in the message content comes back with its log probability.
top_logprobsAlternatives per positionInteger from 0 to 20 for how many likely tokens to list at each position; needs logprobs set to true.
user_idEnd-user identifierOptional tag of up to 512 letters, digits, hyphens or underscores; keep personal data out of it.
frequency_penaltyDeprecated repetition penaltyMarked deprecated in the reference; a value you send is simply ignored.
presence_penaltyDeprecated topic penaltyAlso deprecated, so setting it leaves the reply unchanged, just like frequency_penalty.

Thinking mode (4)

Command / SyntaxWhat it doesNotes
thinkingThinking mode switchObject whose type is enabled or disabled; thinking is on by default.
reasoning_effortThinking effort levelnone turns thinking off, while low, high or max set its depth; high is the default.
reasoning_contentChain-of-thought outputSend it back in later turns only when the request carries tools; otherwise the API drops it.
extra_body={"thinking": {"type": "enabled"}}Thinking switch in the OpenAI SDKWith the OpenAI Python SDK the thinking object has to travel inside extra_body, not as a named argument.

Message fields (4)

Command / SyntaxWhat it doesNotes
nameParticipant nameOptional label that tells apart several speakers sharing one role.
tool_call_idTool result linkRequired on tool messages; it carries the ID of the call this result answers.
image_urlImage input partTakes an http(s) link or a base64 data URL in JPEG, PNG, GIF or WebP format.
file_idUploaded file referencePoints a file content part at an image already stored with the Files API; cannot be combined with file_data.

Beta features and JSON output (6)

Command / SyntaxWhat it doesNotes
prefixChat prefix completionSet true on the final assistant message so the reply continues from its text; beta base URL only.
promptFIM leading textRequired on the FIM call; holds the code or text that comes before the gap.
suffixFIM trailing textOptional text after the gap; the model writes the middle, with FIM output capped at 4K tokens.
echoRepeat the promptFIM option that returns the prompt together with the generated text; not allowed with suffix or logprobs.
strictStrict tool schema modeBeta flag on each function that makes tool-call arguments follow its JSON schema exactly.
{ "type": "json_object" }JSON Output valueGoes in response_format; with no JSON request in the prompt the model may emit whitespace until max_tokens.

Responses API parameters (5)

Command / SyntaxWhat it doesNotes
inputRequest inputA plain string counts as one user message; a list can mix messages, function calls and their outputs.
instructionsSystem instructionPlaced ahead of the conversation as its opening system message on that request.
reasoningThinking configurationIts effort field takes none, low, high or max; none switches thinking off for the request.
max_output_tokensOutput token capThe cap covers both the visible answer and any reasoning tokens produced in thinking mode.
textOutput format settingstext.format selects plain text, JSON mode, or json_schema output that must match a schema you supply.

Recipes

DeepSeek calls assembled from the parameters listed above, each with the base URL or field it depends on: prefix completion, fill-in-the-middle, visible reasoning and JSON Output.

Make the reply open with your own text

https://api.deepseek.com/beta → prefix

Switch the client to the beta base URL. Make the final message an assistant turn containing the start of the answer and mark it with prefix set to true: the reply continues from there. The vendor example adds a stop sequence so nothing follows the closing code fence.

Fill in code between two fixed points

POST /completions → prompt, suffix

FIM completion is a beta call on the beta base URL: the code before the gap goes in prompt, the code after it in suffix, and the model writes the middle. Output is capped at 4K tokens, and the pricing table lists FIM for non-thinking mode only.

Read the reasoning as well as the answer

reasoning_effort → reasoning_content

Thinking is on by default, and the chain of thought arrives in reasoning_content next to content, so it can be logged without showing it to users. In a plain multi-turn chat the API ignores reasoning_content sent back; once a request carries tools, every earlier reasoning_content must be returned or the call fails with a 400 error.

Get reliable JSON out

response_format → { "type": "json_object" }

JSON Output also needs the word json and an example of the wanted shape in the system or user prompt; without that instruction the model can stream whitespace until it reaches the token limit. Leave max_tokens high enough that the object is not cut off.

Frequently Asked Questions

What happened to deepseek-chat and deepseek-reasoner?

The change log of 2026-04-24 set their retirement for 2026-07-24; until then they pointed to the non-thinking and thinking modes of deepseek-v4-flash. Requests now name deepseek-flash or deepseek-v4-pro and switch thinking with thinking or reasoning_effort.

Why does temperature change nothing in my requests?

Thinking mode is on by default and ignores temperature; top_p only applies in thinking mode, between 0.95 and 1.0. Turn thinking off (thinking type disabled, or reasoning_effort none) to sample with temperature.

How is JSON Output switched on?

Set response_format to { "type": "json_object" } and ask for JSON in the system or user prompt, ideally with an example of the shape; without that instruction the reply can come back empty or stall on whitespace.

What does the beta base URL enable?

https://api.deepseek.com/beta is required for chat prefix completion (prefix on the last assistant message), FIM completion on POST /completions and strict tool calls (strict on each function).

Sources and checks

Every row on this page was matched to a line in the documentation above on . A command or parameter that could not be found there is not listed.

2 rows from the earlier version of this page were removed in that check: duplicates, and entries the documentation does not list or lists differently.

AI tools change their commands, parameters and model names between releases: the vendor's current documentation and the version you run have the last word. Found a wrong or missing entry? Tell us and it gets checked against the source. How we verify describes the process and its limits.

Related prompt references

GLM (Z.ai) (58) · Kimi (Moonshot AI) (40) · MiniMax (Hailuo) (72) · All AI prompt references