DeepSeek peak rates apply Monday through Friday from 09:00 to 12:00 and 14:00 to 18:00 Beijing time. All other times, including weekends, use off-peak rates.
deepseek-v4-flashCall DeepSeek-V4-Flash using the OpenAI-compatible protocol.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name to be called, fill in the name from the model gallery. |
messages | array | Yes | List of conversation messages, each containing role and content. The role can be system / user / assistant / tool. |
stream | boolean | No | Whether to stream the response. When set to true, the response is pushed in chunks via SSE, suitable for scenarios requiring real-time display during generation. |
temperature | number | No | Sampling temperature; higher values result in more diverse outputs, lower values result in more stable outputs. |
max_tokens | integer | No | Maximum number of tokens to generate in this response. Omitted means the model decides autonomously and will not be truncated. |
top_p | number | No | Nucleus sampling, selecting candidates from the top top_p cumulative probabilities. Only one of temperature and nucleus sampling should be used. |
tools | array | No | List of available tools that the model can call. When needed, the model will return tool_calls, which you then execute and feed back as a tool call with role=tool. |
tool_choice | string | No | Control whether and how to use tools: auto (model decides), none (disable), or specify a specific tool. Must be used together with tools. |
response_format | object | No | Specify the output format, e.g., return in JSON format. |
stop | array | No | Stop generation upon encountering any of these strings; the strings will not appear in the result. |
n | integer | No | Number of candidate responses to return per request. Billing is based on the total token count across all candidates. |
seed | integer | No | Fixed random seed; ensures consistent output for the same input. |
frequency_penalty | number | No | Reduce the probability of a token being selected based on its frequency of appearance; used to suppress repetition. |
presence_penalty | number | No | Reduce the probability of a token being selected based on whether it has appeared previously; used to encourage topic change. |
logit_bias | object | No | Adjust the selection probability of tokens by their token ID; can be used to strongly promote or suppress specific words. |
parallel_tool_calls | boolean | No | Whether to allow the model to return multiple tool calls in one response. Must be used together with tools. |
logprobs | boolean | No | Whether to return the log probability of selected tokens. |
top_logprobs | integer | No | Number of additional candidate token probabilities to return per position. Must be enabled together with logprobs. |
max_completion_tokens | integer | No | Maximum length of the response. Some newer models use this field instead of max_tokens. |
reasoning_effort | string | No | Inference strength. Increasing this value makes the model think longer, typically resulting in more accurate outputs, but at the cost of higher token consumption. Only effective for inference models. Options: minimal / low / medium / high |
verbosity | string | No | Level of detail in the response. Options: low / medium / high |
modalities | array | No | The expected output modality, such as text only or text plus audio. Only multimodal models are effective. |
audio | object | No | Audio output settings, such as voice tone and audio format. Must include audio in the modalities. |
prediction | object | No | Prediction output. Providing this when most of the response is known can accelerate generation. |
stream_options | object | No | Streaming-related settings, such as whether to include usage statistics at the last frame. Requires stream=true. |
store | boolean | No | Whether the conversation is retained on the model service side. |
metadata | object | No | Custom key-value pairs, which will be sent along with the request for your own classification and retrieval. |
user | string | No | Identifier for the end-user, to help differentiate your user sources. |
prompt_cache_key | string | No | Prompt caching key. Requests with the same prefix using the same key are more likely to hit cache, resulting in faster and more efficient retrieval. |
prompt_cache_retention | string | No | Duration for which prompt cache is retained. |
curl https://api.router.ai/v1/chat/completions \
-H "Authorization: Bearer sk-你的令牌" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [{"role": "user", "content": "你好"}]
}'Endpoint reference: Create a chat completion (OpenAI-compatible)
Call DeepSeek-V4-Flash using the Anthropic-native protocol.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name to be called, fill in the name from the model gallery. |
messages | array | Yes | Array of conversation messages, each containing role and content. The role can only be user or assistant; system prompts are handled via a separate system field and not included here. |
max_tokens | integer | Yes | Maximum number of tokens to generate in this response. This is a required field under this protocol. |
system | string | No | System prompt. Can be passed as a string or as an array to set different segments individually. |
stream | boolean | No | Whether to stream the response. Set to true for incremental SSE streaming. |
temperature | number | No | Sampling temperature; higher values result in more diverse outputs, lower values result in more stable outputs. |
tools | array | No | List of available tools for the model to use. The model will return a tool_use content block when needed, which you will then execute and refill with tool_result. |
tool_choice | object | No | Control over tool usage: whether to let the model decide, force usage, or specify a particular tool. Must be used in conjunction with tools. |
stop_sequences | array | No | Stop generation upon encountering any of the following strings. |
top_p | number | No | Nucleus sampling, selecting candidates from the top top_p cumulative probabilities. Only one of temperature and nucleus sampling should be used. |
top_k | integer | No | Only select from the top k candidates with highest probability. |
thinking | object | No | Enable extended thinking: the model will perform reasoning before generating a response. The reasoning process will be returned as a separate content block and counted toward output usage. Only available for models that support this capability. |
metadata | object | No | Custom metadata for your own categorization and retrieval. |
curl https://api.router.ai/v1/messages \
-H "Authorization: Bearer sk-你的令牌" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "你好"}]
}'