创建 Responses 响应
POST
OpenAI Responses 格式,支持非流式与流式(SSE)。
适用于支持 Responses 接口的模型,每个模型支持的接口以 模型广场 为准。Codex CLI 使用的就是这个接口。
BearerAuthheader
鉴权Bearer <令牌>使用 API 密钥认证。
格式:Authorization: Bearer sk-xxxxxx。API 密钥在控制台「API 密钥」页(https://ai.myaiexp.com/keys)创建。
application/json- body
model*string模型 ID,例如 your-model-id。请替换为模型广场(https://ai.myaiexp.com/pricing)中的模型 ID,或调用 GET /v1/models 查看当前密钥可用的模型。
input?|array<>输入内容,可以是字符串或消息数组
instructions?stringmax_output_tokens?integertemperature?numbertop_p?numberstream?booleantools?array<>tool_choice?string|reasoning?previous_response_id?stringtruncation?string可选值
"auto""disabled"成功创建响应
application/json- response
id?stringobject?stringcreated_at?integerstatus?string可选值
"completed""failed""in_progress""incomplete"model?stringoutput?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 }}本服务仅供学习与研究用途。请遵守各模型提供方的使用政策。