主题
Responses API
接口:
http
POST https://cloud.examplea.xyz/v1/responses1
适用于 Codex CLI 和支持 OpenAI Responses API 的客户端。
基础请求
bash
curl https://cloud.examplea.xyz/v1/responses \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-sol",
"input": "用三点说明如何保护 API 密钥",
"stream": false
}'1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
对话输入
json
{
"model": "gpt-5.6-sol",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "分析这段需求并给出实现步骤"
}
]
}
]
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
流式调用
设置 "stream": true 后,客户端需要处理 Responses API 的事件类型。 不要把 Chat Completions 的 choices[].delta 解析方式直接用于 Responses API。
注意事项
- Codex 自定义提供商的
base_url填写到/v1,不要包含/responses。 - 请求体较大时可能返回
413,应减少上下文或附件大小。 - 长任务可能在已经产生上游用量后因网络中断而失败,重试前先检查使用记录。