Skip to content

Responses API

POST /v1/responses 使用 OpenAI Responses 兼容请求格式。新项目优先选择该路由;支持范围取决于所选模型和当前上游能力。

bash
curl https://ai.tavonilo.com/v1/responses \
  -H "Authorization: Bearer $AI_SHOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<MODEL_ID>",
    "input": "用一句话解释幂等性。"
  }'

流式 Responses

stream 设为 true 后,服务以 Server-Sent Events 返回事件。SDK 应持续读取直到收到完成事件或连接关闭,不能假设每个网络包恰好对应一个完整 JSON 对象。

bash
curl --no-buffer https://ai.tavonilo.com/v1/responses \
  -H "Authorization: Bearer $AI_SHOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<MODEL_ID>","input":"写一首四行短诗","stream":true}'

兼容说明

  • input 可为字符串或兼容的输入项数组,具体可用字段随模型与上游变化。
  • 工具调用、图像、音频、结构化输出、背景任务等高级特性不是全局保证;请先在目标模型上验证。
  • GET /v1/responses 用于兼容性场景;实际支持的查询能力以响应为准,不应作为应用状态数据库。
  • 不要依赖非文档化的转发头、内部模型 ID 或上游错误文本。

参见 流式响应错误码

API access is subject to the AIShop service terms.