Responses API
POST /v1/responses,用于文本、工具调用、多模态输入以及 Codex 客户端。
POST https://api.webway.sh/v1/responses
Codex 及较新的 OpenAI SDK 集成请使用 Responses。
请求
curl https://api.webway.sh/v1/responses \
-H "Authorization: Bearer $WEBWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.6-terra",
"input": "Write a three-line release note.",
"max_output_tokens": 200
}'
| 字段 | 类型 | 说明 |
|---|---|---|
model |
string | 必填,带提供方前缀的模型 ID |
input |
string or array | 必填,文本或结构化输入项 |
instructions |
string | 系统级指引 |
max_output_tokens |
integer | 生成的最大 token 数 |
tools |
array | 模型可用的工具 |
stream |
boolean | 为 true 时以流式返回响应事件 |
响应
{
"id": "resp_01…",
"object": "response",
"model": "openai/gpt-5.6-terra",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{"type": "output_text", "text": "Added…"}]
}
],
"usage": {"input_tokens": 12, "output_tokens": 24, "total_tokens": 36}
}
OpenAI 官方 SDK 会将合并后的文本暴露为 response.output_text。