Skip to main content
POST

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
enum<string>
必填

AnyFast 模型 ID。

可用选项:
deepseek-v4.1-flash
示例:

"deepseek-v4.1-flash"

messages
object[]
必填

对话消息列表。图像内容只能放在 user 消息中。

Minimum array length: 1
thinking
object | null

思考模式配置。默认开启思考模式。

reasoning_effort
enum<string>
默认值:high

思考开关与推理强度。none 关闭思考;该字段位于请求顶层,不属于 thinking 对象。

可用选项:
none,
low,
high,
max
max_tokens
integer

最大生成 Token 数。

必填范围: 1 <= x <= 393216
response_format
object

使用 json_object 开启 JSON 模式,同时需要在提示词中明确要求输出 JSON。

stop
stream
boolean
默认值:false

是否通过 SSE 流式返回消息增量。

stream_options
object
temperature
number
默认值:1

开启思考模式时该参数会被忽略。

必填范围: 0 <= x <= 2
top_p
number
默认值:1

思考模式下小于 0.95 的值按 0.95 处理;非思考模式下有效值为 1.0。

必填范围: 0 <= x <= 1
tools
object[]
tool_choice
可用选项:
none,
auto,
required
frequency_penalty
number
默认值:0

为兼容性保留;开启思考模式时不生效。

必填范围: -2 <= x <= 2
presence_penalty
number
默认值:0

为兼容性保留;开启思考模式时不生效。

必填范围: -2 <= x <= 2
user_id
string

用于内容安全和缓存隔离的稳定终端用户标识。

Maximum string length: 512
Pattern: ^[a-zA-Z0-9\-_]+$

响应

对话补全创建成功

id
string
必填
示例:

"chatcmpl-example"

object
enum<string>
必填
可用选项:
chat.completion
created
integer
必填

Unix 秒级时间戳。

model
string
必填
示例:

"deepseek-v4.1-flash"

choices
object[]
必填
usage
object
必填