deepseek-v4-pro Chat Completions
Invoke DeepSeek chat completions capability.
Supported models include deepseek-v4-pro.
Documented fields: model, messages, thinking, stream, stream_options.include_usage, max_tokens, stop, reasoning_effort, response_format, temperature, top_p, logprobs, top_logprobs, tools, tool_choice, user_id. messages[].content supports text content (string); assistant messages support reasoning_content and tool_calls.
Authorizations
Body
DeepSeek chat completions request body.
A list of messages comprising the conversation so far.
1A single message in the conversation. Depending on the role, it is divided into four message types: system, user, assistant, and tool.
- System message
- User message
- Assistant message
- Tool message
Controls the reasoning effort of the model. For normal requests, the default is high. For some complex agent-style requests (e.g. Claude Code, OpenCode), it is automatically set to max. For compatibility, low and medium are mapped to high, and xhigh is mapped to max.
high, max An object specifying the format that the model must output. Setting to { "type": "json_object" } enables JSON Output, which guarantees the message the model generates is valid JSON.
Important: When using JSON Output, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
An alternative to sampling with temperature, the model considers the results of the tokens with top_p probability. The value range is 0.1 ≤ top_p ≤ 1. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.
0.1 <= x <= 1Controls the model's tool calling behavior. none means the model will not call any tool and instead generates a message. auto means the model can choose to generate a message or call one or more tools. required means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
none, auto, required Your custom user_id, with the character set [a-zA-Z0-9-_] and a maximum length of 512. Do not include private user information in user_id. user_id can be used to distinguish user identities on your side to help us with content safety review. user_id can be used for KVCache isolation for privacy management. user_id can be used for scheduling isolation of users on your business side.
Response
Success. Returns JSON in non-streaming mode; returns an SSE event stream in streaming mode.
DeepSeek chat completions success response.