外观
Responses API
OpenAI Responses 兼容接口,Codex 客户端默认使用该协议。
POST https://api.ashpetals.com/v1/responses基础请求
bash
curl https://api.ashpetals.com/v1/responses \
-H "Authorization: Bearer sk-你的APIKey" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-sol",
"input": "用 Python 写一个快速排序",
"max_output_tokens": 500
}'关键字段
| 参数 | 类型 | 说明 |
|---|---|---|
model | string | 必填,模型 ID |
input | string/array | 输入内容,支持字符串或消息数组 |
instructions | string | 系统指令 |
tools | array | 工具列表(function / web_search 等) |
max_output_tokens | int | 最大输出 token 数 |
stream | boolean | 是否流式返回 |
注意事项
- Responses 协议主要面向 Codex 等 Agent 客户端;普通对话场景使用 Chat Completions 即可。
- 模型是否支持该协议以
/v1/models返回的supports_responses字段为准。