400 Function tools with reasoning_effort are not supported for gpt-6-astra-2026-...
错误信息
AI 解决方案
🔍 报错分析
1. 🌐 错误翻译
原文:API Error: 400 Function tools with reasoning_effort are not supported for gpt-6-astra-2026-09-03 in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'. (request id: 20260910132229112988636rLldX5s3) (request id: 20260910052228108488242c14228f5SWxJCpMn)
译文:API 错误:400,在 /v1/chat/completions 接口中,gpt-6-astra-2026-09-03 模型不支持同时使用函数工具和 reasoning_effort 参数。如需使用函数工具,请改用 /v1/responses 接口,或将 reasoning_effort 设置为 'none'。
2. 🎯 原因分析
根本原因:在调用
/v1/chat/completions 接口时,使用了 gpt-6-astra-2026-09-03 模型,该模型不支持同时配置函数工具(Function Tools)和推理强度参数 reasoning_effort。具体位置:API 请求中同时包含了函数工具定义和 reasoning_effort 参数,两者产生冲突,模型无法兼容这种组合配置。
3. 💡 解决方案
有两种修复方式,根据你的实际需求选择其一:
#### 方案一:设置 reasoning_effort 为 'none'(推荐)
如果你仍想使用 /v1/chat/completions 接口和函数工具,只需禁用推理强度参数:
``代码语言``
// 修复后的请求参数示例
{
"model": "gpt-6-astra-2026-09-03",
"messages": [
{
"role": "user",
"content": "你的提问内容"
}
],
"tools": [
// 你的函数工具定义
{
"type": "function",
"function": {
"name": "your_function",
"description": "函数描述",
"parameters": {
"type": "object",
"properties": {
"param1": {
"type": "string",
"description": "参数说明"
}
},
"required": ["param1"]
}
}
}
],
"reasoning_effort": "none" // 关键修改:设为'none'
}
代码语言
#### 方案二:改用 `/v1/responses` 接口
如果需要保留 `reasoning_effort` 参数,需切换 API 接口路径:
// 切换为 /v1/responses 接口的请求示例
// 请求路径需改为 https://api.dmxapi.com/v1/responses
{
"model": "gpt-6-astra-2026-09-03",
"input": "你的提问内容",
"tools": [
// 你的函数工具定义(格式需适配responses接口)
{
"type": "function",
"function": {
"name": "your_function",
"description": "函数描述",
"parameters": {
"type": "object",
"properties": {
"param1": {
"type": "string",
"description": "参数说明"
}
},
"required": ["param1"]
}
}
}
],
"reasoning_effort": "high" // 可保留原值,如'high'、'medium'等
}