1700
目录 · 4 个章节
在 Cherry Studio 里把对话和生图都接到同一套 OpenAI 兼容中转,本地客户端就能切 Claude / GPT,并直接文生图。
1. 准备
- 文档:https://doc.apixhm.com
- 对话 Base URL:https://api.apixhm.com
- 生图 Base URL:https://image.apixhm.com
- 在中转控制台创建 API Key
2. Cherry Studio 接对话(Yuan API)
- 打开 Cherry Studio → 设置 → 模型服务 → 添加 OpenAI 兼容
- API 地址填
https://api.apixhm.com/v1(以文档为准) - 填入 API Key,拉取模型列表,勾选 Claude / GPT 等
- 新建对话选模型,发一条「用三句话解释 Promise」验证
curl https://api.apixhm.com/v1/models \
-H "Authorization: Bearer $API_KEY"
3. 文生图(Yuan Image)
- 同一客户端再加一条 OpenAI 兼容图像服务,Base 用
https://image.apixhm.com - 选文生图模型,提示词示例:
flat illustration of a coffee cup, soft light, simple background - 或直接调兼容接口(路径以文档为准):
curl https://image.apixhm.com/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux","prompt":"flat illustration of a coffee cup","size":"1024x1024"}'
4. 注意
- Key 只放环境变量或客户端本地,勿提交仓库
- 模型名、路径以 https://doc.apixhm.com 最新说明为准
- 适合 Node / 前端本地工作流快速换模型
有坑欢迎回帖。