": { "message": "Resource not found", "type": "rix_api_error", "param": "", "cod...
错误信息
HTTP状态码: 404
请求URL: https://www.dmxapi.cn/v1/images/edits
请求方法: POST
响应头: {'Date': 'Mon, 27 Apr 2026 09:00:46 GMT', 'Server': 'nginx', 'Connection': 'Keep-Alive', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '89', 'X-Rixapi-Request-Id': '20260427170042804212210UlCDWMqa'}
响应JSON: {
"error": {
"message": "Resource not found",
"type": "rix_api_error",
"param": "",
"code": "404"
}
}
AI 解决方案
报错分析报告
1.错误翻译
原文:Resource not found
译文:资源未找到
2. 原因分析
https://www.dmxapi.cn/v1/images/edits不存在或已失效 3. 解决方案
# 修复示例(以Python requests为例,需确认正确端点)
import requests
# 1. 核对DMXAPI文档,修正端点URL(示例为假设的正确路径)
correct_url = "https://www.dmxapi.cn/v1/images/edit" # 注意edits→edit的单复数差异
headers = {"Authorization": "Bearer YOUR_API_KEY"} # 替换为真实密钥
files = {"image": open("input.png", "rb")}
data = {"prompt": "描述文本"}
response = requests.post(correct_url, headers=headers, files=files, data=data)
print(response.json())
4. 预防措施
---
若仍报错,请提供完整代码上下文或DMXAPI最新文档参考。