> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siflow.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# AstrBot

> 了解如何在 AstrBot 中添加 OpenAI 类型的模型提供商并填写自定义 API Base URL，接入 siflow endpoint，让 QQ、微信、飞书等平台的聊天机器人使用算秩模型。

[AstrBot](https://github.com/AstrBotDevs/AstrBot) 是一款开源的多平台 IM 聊天机器人框架，支持 QQ、微信、飞书、Telegram、钉钉等平台。它支持 OpenAI 兼容的模型服务，因此可以接入算秩模型推理服务。

本文以 `glm-5.2` 为例。完整模型清单与价格见 [模型广场](https://console.siflow.cn/model-inference/models)。

## 配置

在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建一个 API Key。打开 AstrBot 面板 → **模型提供商**，单击 **新增**，选择 **openai（OpenAI 兼容）**，填写：

| 字段           | 值                                                                             |
| ------------ | ----------------------------------------------------------------------------- |
| ID           | 自定义标识，如 `openai`                                                              |
| API Key      | 您在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建的 API Key |
| API Base URL | `https://api.siflow.cn/model-api`                                             |
| 模型           | `glm-5.2`（在提供商配置的模型项中选择/填写）                                                   |

<img src="https://mintcdn.com/siflow/Kc4V-XwlcephFHJ9/model-inference/media/astrbot-provider-config.png?fit=max&auto=format&n=Kc4V-XwlcephFHJ9&q=85&s=988c301c0b49edb199567862d738ceae" alt="AstrBot —— 指向 siflow endpoint 的 OpenAI 兼容提供商" style={{ width: "80%", height: "auto" }} width="3024" height="1654" data-path="model-inference/media/astrbot-provider-config.png" />

保存配置后，在 **机器人** 中新建一个机器人，绑定一个消息平台（QQ、企业微信、飞书、Telegram 等）——例如「个人微信」，按提示扫码登录：

<img src="https://mintcdn.com/siflow/Kc4V-XwlcephFHJ9/model-inference/media/astrbot-create-bot.png?fit=max&auto=format&n=Kc4V-XwlcephFHJ9&q=85&s=f7c059bbdf0f748aa4c21afdd3f2a849" alt="AstrBot —— 新建机器人并绑定消息平台" style={{ width: "60%", height: "auto" }} width="1608" height="1346" data-path="model-inference/media/astrbot-create-bot.png" />

## 验证

在绑定的平台上给机器人发送一条消息，能正常回复即接入成功。

<img src="https://mintcdn.com/siflow/Kc4V-XwlcephFHJ9/model-inference/media/astrbot-chat-reply.png?fit=max&auto=format&n=Kc4V-XwlcephFHJ9&q=85&s=3b2ea77f71087580649b99b62c96afa0" alt="AstrBot —— 机器人通过 siflow endpoint 正常回复" style={{ width: "60%", height: "auto" }} width="1176" height="836" data-path="model-inference/media/astrbot-chat-reply.png" />

## 常见问题

* **API Base URL 填 `https://api.siflow.cn/model-api`**：AstrBot 通过 OpenAI SDK 调用，会自动补 `/chat/completions`；`https://api.siflow.cn/model-api/v1` 同样可用。
* **Docker 部署时不要用 `localhost` 访问面板**：容器网络隔离，需用宿主机 IP（或端口转发）访问 WebUI（默认端口 `6185`）。
* 机器人自我介绍为「运行在 AstrBot 平台上的 AI 助手」是其自带人设，不影响实际调用的是算秩模型。
* 如需工具调用 / 插件能力，选择支持工具调用的模型（`glm-5.2` 可用）。
