Skip to main content
POST
创建 Messages 响应

授权

Authorization
string
header
必填

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

请求体

application/json
model
string
必填
示例:

"minimax-m3"

messages
object[]
必填
max_tokens
integer
必填

思考与最终答案共用的最大 token 数。上限因模型而异;预算耗尽时答案可能不完整。

必填范围: x >= 1
system

系统提示词。

temperature
number

随机性(0–1)。

必填范围: 0 <= x <= 1
top_p
number
必填范围: 0 <= x <= 1
top_k
integer

仅从概率最高的 K 个候选采样。

stop_sequences
string[]

自定义停止序列。

tools
object[]

模型可调用的工具;每个含 name、description、input_schema(JSON Schema)。

tool_choice
object

工具选择:{ type: 'auto' } | { type: 'any' } | { type: 'tool', name }。

stream
boolean

为 true 时按 Anthropic SSE 事件流返回(message_start / content_block_delta / message_delta / message_stop)。

output_config
object

Anthropic 原生 effort 控制。支持值取决于 Claude 版本,见 /zh/models/chat-models。effort 不会自动开启 thinking,也不会设置思考 token 预算。

thinking
object

Anthropic 原生 thinking 配置,独立于 output_config.effort。type 与 budget_tokens 必须符合所选模型要求。

响应

Anthropic 兼容的 Messages 响应。

id
string
必填
type
string
必填
示例:

"message"

role
string
必填
示例:

"assistant"

content
object[]
必填
model
string
必填
usage
object