> 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.

# 在 OMate 中使用 BeatAPI

> 在 OMate（OMate Chat）中用同一把 BeatAPI 密钥分别配置主力剧情模型与内置长期记忆摘要模型，在手机端控制长篇聊天费用。

OMate（OMate Chat）在 iOS 和 Android 上兼容酒馆角色卡、世界书与预设，并内置**长期记忆自动摘要**功能。OMate 会在对话后台定期发起摘要请求，因此在 OMate 中用同一把 BeatAPI 密钥同时配置主力剧情模型与低价摘要模型，可以在保住文笔的同时压低长篇聊天的后台消耗。

## 在 OMate 中添加主副两组模型

先在[控制台 → API 密钥](https://beatapi.io/zh/dashboard/apikeys)为 OMate 创建一把带额度上限的专用密钥，再打开 OMate 的 **设置 → API / 模型配置**，用这把密钥添加两条配置：

| OMate 用途       | 协议类型                               | Base URL                                                             | 常用 BeatAPI 模型 ID                                           |
| -------------- | ---------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------- |
| 主力剧情对话         | OpenAI 兼容 / 自定义                    | `https://api-asia.beatapi.io/v1`（海外用 `https://direct.beatapi.io/v1`） | `deepseek-v4-pro-0813`、`gemini-4-neon`、`MiniMax-M3`        |
| 主力剧情对话（Claude） | Anthropic / Claude（需当前 OMate 版本支持） | `https://api-asia.beatapi.io/v1`（海外用 `https://direct.beatapi.io/v1`） | `claude-sonnet-5-5`、`claude-opus-5-5`                      |
| 长期记忆摘要         | OpenAI 兼容 / 自定义                    | `https://api-asia.beatapi.io/v1`（海外用 `https://direct.beatapi.io/v1`） | `glm-5.3-flash`、`deepseek-v4.1-flash`、`MiniMax-M3.1-Flash` |

首次测试连通性时，可在 OpenAI 兼容配置里先填 `deepseek-v4.1-flash-free` 或 `glm-5.3-flash-free` 零余额跑通。完整模型 ID 见[文本 API 参考](/zh/text-api)，实时单价见[价格页](https://beatapi.io/zh/pricing)。

## 绑定摘要模型并核对分模型用量

1. 在角色对话界面选用主力模型，开启 **流式输出（Streaming）**，将 `max_tokens` 设为 `2000`–`4096`（推理模型设 `4096`–`8192`），避免小余额账户因过大上限触发 `402 insufficient_credits`。
2. 在 OMate 的**长期记忆 / 自动总结**设置里，把摘要任务指定为低价轻量模型配置。
3. 发一轮正常对话并手动触发一次记忆摘要，在[控制台](https://beatapi.io/zh/dashboard)核对 `by_model` 中分别出现了主力模型与摘要模型的记录。

## 相关指南与排错

* [搭建低成本高文笔的双模型角色扮演工作流](/zh/guides/roleplay-dual-model-workflow)
* [长篇剧情防失忆与前缀缓存控费指南](/zh/guides/roleplay-long-memory-cache)
* [角色扮演客户端调 Claude 报 404](/zh/faq/roleplay-claude-404)
* [角色扮演超时与回复截断](/zh/faq/roleplay-timeout-truncation)
* [max_tokens 过大触发 402](/zh/faq/roleplay-max-tokens-402)