NAAPI 提供的 OpenAI Responses 兼容接口,适合新式推理模型、多轮响应链、工具调用和多模态输入。
https://naapi.cc/v1POST https://naapi.cc/v1/responsesAuthorization: Bearer <API_KEY>input 可以直接使用字符串output[],文本通常位于 output[].content[].textresponse.output_textNAAPI_API_KEY 环境变量读取naapi.apifox.cn只承载文档,请求必须发送到https://naapi.cc/v1/responses。
instructions 和 inputprevious_response_id 串联多轮对话MODEL 替换为账户当前可用的 Responses 兼容模型 ID。| 字段 | 必填 | 说明 |
|---|---|---|
model | 是 | 模型 ID |
input | 建议 | 字符串或结构化消息数组 |
instructions | 否 | 系统级指令 |
max_output_tokens | 否 | 最大输出 Token 数 |
stream | 否 | true 启用 SSE 事件流 |
tools | 否 | Responses 工具定义 |
tool_choice | 否 | 控制工具选择 |
reasoning.effort | 否 | low / medium / high |
previous_response_id | 否 | 引用真实的上一轮 Response ID |
truncation | 否 | auto 或 disabled |
response.output_text。直接解析 HTTP JSON 时,不要假定 output[0] 永远是最终文本;output 还可能包含推理、工具调用等项目,应按 type 遍历提取 output_text。instructions,用户内容写入 input。choices[0].message.content 用在 Responses。previous_response_id 必须来自真实的上一轮响应。temperature、reasoning 或所有工具类型。event.type 解析,不要把所有 SSE data 当成普通文本。400 / 401 / 429 先读取 error.message,不要用原参数无限重试。