Skip to main content
POST
DeepSeek models handle chat, coding, reasoning, and agent workloads with a 1M-token context window. The playground on this page uses Chat Completions, which every DeepSeek model supports.

Models

  • deepseek-flash — DeepSeek V4.1 Flash. 552B MoE model with native vision and up to 384K output tokens. Supports Chat Completions and Responses.
  • deepseek-v4-pro — DeepSeek V4 Pro. 1.6T total / 49B active parameters, for stronger reasoning, coding, and agent workflows. Chat Completions only.
  • deepseek-v4-flash — DeepSeek V4 Flash. 284B total / 13B active parameters, for fast and low-cost chat. Chat Completions only.

Examples

  • Basic chat completion — deepseek-v4-flash with a single user message.
  • System prompt — deepseek-v4-pro with a system message and max_tokens.
  • Streaming output — deepseek-flash with stream: true, returned as SSE.
To call deepseek-flash with the Responses format, send the same model id to Responses.

Notes

  • deepseek-v4-pro and deepseek-v4-flash only accept /v1/chat/completions.
  • See LLM Models for every model and the formats it supports.

Authorizations

Authorization
string
header
required

All API endpoints require Bearer Token authentication.

Get your API Key:

Visit the API Key Management Page to get your API Key

Add it to the request header:

Body

application/json
model
enum<string>
default:deepseek-v4-flash
required

DeepSeek model id. deepseek-flash is DeepSeek V4.1 Flash.

Available options:
deepseek-flash,
deepseek-v4-pro,
deepseek-v4-flash
messages
object[]
required

List of conversation messages. Each message contains a role and content. Use system to define model behavior, user for user input, and assistant for previous model responses in multi-turn conversations.

temperature
number

Controls output randomness, range 0-2. Lower values such as 0.2 make output more deterministic. Higher values such as 1.8 make output more random. Default: 1.0.

Required range: 0 <= x <= 2
Example:

1

max_tokens
integer

Maximum number of tokens to generate. Different models have different maximum limits.

Required range: x >= 1
Example:

256

stream
boolean

Whether to use streaming output. true returns a streaming response in SSE format. false returns the complete response at once. Default: false.

Example:

false

top_p
number

Nucleus sampling parameter, range 0-1. Controls diversity of generated text. We recommend using either top_p or temperature, not both. Default: 1.0.

Required range: 0 <= x <= 1
Example:

1

frequency_penalty
number

Frequency penalty, range -2.0 to 2.0. Positive values reduce the likelihood of repeating the same words. Default: 0.

Required range: -2 <= x <= 2
Example:

0

presence_penalty
number

Presence penalty, range -2.0 to 2.0. Positive values increase the likelihood of talking about new topics. Default: 0.

Required range: -2 <= x <= 2
Example:

0

stop

Stop sequences. Up to 4 sequences where generation will stop when encountered.

Example:

"\n\nHuman:"

n
integer

Number of completions to generate. Default: 1. Must be a plain number such as 1; do not use quotes.

Required range: x >= 1
Example:

1

Response

Completion created

id
string

Unique identifier for the response.

Example:

"chatcmpl-9876543210"

object
string

Object type.

Example:

"chat.completion"

created
integer

Creation timestamp.

Example:

1677652288

model
string

The actual model name used.

Example:

"deepseek-v4-flash"

choices
object[]
usage
object