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.4
示例:

"gpt-5.4"

input
object[]
必填

模型的文本或图像输入,用于生成响应。

Minimum array length: 1
示例:
stream
boolean
默认值:false

开启后通过 SSE 流式返回结果。

temperature
number
默认值:1

采样温度,值越高输出越随机。

必填范围: 0 <= x <= 2
示例:

1

top_p
number

核采样阈值。

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

基于频率惩罚重复 Token。

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

惩罚已出现过的 Token。

必填范围: -2 <= x <= 2
max_output_tokens
integer

最大输出 Token 数。

必填范围: x >= 1
stop
string

触发停止生成的字符序列。

n
integer
默认值:1

生成多少个响应选项。

必填范围: x >= 1
text
object

模型文本响应的配置选项。

reasoning
object

模型推理/思考配置。

tools
object[]

模型可调用的工具列表。

tool_choice
string

控制模型调用哪个工具。

store
boolean
默认值:true

是否存储生成的模型响应以供后续通过 API 检索。

user
string

代表终端用户的唯一标识符。

响应

响应生成成功

id
string
必填
示例:

"resp_0ed94fe7ec73cf560169afd97bba648194b8661d445cfa4244"

object
string
必填
示例:

"response"

created_at
integer
必填

响应创建的 Unix 时间戳。

示例:

1773132155

model
string
必填
示例:

"gpt-5.4"

status
enum<string>
必填
可用选项:
completed,
failed,
in_progress,
incomplete
示例:

"completed"

output
object[]
必填
usage
object
必填
completed_at
integer

响应完成的 Unix 时间戳。

示例:

1773132156

reasoning
object
text
object