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

2026年04月30日 17:57 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: 2026043017564199672769UcMvzGCr)"},"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字段。

  • 发生位置:请求体(Request Body)的content数组中,缺失每个条目对应的thinking属性。
  • 3.解决方案


    JavaScript (Fetch API)为例,修复请求 payload:
    // 修复后的请求代码示例
    const requestBody = {
      // 其他参数...
      content: [
        {
          type: "text",
          text: "你的输入内容",
          thinking: "思考过程的详细描述" // 必须添加的字段
        }
      ]
    };
    
    fetch("https://api.dmxapi.com/your-endpoint", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(requestBody)
    });
    

    4. 预防措施


  • 遵循API契约:调用前仔细阅读文档,标记所有必填字段(如thinking),用注释标注依赖条件。

  • 请求验证工具:用[Postman](https://www.postman.com/)或[Insomnia](https://insomnia.rest/)预演请求,开启「Schema Validation」检查字段完整性。
  • ---
    如需进一步分析其他报错,请提供具体错误信息。