DeepSeek Commands & Prompt Reference
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 / Syntax | What it does | Notes |
|---|---|---|
| deepseek-flash | Flash model ID | Calls DeepSeek-V4.1-Flash, released 2026-09-10; the older deepseek-v4-flash names are still routed to it. |
| deepseek-v4-pro | Pro model ID | Larger model, served as DeepSeek-V4-Pro-0813; the pricing table lists no vision input for it. |
| https://api.deepseek.com | OpenAI-format base URL | Set as base_url in an OpenAI SDK or tool; the model field then picks flash or pro. |
| https://api.deepseek.com/anthropic | Anthropic-format base URL | Lets Anthropic SDKs and clients reach both models, which the pricing table marks as Anthropic API capable. |
| https://api.deepseek.com/beta | Beta base URL | Beta calls such as FIM completion only work when the client points here instead of the plain base URL. |
| POST /chat/completions | Chat completion endpoint | Main OpenAI-format call: send a messages list, optionally streamed back as server-sent events. |
| POST /responses | Responses API endpoint | Stateless: nothing is stored server-side, so every request resends the whole conversation in input. |
| POST /completions | FIM completion endpoint | Beta fill-in-the-middle call that takes prompt and suffix rather than a messages list. |
| GET /models | List available models | Each entry carries metadata such as context window, output limit and the effort levels it accepts. |
| GET /user/balance | Check account balance | Reports is_available plus total, granted and topped-up amounts for each currency held. |
| POST /files | Upload an image | Stores a JPEG, PNG, GIF or WebP image and returns a file_id for later chat requests. |
Chat completion parameters (16)
| Command / Syntax | What it does | Notes |
|---|---|---|
| model | Model to call | Required on every request; the two accepted values are the flash and pro model IDs. |
| messages | Conversation history | Required array with at least one system, user, assistant or tool message. |
| max_tokens | Output token limit | Accepts 1 to 384K; defaults to 8K without thinking, 64K with thinking and 128K at max effort. |
| response_format | Output format switch | Set its type to json_object for JSON Output, and ask for JSON in the prompt as well. |
| stop | Stop sequences | One string or a list of up to 16; generation halts as soon as one of them appears. |
| stream | Stream the reply | Sends partial deltas as server-sent events and closes with a data: [DONE] line. |
| stream_options | Streaming options | Only valid with stream set to true, else 400; include_usage adds a usage field that stays null until the final chunk. |
| temperature | Sampling temperature | Ranges 0 to 2, default 1, and is ignored in thinking mode, so it matters only with thinking off. |
| top_p | Nucleus sampling cutoff | Works only in thinking mode, where anything under 0.95 is raised to 0.95; non-thinking calls fix it at 1.0. |
| tools | Callable functions | Function tools only, each with a unique name; the model replies with JSON arguments for the one it picks. |
| tool_choice | Tool selection mode | none, auto, required or one named function; required and named choices return 400 while thinking is on. |
| logprobs | Return token log probabilities | Boolean; when true, each output token in the message content comes back with its log probability. |
| top_logprobs | Alternatives per position | Integer from 0 to 20 for how many likely tokens to list at each position; needs logprobs set to true. |
| user_id | End-user identifier | Optional tag of up to 512 letters, digits, hyphens or underscores; keep personal data out of it. |
| frequency_penalty | Deprecated repetition penalty | Marked deprecated in the reference; a value you send is simply ignored. |
| presence_penalty | Deprecated topic penalty | Also deprecated, so setting it leaves the reply unchanged, just like frequency_penalty. |
Thinking mode (4)
| Command / Syntax | What it does | Notes |
|---|---|---|
| thinking | Thinking mode switch | Object whose type is enabled or disabled; thinking is on by default. |
| reasoning_effort | Thinking effort level | none turns thinking off, while low, high or max set its depth; high is the default. |
| reasoning_content | Chain-of-thought output | Send 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 SDK | With the OpenAI Python SDK the thinking object has to travel inside extra_body, not as a named argument. |
Message fields (4)
| Command / Syntax | What it does | Notes |
|---|---|---|
| name | Participant name | Optional label that tells apart several speakers sharing one role. |
| tool_call_id | Tool result link | Required on tool messages; it carries the ID of the call this result answers. |
| image_url | Image input part | Takes an http(s) link or a base64 data URL in JPEG, PNG, GIF or WebP format. |
| file_id | Uploaded file reference | Points 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 / Syntax | What it does | Notes |
|---|---|---|
| prefix | Chat prefix completion | Set true on the final assistant message so the reply continues from its text; beta base URL only. |
| prompt | FIM leading text | Required on the FIM call; holds the code or text that comes before the gap. |
| suffix | FIM trailing text | Optional text after the gap; the model writes the middle, with FIM output capped at 4K tokens. |
| echo | Repeat the prompt | FIM option that returns the prompt together with the generated text; not allowed with suffix or logprobs. |
| strict | Strict tool schema mode | Beta flag on each function that makes tool-call arguments follow its JSON schema exactly. |
| { "type": "json_object" } | JSON Output value | Goes in response_format; with no JSON request in the prompt the model may emit whitespace until max_tokens. |
Responses API parameters (5)
| Command / Syntax | What it does | Notes |
|---|---|---|
| input | Request input | A plain string counts as one user message; a list can mix messages, function calls and their outputs. |
| instructions | System instruction | Placed ahead of the conversation as its opening system message on that request. |
| reasoning | Thinking configuration | Its effort field takes none, low, high or max; none switches thinking off for the request. |
| max_output_tokens | Output token cap | The cap covers both the visible answer and any reasoning tokens produced in thinking mode. |
| text | Output format settings | text.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
- DeepSeek API Docs — Chat Completions API (POST /chat/completions), reference as of the 2026-09-10 change log Chat parameters, message fields, thinking switch, beta flags
- DeepSeek API Docs — Models & Pricing (DeepSeek-V4.1-Flash, DeepSeek-V4-Pro-0813) Model IDs and base URLs
- DeepSeek API Docs — Change Log (latest entry 2026-09-10) Current flash model ID; retirement of deepseek-chat and deepseek-reasoner
- DeepSeek API Docs — Thinking Mode guide Reasoning output and the OpenAI SDK thinking switch
- DeepSeek API Docs — FIM Completion API (Beta), POST /completions FIM endpoint, beta base URL, FIM parameters
- DeepSeek API Docs — FIM Completion (Beta) guide FIM suffix and output limit
- DeepSeek API Docs — Responses API (POST /responses) Responses API endpoint and its own parameters
- DeepSeek API Docs — Lists Models (GET /models) Model list endpoint
- DeepSeek API Docs — Get User Balance (GET /user/balance) Balance endpoint
- DeepSeek API Docs — Upload File (POST /files) File upload endpoint
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