","param":"","code":"invalid_request_error"}

2026年09月18日 14:35 7.16 秒 success

错误信息

400: {"message":"The `reasoning_content` in the thinking mode must be passed back to the API.","type":"invalid_request_error","param":"","code":"invalid_request_error"}

AI 解决方案

原文:The `reasoning_content` in the thinking mode must be passed back to the API.
译文:在思考模式中,`reasoning_content`必须被回传给API。

🎯 原因分析


调用支持“思考模式”的API时,若该模式会产生 reasoning_content(推理过程内容),后续请求必须将该内容作为参数回传,当前请求漏传或未正确传递该字段,导致请求无效。

💡 解决方案


确保调用接口时,将前序请求生成的 reasoning_content 作为参数传递,示例:

const response = await fetch('your_api_url', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    // 其他必要头部,如鉴权信息
  },
  body: JSON.stringify({
    // 必要的业务参数,如模型名、prompt等
    reasoning_content: '前序请求返回的推理内容',  // 回传推理内容
  })
});

🛡️ 预防措施


  • 调用支持“思考模式”的API时,先仔细阅读接口文档,明确是否要求回传 reasoning_content 等关联字段。

  • 调试时通过日志或断点检查请求参数,确认所有必传字段(尤其是动态生成的内容)已正确传递。