chat01.ai如何在cherry studio中使用api

Criado em: 30 de junho de 2025

Respondido usando O3 por Chat01

Pergunta

chat01.ai如何在cherry studio中使用api

Pensamento

Providing guidance on chat01 API integration

To integrate chat01 with Cherry Studio, follow these steps:

  1. Obtain chat01 API key and configure Cherry Studio (Settings > API Configuration).
  2. Set base URL as "https://chat01.ai/v1" and path "/chat/completions" for communication.
  3. For advanced features like streaming, use "stream": true in the request.
  4. Disclaim potential issues such as CORS errors and provide a Python code snippet example.

Also, as chat01 uses the same format as OpenAI, suggest restful endpoints. If questions arise, we can provide further support in Chinese.

Providing Cherry Studio API Integration Guide

To set up chat01.ai API with Cherry Studio:

  1. Overview: Cherry Studio 3.x supports custom OpenAI-compatible APIs like chat01.ai; just change the base URL.
  2. Get API Key: Sign in to chat01.ai, navigate to “API” > “API Keys”.
  3. Configure Cherry Studio: Go to Settings > API configuration, choose "Custom Provider", and set the base URL as "https://chat01.ai/v1".
  4. Test Connection.
  5. **

Thought for 1m 24s

Resposta

下面是一套从零到能跑通的思路,帮你把 chat01.ai 的 API 接进 Cherry Studio。步骤全部用中文说明,并给出可直接复制的示例代码。


1 获取 chat01.ai 的 API 密钥

  1. 访问 chat01.ai 并登陆 → 右上角 “API Keys”
  2. 点击 “Create Key”,为它起个名字并保存。
  3. 复制得到的 Bearer Key(务必保存;页面只显示一次)。

注意:若后面提示 “key is not registered in the system” ,多半是键入错误或密钥已作废,需要回到控制台重新生成。chat01.ai


2 在 Cherry Studio 里添加自定义 API

  1. 打开 设置 (Settings) → API 配置 (API Config)
  2. “添加新配置 / Add New”,类型选 “自定义 OpenAI-兼容”
  3. 在表单中填:
字段填写内容
API Key粘贴上一步复制的 Bearer Key
Base URLhttps://chat01.ai/v1
接口路径/chat/completions(大多数版本会自动补全,只要 Base URL 正确即可)
组织 ID / Org留空 (chat01 不要求)
  1. “测试连接 / Test” → 出现 “Connection successful”。
  2. 点击 保存ren-model-api.github.io

3 选择模型并调整参数

Cherry Studio 会读取兼容模型列表,常见可用值:

  • o1 / o1-pro(入门)
  • o3-mini / o3-mini-high(数学、写代码更强)

如果你只看到一个下拉框,可手动输入模型名。Base URL 写对后,这些模型都会正常返回。 linux.do

可根据需求调节:

参数建议
temperature0.1-0.3 准、0.7-0.9 更具创造力
max_tokens输出越长设得越高
stream设 true 即可在 Cherry Studio 中看到流式滚动

4 跑一段最小可行代码(Python 示例)

python
import requests, json API_KEY = "你的 chat01 Key" BASE_URL = "https://chat01.ai/v1" headers = { "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" } payload = { "model": "o3-mini", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "用三句话介绍一下量子计算。"} ], "temperature": 0.5, "stream": False # 需要流式时改成 True } resp = requests.post(f"{BASE_URL}/chat/completions", headers=headers, data=json.dumps(payload), timeout=60) print(resp.json()["choices"][0]["message"]["content"])

只要这段能拿到返回,就说明你的 Cherry Studio 配置也会正常工作。


5 常见问题速查

症状解决办法
The key is not registered确认 API Key 与账号匹配,或者重新生成密钥。chat01.ai
连接测试失败检查 Base URL 是否为 https://chat01.ai/v1 且网络能通;代理环境记得把 Cherry Studio 加到白名单。
响应超时 / 很慢timeout 调到 30-60 s;减少 max_tokens;或关掉 stream 先确认能返回完整 JSON。
模型列表为空直接在模型字段手动输入 o3-mini 等模型名即可。

小结

  • Cherry Studio 只认 OpenAI-兼容协议,而 chat01.ai 正好 100% 兼容(路径 /chat/completions,HTTP Bearer 鉴权)。
  • 关键配置就三处:API Key、Base URL、模型名
  • 一旦连接测试通过,后面无论是写 Prompt、长文生成还是代码补全,都跟用官方 OpenAI 没区别。

如果在集成过程中遇到别的错误,把具体报错贴给我,我再帮你定位!

Compartilhar esta Q&A