本人在用 Yuan API / Yuan Image 中转做 Claude 兼容调用,分享可复现步骤(非站方广告)。
文档:https://doc.apixhm.com 对话 Base:https://api.apixhm.com 生图 Base:https://image.apixhm.com
步骤: ① 文档站创建 API Key(勿把 Key 发到论坛) ② OpenAI 兼容客户端 Base URL 设为 https://api.apixhm.com/v1 ,填自己的 Key ③ Claude 系模型名按文档列表选 ④ 生图把 Base 换成 https://image.apixhm.com
示例: curl https://api.apixhm.com/v1/chat/completions \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"claude-3-5-sonnet","messages":[{"role":"user","content":"用三句话说明兼容接口"}]}'
欢迎补充踩坑。