Skip to main content
POST
cURL
带推理的工具调用请使用 Responses API。Chat Completions 函数调用要求 reasoning_effort: "none"
解析 Responses API 原始 JSON 时,应从 output[].content[].text 读取生成文本。部分官方 SDK 会提供 output_text 便利属性,但原始 HTTP 响应可能不包含该字段。

授权

Authorization
string
header
必填

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

请求体

application/json

推理强度不是 none 时,请移除 temperature、top_p 和 top_logprobs。

model
enum<string>
必填
可用选项:
gpt-6-luna
input
必填

文本或有序输入项,包括文本和图像内容。

instructions
string
reasoning
object
max_output_tokens
integer

可见输出和推理 token 的最大数量。

必填范围: 1 <= x <= 128000
text
object

文本详细程度或结构化输出配置。

tools
object[]
tool_choice
可用选项:
none,
auto,
required
stream
boolean
默认值:false
prompt_cache_key
string
prompt_cache_options
object
include
string[]

推理强度不是 none 时,不要请求 message.output_text.logprobs。

响应

响应创建成功。

id
string
object
string
示例:

"response"

model
string
示例:

"gpt-6-luna"

status
enum<string>
可用选项:
queued,
in_progress,
completed,
incomplete,
failed,
cancelled
output
object[]
output_text
string

部分官方 SDK 提供的可选文本聚合便利字段。解析原始 HTTP 响应时, 应从 output[].content[].text 读取生成文本,不应要求该字段一定存在。

usage
object
error
object | null