400 {"error":{"type":"invalid_request_error","message":"The content[].thinking i...

2026年04月26日 13:03 processing

错误信息

API Error: 400 {"error":{"type":"invalid_request_error","message":"The content[].thinking in the thinking mode must be passed back to the API. (request id: 20260426130316443041279l0KgPTES)"},"type":"error"}

AI 解决方案

报错分析报告

1.错误翻译


原文:The content[].thinking in the thinking mode must be passed back to the API.
译文:思考模式下的content数组中的thinking字段必须回传给API。

2.原因分析


  • 根本原因:请求未遵循API要求——思考模式下需将content[].thinking字段回传至API。

  • 发生位置:构造API请求体时,遗漏了content数组中对应项的thinking属性。
  • 3.解决方案


    // 修复后的请求体示例(含thinking字段回传)
    {
      "content": [
        {
          "type": "text",
          "text": "你的输入内容",
          "thinking": "思考过程中的中间结论/逻辑(需原样回传)"
        }
      ],
      "thinking_mode": true // 确保开启思考模式时携带此字段
    }
    

    4. 预防措施


  • 遵循API文档中「思考模式」的参数规范,明确content[].thinking为必传项;

  • Postmancurl预校验请求体结构,避免字段遗漏。
  • ---
    请补充完整请求场景以进一步优化分析。