curl --request POST \
--url https://api.getinfinityblue.com/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.4",
"input": "用一句话介绍你自己。"
}
'{
"id": "<string>",
"object": "response",
"created_at": 123,
"status": "completed",
"model": "<string>",
"output": [
{
"type": "<string>",
"id": "<string>",
"status": "<string>",
"role": "<string>",
"content": [
{
"type": "<string>",
"text": "<string>"
}
]
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {
"cached_tokens": 123,
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123
},
"completion_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123
}
}
}{
"error": {
"message": "无效的时长。支持的范围为 4 到 15 秒。",
"type": "invalid_request_error",
"param": "seconds",
"code": "invalid_duration"
}
}{
"error": {
"message": "无效的时长。支持的范围为 4 到 15 秒。",
"type": "invalid_request_error",
"param": "seconds",
"code": "invalid_duration"
}
}{
"error": {
"message": "无效的时长。支持的范围为 4 到 15 秒。",
"type": "invalid_request_error",
"param": "seconds",
"code": "invalid_duration"
}
}{
"error": {
"message": "无效的时长。支持的范围为 4 到 15 秒。",
"type": "invalid_request_error",
"param": "seconds",
"code": "invalid_duration"
}
}原生 OpenAI 格式
创建模型响应(Responses 格式)
以 OpenAI Responses API 格式创建模型响应,支持多轮对话与工具调用
POST
/
v1
/
responses
curl --request POST \
--url https://api.getinfinityblue.com/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.4",
"input": "用一句话介绍你自己。"
}
'{
"id": "<string>",
"object": "response",
"created_at": 123,
"status": "completed",
"model": "<string>",
"output": [
{
"type": "<string>",
"id": "<string>",
"status": "<string>",
"role": "<string>",
"content": [
{
"type": "<string>",
"text": "<string>"
}
]
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {
"cached_tokens": 123,
"text_tokens": 123,
"audio_tokens": 123,
"image_tokens": 123
},
"completion_tokens_details": {
"text_tokens": 123,
"audio_tokens": 123,
"reasoning_tokens": 123
}
}
}{
"error": {
"message": "无效的时长。支持的范围为 4 到 15 秒。",
"type": "invalid_request_error",
"param": "seconds",
"code": "invalid_duration"
}
}{
"error": {
"message": "无效的时长。支持的范围为 4 到 15 秒。",
"type": "invalid_request_error",
"param": "seconds",
"code": "invalid_duration"
}
}{
"error": {
"message": "无效的时长。支持的范围为 4 到 15 秒。",
"type": "invalid_request_error",
"param": "seconds",
"code": "invalid_duration"
}
}{
"error": {
"message": "无效的时长。支持的范围为 4 到 15 秒。",
"type": "invalid_request_error",
"param": "seconds",
"code": "invalid_duration"
}
}可填写的模型
| 模型 ID | 说明 |
|---|---|
gpt-5.4 | GPT-5 系列旗舰,顶级推理 / 编码 / Agentic,1M 上下文 |
gpt-5.4-mini | 轻量均衡版,适合高频调用与兜底 |
deepseek-v4-pro | DeepSeek 高性价比推理模型 |
GET /v1/models。
多轮对话续接
通过previous_response_id 字段传入上一轮响应的 id,
即可在无需重复发送完整上下文的情况下延续对话。
推理控制
对支持推理的模型,通过reasoning.effort(low / medium / high)
控制推理深度;通过 reasoning.summary(auto / concise / detailed)
控制推理摘要的详细程度。
上下文截断
truncation 设置为 auto 时,系统自动截断超出上下文窗口的旧内容;
设置为 disabled 时,若请求超出窗口将返回错误。授权
请求体
application/json
OpenAI Responses API 请求体。
模型 ID,例如 gpt-5.4。完整列表见 GET /v1/models。
示例:
"gpt-5.4"
输入内容,可以是纯文本字符串,或包含多条消息的数组。
若省略,须通过 previous_response_id 续接上一轮对话。
系统级指令,等同于 Chat Completions 中的 system 消息。
模型在本次响应中可生成的最大 token 数(含推理 token)。
采样温度,取值 0–2,控制输出的随机性。
必填范围:
0 <= x <= 2核采样概率阈值,与 temperature 二选一调整。
必填范围:
0 <= x <= 1是否以 Server-Sent Events 流式返回。
模型可调用的工具列表。
工具调用策略。字符串 auto/none/required,
或指定具体工具的对象。
可用选项:
auto, none, required 推理配置,仅对支持推理的模型生效。
Show child attributes
Show child attributes
上一轮响应的 id。填入后可在不重复发送历史上下文的情况下
延续多轮对话。
上下文截断策略。auto 自动截断超出窗口的旧内容;
disabled 超出时返回错误。
可用选项:
auto, disabled 响应
成功创建响应
OpenAI Responses API 响应体。
本次响应的唯一标识,可用作下一轮的 previous_response_id。
对象类型,值为 response。
示例:
"response"
创建时间的 Unix 时间戳(秒)。
响应状态。
可用选项:
completed, failed, in_progress, incomplete 实际处理请求的模型。
模型生成的输出块列表。
Show child attributes
Show child attributes
本次请求的 token 用量统计。
Show child attributes
Show child attributes