status_code=400, Function tools with reasoning_effort are not supported for gpt-...

2026年05月02日 21:10 状态: processing

🚨 错误信息

status_code=400, Function tools with reasoning_effort are not supported for gpt-5.5 in /v1/chat/completions. Please use /v1/responses instead. (tid: 2026050213031933324505286951864

🤖 AI解决方案

报错分析报告

1.错误翻译



原文:Function tools with reasoning_effort are not supported for gpt-5.5 in /v1/chat/completions. Please use /v1/responses instead.
译文:gpt-5.5模型在/v1/chat/completions接口中不支持带reasoning_effort参数的函数工具,请改用/v1/responses接口。

2. 原因分析


  • 根本原因:调用/v1/chat/completions接口时,为gpt-5.5模型传递了含reasoning_effort的函数工具参数,该接口不支持此组合。

  • 发生位置:API请求的接口路径(/v1/chat/completions)与模型(gpt-5.5)、参数(reasoning_effort)不兼容。
  • 3. 解决方案


    改用/v1/responses接口,示例代码(Python):
    python
    import requests

    url = "https://api.dmxapi.com/v1/responses" # 替换为实际域名
    headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
    }
    data = {
    "model": "gpt-5.5",
    "input": "你的输入内容",
    "tools": [{"type": "function", "function": {"name": "your_function", "parameters": {...}}}],
    "reasoning_effort": "high" # 移至支持的接口
    }

    response = requests.post(url, headers=headers, json=data)
    print(response.json())

    4. 预防措施


  • ✅ 调用API前核对模型-接口-参数兼容性(参考官方文档),避免跨接口混用不支持的参数。

  • ✅ 使用API调试工具(如Postman、Insomnia)预验证请求,快速定位接口适配问题。
  • ---
    如需进一步分析其他报错,请提供具体错误信息。