> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.beatapi.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.beatapi.io/_mcp/server.

# 在 RisuAI 中使用 BeatAPI

> 在 RisuAI 中通过 Custom API 接入 BeatAPI，掌握 Autofill Request URL 规则、Custom Models 一键切模型，以及用 Auxiliary Model 跑低价 HypaMemory 摘要。

RisuAI（`risuai.net`，支持 Web、桌面端和 Android）在 **Settings → Chat Bot** 下拆出了两个独立槽位：**Model** 跑主力对话，**Auxiliary Model** 跑 HypaMemory 长期记忆总结与翻译。两个槽位都可以通过 **Custom API** 共用一把 BeatAPI API 密钥。

## 主力模型配置与 `Autofill Request URL` 开关

先在[控制台 → API 密钥](https://beatapi.io/zh/dashboard/apikeys)创建一把专用密钥，再打开 RisuAI 的 **Settings → Chat Bot → Model → Custom API**：

| RisuAI 字段          | OpenAI 兼容模型                                                                                 | Claude 模型                                                                              |
| ------------------ | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| **Format**         | `OpenAI Compatible`                                                                         | `Anthropic`                                                                            |
| **URL**            | `https://api-asia.beatapi.io/v1`（海外用 `https://direct.beatapi.io/v1`）                        | `https://api-asia.beatapi.io/v1/messages`（海外用 `https://direct.beatapi.io/v1/messages`） |
| **Key / Password** | BeatAPI API 密钥                                                                              | BeatAPI API 密钥                                                                         |
| **Request Model**  | `deepseek-v4-pro-0813`、`gemini-4-neon`、`grok-4.7`、`MiniMax-M3`、`gpt-6.2-sol` 或 `-free` 测试模型 | `claude-sonnet-5-5`、`claude-opus-5-5`、`claude-haiku-5-5`                               |

RisuAI 默认开启 **Autofill Request URL**，在 `OpenAI Compatible` 模式下会自动在 `/v1` 后面补全 `/chat/completions`。如果你关掉了该开关，直接填完整路径 `https://api-asia.beatapi.io/v1/chat/completions`。

## 多模型一键切换与 HypaMemory 辅助模型

* **保存多个 BeatAPI 模型**：在 **Advanced Settings → Custom Models** 中用同一把密钥保存多条模型配置（例如 `claude-sonnet-5-5`、`gemini-4-neon`、`deepseek-v4-pro-0813`），对话中途即可一键切换。
* **压低 HypaMemory 摘要费用**：在 **Settings → Chat Bot → Auxiliary Model** 中选 **Custom API**（`OpenAI Compatible`、`https://api-asia.beatapi.io/v1`、同一把密钥），模型填 `glm-5.3-flash`、`deepseek-v4.1-flash` 或 `MiniMax-M3.1-Flash`。
* **控制单次回复上限**：开启 **Streaming**，把 **Max Response Size（`max_tokens`）** 设为 `2000`–`4096`（推理模型 `4096`–`8192`），避免小余额账户触发 `402 insufficient_credits`。完整模型 ID 见[文本 API 参考](/zh/text-api)，实时单价见[价格页](https://beatapi.io/zh/pricing)。

## 相关指南与排错

* [搭建低成本高文笔的双模型角色扮演工作流](/zh/guides/roleplay-dual-model-workflow)
* [角色扮演客户端调 Claude 报 404](/zh/faq/roleplay-claude-404)
* [角色扮演超时与回复截断](/zh/faq/roleplay-timeout-truncation)
* [推理模型思维链截断与复读](/zh/faq/roleplay-thinking-tags-cutoff)
* [max_tokens 过大触发 402](/zh/faq/roleplay-max-tokens-402)