status_code=400, Function tools with reasoning_effort are not supported for gpt-...
错误信息
status_code=400, Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. Please use /v1/responses instead.
AI 解决方案
1. 🌐 错误翻译
原文:status_code=400, Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. Please use /v1/responses instead.
译文:状态码=400,在/v1/chat/completions接口中,gpt-5.6-sol模型不支持携带reasoning_effort参数的工具功能,请改用/v1/responses接口。
2. 🎯 原因分析
gpt-5.6-sol 模型调用 /v1/chat/completions 接口时,传入了模型不支持的 reasoning_effort 参数。/v1/chat/completions 端点时,向请求参数中添加了 reasoning_effort。gpt-5.6-sol 模型的 /v1/chat/completions 接口不支持该参数,必须切换到 /v1/responses 端点才能使用相关能力。3. 💡 解决方案
将调用的接口从
/v1/chat/completions 改为 /v1/responses,并移除不支持的参数或按接口规范调整参数,以下是 Python 调用的修复示例:import requests
import json
# 正确的调用示例:使用 /v1/responses 接口
url = "https://api.dmxapi.com/v1/responses" # 切换为 /v1/responses 接口地址
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"model": "gpt-5.6-sol",
"input": [{"role": "user", "content": "你的问题"}],
# /v1/responses 支持的参数,移除 reasoning_effort 或按接口文档调整
"reasoning": {
"effort": "medium" # 若 /v1/responses 支持该参数,按规范传入
}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())