":{"message":"Invalid URL (GET /v1)","type":"invalid_request_error","code":""}}
错误信息
C:\Users\13010>curl https://www.dmxapi.cn/v1 -H "Authorization: Bearer sk-iwSnP9W,,,,8SgvcKC9K0Wj"
{"error":{"message":"Invalid URL (GET /v1)","type":"invalid_request_error","code":""}}
AI 解决方案
报错分析报告
1.错误翻译
原文:Invalid URL (GET /v1)
译文:无效的URL(GET /v1)
2. 原因分析
/v1不符合DMXAPI平台规范(平台不接受直接访问根路径/v1)。 https://www.dmxapi.cn/v1,缺少具体资源路径(如/chat/completions)。3. 解决方案
使用带具体资源路径的正确URL(以聊天接口为例):
curl https://www.dmxapi.cn/v1/chat/completions \
-H "Authorization: Bearer sk-iwSnP9W,,,,8SgvcKC9K0Wj" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"Hello"}]}'
注:需将/chat/completions替换为DMXAPI文档中实际支持的端点(如/models//embeddings等)。
4.️ 预防措施
/v1/xxx而非/v1); ---
请补充具体业务场景的端点需求,或提供更详细的报错上下文。