创建 Responses 响应

POST
/v1/responses

OpenAI Responses 格式,支持非流式与流式(SSE)。

适用于支持 Responses 接口的模型,每个模型支持的接口以 模型广场 为准。Codex CLI 使用的就是这个接口。

鉴权

BearerAuth
header鉴权Bearer <令牌>

使用 API 密钥认证。 格式:Authorization: Bearer sk-xxxxxx。API 密钥在控制台「API 密钥」页(https://ai.myaiexp.com/keys)创建。

请求体

application/json
  1. body
model*string

模型 ID,例如 your-model-id。请替换为模型广场(https://ai.myaiexp.com/pricing)中的模型 ID,或调用 GET /v1/models 查看当前密钥可用的模型。

input?|array<>

输入内容,可以是字符串或消息数组

instructions?string
max_output_tokens?integer
temperature?number
top_p?number
stream?boolean
tools?array<>
tool_choice?string|
reasoning?
previous_response_id?string
truncation?string
可选值"auto""disabled"

响应体

成功创建响应

application/json
  1. response
id?string
object?string
created_at?integer
status?string
可选值"completed""failed""in_progress""incomplete"
model?string
output?array<>
usage?
请求示例
curl -X POST 'https://ai.myaiexp.com/v1/responses' \  -H 'Content-Type: application/json' \  -d '{  "model": "your-model-id",  "input": "用一句话介绍你自己",  "max_output_tokens": 600}'
响应示例
{  "id": "resp_deaedc17-0a80-9bbf-bab3-9aa18d893838",  "object": "response",  "created_at": 1791367100,  "model": "your-model-id",  "status": "completed",  "output": [    {      "id": "msg_ffe2ee94",      "type": "message",      "role": "assistant",      "status": "completed",      "content": [        {          "type": "output_text",          "text": "我是一个 AI 助手。"        }      ]    }  ],  "usage": {    "input_tokens": 52,    "output_tokens": 18,    "total_tokens": 70  }}

本服务仅供学习与研究用途。请遵守各模型提供方的使用政策。