", "data": { "message": "prompt_cache_breakpoint is not supported on this model ...

2026年08月29日 17:12 38.74 秒 success

错误信息

{ "name": "APIError", "data": { "message": "prompt_cache_breakpoint is not supported on this model (request id: 202608290911268821016258268d9d6Zis98Bm8) 请求 ID:202608290911059753830868268d9d6y302vHZ3", "statusCode": 400, "isRetryable": false, "responseHeaders": { "cache-control": "no-cache", "connection": "keep-alive", "content-type": "text/event-stream", "date": "Sat, 29 Aug 2026 09:11:29 GMT", "server": "nginx", "strict-transport-security": "max-age=31536000", "transfer-encoding": "chunked", "x-content-type-options": "nosniff", "x-dmx-api-version": "v3.4.6", "x-frame-options": "DENY", "x-oneapi-request-id": "20260829091043257835004c14228f5JYO3B6yV" }, "responseBody": "{\"error\":{\"message\":\"prompt_cache_breakpoint is not supported on this model (request id: 202608290911268821016258268d9d6Zis98Bm8) 请求 ID:202608290911059753830868268d9d6y302vHZ3\",\"type\":\"new_api_error\",\"param\":\"\",\"code\":\"upstream_error\"}}", "metadata": { "url": "https://www.dmxapi.cn/v1/responses" } } }

AI 解决方案

1. 🌐 错误翻译


原文:prompt_cache_breakpoint is not supported on this model (request id: 202608290911268821016258268d9d6Zis98Bm8) 请求 ID:202608290911059753830868268d9d6y302vHZ3
译文:该模型不支持 prompt_cache_breakpoint(请求 ID:202608290911268821016258268d9d6Zis98Bm8)请求 ID:202608290911059753830868268d9d6y302vHZ3

2. 🎯 原因分析


  • 根本原因:请求中携带的 prompt_cache_breakpoint 参数不被目标模型支持,模型不具备该功能特性。

  • 错误位置:在向 https://www.dmxapi.cn/v1/responses 发起请求时,因传递了模型不支持的参数触发API校验失败,返回400错误。

  • 上下文:请求使用了 prompt_cache_breakpoint 相关功能,但当前选用的模型未实现该功能模块。
  • 3. 💡 解决方案


    移除请求中不被支持的 prompt_cache_breakpoint 参数,使用模型支持的基础参数发起请求,示例如下:
    // 修复后的请求示例(以DMXAPI v3请求为例)
    const response = await client.responses.create({
      model: "支持的基础模型(如dmx-gpt-3.5)", // 替换为支持prompt_cache_breakpoint的模型或移除该参数
      prompt: "你的问题内容",
      // 已移除不被支持的prompt_cache_breakpoint参数
      // prompt_cache_breakpoint: "缓存断点值", // 原错误参数,此处删除
      temperature: 0.7,
      max_tokens: 2000
    });
    

    4. 🛡️ 预防措施


  • 参数校验前置:调用API前,先查阅对应模型的官方功能文档,确认支持的参数列表,避免传递模型不支持的参数。

  • 动态功能检测:若功能需兼容多个模型,可在请求前通过模型信息查询接口,动态获取模型支持的功能,再决定是否添加对应参数。

  • 工具辅助:推荐使用Postman等API调试工具,开启参数自动校验功能,提前发现不兼容参数;也可在代码中增加参数合法性校验逻辑,过滤无效参数。