最近在 Cherry Studio 里把对话和生图都接到同一套 OpenAI 兼容中转,记录一下可复现步骤。
## 1. 准备
- 对话 Base URL:https://api.apixhm.com
- 生图 Base URL:https://image.apixhm.com
- 文档:https://doc.apixhm.com
- 在中转后台创建 API Key(只放本地/环境变量,别贴到帖子里)
## 2. Cherry Studio 对话
1. 打开 Cherry Studio → 设置 → 模型服务 → 添加 OpenAI 兼容
2. API Host 填:https://api.apixhm.com/v1 (若客户端已自动拼 /v1,则只填 https://api.apixhm.com)
3. API Key 填你的密钥;模型名按文档选(如 gpt-4o-mini / claude 系列等)
4. 新建对话,发一句「用三句话介绍 OpenAI 兼容接口」验证
## 3. 生图(同一套 Key 体系)
示例(curl,把 YOUR_KEY 换成本地密钥):
curl https://image.apixhm.com/v1/images/generations \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"dall-e-3","prompt":"a minimal desk with a laptop, soft light","size":"1024x1024"}'
也可在支持 OpenAI Image 的客户端里把 Base URL 指到 https://image.apixhm.com 。
## 4. 注意
- 超时/429:降低并发,确认套餐额度
- 模型名以 https://doc.apixhm.com 为准
- 密钥不要提交到公开仓库
有在 Xiuno 站务/插件里接过兼容 API 的朋友,欢迎补充踩坑。
暂无评论