DeepSeek Commands & Prompt Reference

22 commands & parameters · 2 categories · Source: DeepSeek API Docs

DeepSeek's chat models are driven through a compact, OpenAI-compatible API surface: a handful of JSON body fields control sampling, streaming, tool use, and output format, and a pair of model IDs switch between the general chat model and the reasoning model that returns its chain of thought in reasoning_content. This page lists the chat completion parameters and the model and beta-feature tokens from the official API documentation.

The beta base URL unlocks two prompt-level features worth knowing: chat prefix completion forces the reply to continue from a prefix you supply, and fill-in-the-middle completion takes a prompt plus a suffix and generates what belongs between them. JSON mode is switched on through response_format, but the docs are explicit that the prompt itself must also ask for JSON.

All Commands

Chat API Parameters (16)

Command / SyntaxWhat it doesNotes
modelThe model used for the chat completionThis fingerprint represents the backend configuration that the model runs with.
messagesA list of messages comprising the conversation so farJSON body field of POST /chat/completions.
temperatureWhat sampling temperature to use, between 0 and 2Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
top_pAn alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the...So 0.1 means only the tokens comprising the top 10% probability mass are consid
max_tokensThe maximum number of tokens that can be generated in the chat completionThe total length of input tokens and generated tokens is limited by the model's context length.
frequency_penaltyThis parameter is no longer supportedIt will not take effect if you pass it to the API.
presence_penaltyThis parameter is no longer supportedIt will not take effect if you pass it to the API.
stopUp to 16 sequences where the API will stop generating further tokensJSON body field of POST /chat/completions.
streamIf set, partial message deltas will be sentTokens will be sent as data-only server-sent events (SSE) as they become available, with the stream terminated by a
stream_optionsOptions for streaming responseOnly set this when you set If set, an additional chunk will be streamed before the field on this chunk shows the token usage statistics for the...
response_formatAn object specifying the format that the model must outputSetting to { "type": "json_object" } enables JSON Output, which guarantees the message the model generates is valid JSON.
toolsA list of tools the model may callCurrently, only functions are supported as a tool.
tool_choiceControls which (if any) tool is called by the modelmeans the model will not call any tool and instead generates a message.
logprobsWhether to return log probabilities of the output tokens or notIf true, returns the log probabilities of each output token returned in the
top_logprobsAn integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with...JSON body field of POST /chat/completions.
thinkingControls the switch between thinking and non-thinking modeJSON body field of POST /chat/completions.

Models & Beta Feature Tokens (6)

Command / SyntaxWhat it doesNotes
deepseek-chatModel ID for the general chat modelSet as the model field value.
deepseek-reasonerModel ID for the reasoning model; responses include reasoning_contentSet as the model field value. Chain-of-thought is returned in reasoning_content.
https://api.deepseek.com/betaBase URL that enables beta featuresRequired for chat prefix completion and FIM completion.
prefixChat prefix completion: force the assistant reply to continue from a given prefix (beta)Set prefix: true on the last assistant message, with the beta base URL.
suffixFIM completion: text after the insertion point (beta)Fill-in-the-middle on POST /beta/completions, together with prompt.
{"type": "json_object"}response_format value that switches on JSON modeAlso instruct the model to produce JSON in the prompt, or output may be empty.

Frequently Asked Questions

What is the difference between deepseek-chat and deepseek-reasoner?

deepseek-chat is the general conversation model. deepseek-reasoner performs explicit reasoning first and returns it in a separate reasoning_content field alongside the final answer.

How do I enable JSON mode?

Set response_format to {"type": "json_object"} and also instruct the model in the prompt to produce JSON - the documentation warns output may be empty otherwise.

What does the beta base URL enable?

https://api.deepseek.com/beta unlocks chat prefix completion (prefix: true on the last assistant message) and FIM completion (prompt plus suffix on the completions endpoint).

Every entry on this page is a literal, typeable token taken from the official documentation linked above. Command sets in AI tools change quickly - the in-product command menu is always authoritative for your installed version.