DeepSeek V4.1 Flash
deepseek-v4.1-flash-1017
文本DeepSeekDeepSeek V4.1 Flashdeepseek-v4.1-flash-1017
deepseek-v4.1-flash-1017 是 V4.1 Flash 的 1017 检查点,权重开源,比首版基准更高、完成更快、输出更短。支持图片输入,上下文 1M token,最大输出 384K,可切换思考模式,支持 JSON 输出和工具选择。
鉴权
- Base URL
https://api.dreamto.ai- Authorization
Authorization: Bearer YOUR_API_KEY- Content-Type
application/json- 模型名 (model)
deepseek-v4.1-flash-1017
接入协议
为什么选这个协议
适合已有 OpenAI SDK、Chat Completions 代码或统一网关接入的用户。
接口地址
POST/v1/chat/completions
Authorization: Bearer YOUR_API_KEYContent-Type: application/json请求 / 响应 JSON
请求
{
"stop": [
"\n\n"
],
"model": "deepseek-v4.1-flash-1017",
"tools": [],
"top_p": 1,
"stream": false,
"user_id": "user_123",
"logprobs": false,
"messages": [
{
"role": "user",
"content": "你好,世界"
}
],
"thinking": {
"type": "enabled",
"reasoning_effort": "high"
},
"max_tokens": 4096,
"temperature": 1,
"tool_choice": "auto",
"top_logprobs": 5,
"stream_options": {
"include_usage": true
},
"response_format": {
"type": "json_object"
},
"system_instruction": "你是一个严谨的助手。"
}响应
{
"id": "chatcmpl_example",
"model": "deepseek-v4.1-flash-1017",
"usage": {
"total_tokens": 24,
"prompt_tokens": 8,
"completion_tokens": 16
},
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello from Mix API"
},
"finish_reason": "stop"
}
],
"created": 1710000000
}请求字段 / 响应字段
请求字段
| 字段 | 类型 | 必填 | 默认 | 可选值 / 范围 | 说明 | 示例 |
|---|---|---|---|---|---|---|
| messages | array | Y | - | - | DeepSeek Chat Completions 消息数组。 | [{"role":"user","content":"你好,世界"}] |
| system_instruction | string | N | - | - | 用于约束角色、风格和回答边界。 | 你是一个严谨的助手。 |
| temperature | number | N | 1 | - | 控制随机性,DeepSeek 官方建议 temperature 和 top_p 二选一调整。 | 1 |
| top_p | number | N | 1 | - | 核采样概率阈值,DeepSeek 官方建议不要同时修改 temperature。 | 1 |
| max_tokens | integer | N | - | - | 限制本次响应的最大输出长度。 | 4096 |
| stop | array | N | - | - | 停止生成的字符串或字符串数组。 | ["\n\n"] |
| stream | boolean | N | false | - | 是否使用 SSE 流式响应。 | false |
| stream_options | object | N | - | - | 流式响应附加选项,例如 include_usage。 | {"include_usage":true} |
| thinking | object | N | - | - | DeepSeek 思考模式配置,用于控制推理输出。 | {"type":"enabled","reasoning_effort":"high"} |
| response_format | object | N | - | - | 要求模型返回 JSON object 等结构化格式。 | {"type":"json_object"} |
| tools | array | N | - | - | DeepSeek tools/function calling 定义。 | [] |
| tool_choice | enum | N | - | none, auto, required | 控制工具调用策略。 | auto |
| logprobs | boolean | N | false | - | 是否返回输出 token 的 log probabilities。 | false |
| top_logprobs | integer | N | - | - | 每个位置返回的最可能 token 数量。 | 5 |
| user_id | string | N | - | - | 终端用户唯一标识,用于 DeepSeek 侧安全与滥用检测。 | user_123 |
响应字段
| 字段 | 类型 | 必填 | 默认 | 可选值 / 范围 | 说明 | 示例 |
|---|---|---|---|---|---|---|
| id | string | N | - | - | - | chatcmpl_example |
| object | string | N | - | - | - | chat.completion |
| created | integer | N | - | - | - | 1710000000 |
| model | string | N | - | - | - | deepseek-v4.1-flash-1017 |
| choices | array | N | - | - | - | [{"index":0,"message":{"role":"assistant","content":"Hello from Mix API"},"finish_reason":"stop"}] |
| choices[] | object | N | - | - | - | {"index":0,"message":{"role":"assistant","content":"Hello from Mix API"},"finish_reason":"stop"} |
| choices[].index | integer | N | - | - | - | 0 |
| choices[].message | object | N | - | - | - | {"role":"assistant","content":"Hello from Mix API"} |
| choices[].message.role | string | N | - | - | - | assistant |
| choices[].message.content | string | N | - | - | - | Hello from Mix API |
| choices[].finish_reason | string | N | - | - | - | stop |
| usage | object | N | - | - | - | {"total_tokens":24,"prompt_tokens":8,"completion_tokens":16} |
| usage.prompt_tokens | integer | N | - | - | - | 8 |
| usage.completion_tokens | integer | N | - | - | - | 16 |
| usage.total_tokens | integer | N | - | - | - | 24 |
代码示例
cURLrequest.sh
curl -X POST "https://api.dreamto.ai/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017",
"messages": [
{
"content": "你好,世界",
"role": "user"
}
],
"system_instruction": "你是一个严谨的助手。",
"temperature": 1,
"top_p": 1,
"max_tokens": 4096,
"stop": [
"\n\n"
],
"stream": false,
"stream_options": {
"include_usage": true
},
"thinking": {
"reasoning_effort": "high",
"type": "enabled"
},
"response_format": {
"type": "json_object"
},
"tools": [],
"tool_choice": "auto",
"logprobs": false,
"top_logprobs": 5,
"user_id": "user_123"
}'