API 参考
Responses 接口
POST /v1/responses,兼容 OpenAI Responses 格式,适用于 Codex 和新版 OpenAI SDK。
请求
POST https://api.kkapi.one/v1/responses
Authorization: Bearer sk-你的令牌
Content-Type: application/json| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型 ID |
input | string / array | 是 | 输入文本或消息数组 |
instructions | string | 否 | 系统指令 |
max_output_tokens | integer | 否 | 最大输出 token 数 |
stream | boolean | 否 | 是否流式返回 |
请求示例
curl https://api.kkapi.one/v1/responses \
-H "Authorization: Bearer sk-你的令牌" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.1-sol",
"input": "用一句话介绍 KKAPI"
}'响应
{
"id": "resp_...",
"object": "response",
"status": "completed",
"model": "gpt-6.1-sol",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{"type": "output_text", "text": "..."}
]
}
]
}接口已在本站实测可用(gpt-6.1-sol)。不同模型对 input 数组、工具调用和流式的支持可能不同。