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>
必填

用于生成回复的模型 ID,例如 gpt-5.6-sol 或 o3。

可用选项:
gpt-5.6-sol,
gpt-5.6-terra,
gpt-5.6-luna,
gpt-5.4
messages
object[]
必填

截至当前的对话消息列表。

Minimum array length: 1
audio
object

音频输出参数。当 modalities 包含 audio 时必填。

temperature
number

采样温度。较高值使输出更随机;通常与 top_p 二选一调整。

必填范围: 0 <= x <= 2
top_p
number

核采样阈值;通常与 temperature 二选一调整。

必填范围: 0 <= x <= 1
n
integer

为每条输入生成的候选回复数量。

必填范围: x >= 1
stream
boolean

是否以 SSE 流式返回增量结果。

stream_options
object

流式输出附加配置,仅在 stream 为 true 时生效。

max_completion_tokens
integer

最大生成词元数,包含可见输出与推理词元。

必填范围: x >= 1
max_tokens
integer

已弃用,请使用 max_completion_tokens。

必填范围: x >= 1
frequency_penalty
number

频率惩罚。正值减少重复表达。

必填范围: -2 <= x <= 2
presence_penalty
number

存在惩罚。正值鼓励模型引入新内容。

必填范围: -2 <= x <= 2
logit_bias
object

指定词元的生成倾向。属性名为词元 ID,值为 -100 到 100。

logprobs
boolean

是否返回输出词元的对数概率。

top_logprobs
integer

每个输出位置返回的高概率候选词元数;需同时启用 logprobs。

必填范围: 0 <= x <= 20
stop

停止序列,部分新模型不支持。

response_format
object

输出格式配置。

tools
object[]

提供给模型的可调用工具列表。

tool_choice

控制模型是否调用工具、自动选择工具或强制调用指定工具。

可用选项:
none,
auto,
required
parallel_tool_calls
boolean

是否允许模型并行调用多个工具。

reasoning_effort
string

推理强度设置,用于在速度、成本与推理深度之间权衡。

verbosity
enum<string>

输出详细程度。

可用选项:
low,
medium,
high
seed
integer

用于尽力使输出可复现的随机种子。

service_tier
enum<string>

请求的服务层级。

可用选项:
auto,
default,
flex,
scale,
priority,
fast
store
boolean

是否存储该请求的输出。

metadata
object

附加键值对元数据。

modalities
enum<string>[]

指定输出类型。

可用选项:
text,
audio
prediction
object

预测输出配置。

prompt_cache_key
string

提示词缓存的稳定键。

prompt_cache_retention
enum<string>

提示词缓存保留时长。

可用选项:
in_memory,
24h
prompt_cache_options
object

提示词缓存选项。

safety_identifier
string

用于协助检测滥用行为的稳定终端用户标识,不应为直接个人身份信息。

user
string

旧版终端用户标识,建议使用 safety_identifier。

web_search_options
object

网页搜索工具配置。

响应

200 - application/json

Chat Completions 非流式响应(chat.completion)。适用于 Apifox 的“通过 JSON 等生成 → JSON Schema”直接导入。

id
string
必填

本次聊天补全的唯一 ID。

object
enum<string>
必填

对象类型,固定为 chat.completion。

可用选项:
chat.completion
created
integer
必填

响应创建时间的 Unix 时间戳,单位为秒。

model
string
必填

实际用于生成回复的模型 ID。

choices
object[]
必填

模型生成的候选回复列表。

usage
object

本次请求的词元使用统计。

service_tier
string | null

实际用于处理该请求的服务层级。

system_fingerprint
string | null

模型运行的后端配置指纹。

metadata
object

与请求关联的元数据。