'404 Not Found' for url ' `https://www.dmxapi.cn/v1/images/generations/v1/images...
🚨 错误信息
修改模型配置保存成功 新增保存不可用 模型刷新后消失 配置完成的GPT Image 2时候点击生成提示Client error '404 Not Found' for url ' `https://www.dmxapi.cn/v1/images/generations/v1/images/generations` ' For more information check: `https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404`
🤖 AI解决方案
报错分析报告
1.错误翻译
原文:Client error '404 Not Found' for url 'https://www.dmxapi.cn/v1/images/generations/v1/images/generations'
译文:客户端错误‘404 Not Found’,请求的URL为‘https://www.dmxapi.cn/v1/images/generations/v1/images/generations’
2. 原因分析
/v1/images/generations),服务器无法定位资源。 3. 解决方案
修正URL路径(移除重复的
/v1/images/generations): python
import requests修复后的正确URL(移除重复路径)
url = "https://www.dmxapi.cn/v1/images/generations"
headers = {"Authorization": "Bearer YOUR_DMXAPI_KEY"} # 替换为实际密钥
payload = {
"model": "gpt-image-2",
"prompt": "你的生成提示", # 替换为实际需求
"n": 1,
"size": "1024x1024"
}response = requests.post(url, headers=headers, json=payload)
print(response.json())
4. 预防措施
---
请优先修正URL路径后重试生成操作。