Skip to main content
POST
对话补全:DeepSeek V4 Flash 文本生成
右侧 Playground 可直接调试:在 AuthorizationBearer sk-your-api-key, 默认示例已关闭深度思考(thinking.disabled),点击发送即可快速看到响应。
该模型默认思考量偏大,一句话问题也会先输出数百 tokens 思考内容。调试建议保持示例中的 "thinking": {"type": "disabled"}。模型能力、定价、缓存机制详见 DeepSeek V4 Flash 概览
  • 开启思考时 max_tokens 要给足(思考内容计入输出配额),建议 3000+
  • response_format 不生效:传 json_schema 返回 200 但完全无视 schema,需要结构化输出请用 tools
  • n 参数静默忽略:传 n=2 返回 200,但 choices 里恒为 1 个元素
  • 纯文本模型,传图片内容块会报 Model do not support image input

参数说明速查

上下文与输出上限

实测 322,055 tokens 的输入 14.77 秒返回,并准确捞出埋在中段的信息。

隐式缓存

无需任何参数,相同长前缀第 2 次请求即命中: 命中部分按 $0.028 / 百万 tokens 计费。把时间戳、随机 ID 等变动内容放到 prompt 末尾, 不要混进前缀,否则命中率归零。

需要结构化输出?用 tools

choices[0].message.tool_calls[0].function.arguments 取 JSON 字符串,可直接解析。

授权

Authorization
string
header
必填

在 API易控制台获取的 API Key

请求体

application/json
model
enum<string>
默认值:deepseek-v4-flash-ga-260731
必填

模型 ID,固定 deepseek-v4-flash-ga-260731

可用选项:
deepseek-v4-flash-ga-260731
messages
object[]
必填

对话消息数组,OpenAI 标准格式。纯文本,不支持图片内容块

max_tokens
integer
默认值:500

最大输出 tokens,硬上限 393,216。开启思考时思考内容也计入,建议给足

必填范围: x <= 393216
thinking
object

深度思考开关。传 {"type": "disabled"} 可关闭,实测简单任务可省 200+ 思考 tokens

reasoning_effort
enum<string>

思考深度分档。实测仅 minimal 确定性生效(思考 tokens 恒为 0);low/medium/high/max 不构成单调阶梯,档内方差大于档间差异

可用选项:
minimal,
low,
medium,
high,
max
stream
boolean
默认值:false

是否流式输出(SSE)。配合 stream_options.include_usage 可在末尾获取用量

temperature
number

采样温度

top_p
number

核采样阈值

stop
string[]

停止词,实测真实截断生效

seed
integer

随机种子

logprobs
boolean

是否返回 token 对数概率,实测有内容返回

tools
object[]

Function Call 工具列表,OpenAI 标准格式。工具参数是真正被约束的,需要结构化输出时用它替代 response_format

响应

对话补全成功

id
string

请求 ID

model
string
choices
object[]

补全结果。message 中除 content 外,开启思考时还有 reasoning_content 字段

usage
object

用量。completion_tokens_details.reasoning_tokens 为思考消耗;prompt_tokens_details.cached_tokens 为隐式缓存命中量