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

# Run a dual-model roleplay workflow for writing quality and lower cost

> Pair one primary writing model with a low-cost background model on BeatAPI for memory summaries, lorebook extraction, and status panels in SillyTavern and OMate.

A roleplay client sends two distinct classes of model requests: **in-character dialogue** (where prose style and character voice matter) and **background utilities** (chat summarization, memory compression, lorebook extraction, and status-panel updates, where concise factual output is the goal). Sending both classes to one flagship model multiplies background token cost. Splitting them across two BeatAPI models under one API key preserves dialogue quality while keeping utility token spend low.

## Deliverable and verification standard

A completed dual-model setup routes two workloads under one BeatAPI API key:

1. **Primary dialogue turns** run on a high-prose model (such as `claude-sonnet-5-5`, `gemini-4-neon`, or `deepseek-v4-pro-0813`).
2. **Background summarization and utility tasks** run on a flash-tier model (such as `glm-5.3-flash`, `deepseek-v4.1-flash`, or `MiniMax-M3.1-Flash`).

The workflow is verified when one dialogue turn and one manual summary both return without error and appear under two distinct model IDs in [Dashboard → Usage](https://beatapi.io/dashboard) (`by_model`).

## Step 1: Choose your model pair

All models in the table share one BeatAPI account, one USD balance, and one API key. Base prices are USD per 1M tokens (verify live rates on the [pricing page](https://beatapi.io/pricing)):

| Role                            | BeatAPI model ID       | Protocol                                         | Base price (input / output per 1M) |
| ------------------------------- | ---------------------- | ------------------------------------------------ | ---------------------------------- |
| Primary dialogue (prose nuance) | `claude-sonnet-5-5`    | Anthropic Messages (`/v1/messages`)              | $0.70 / $3.50                      |
| Primary dialogue (long context) | `gemini-4-neon`        | OpenAI Chat Completions (`/v1/chat/completions`) | $0.90 / $4.50                      |
| Primary dialogue (budget)       | `deepseek-v4-pro-0813` | OpenAI Chat Completions (`/v1/chat/completions`) | $0.33 / $0.99                      |
| Background summary / memory     | `glm-5.3-flash`        | OpenAI Chat Completions (`/v1/chat/completions`) | $0.06 / $0.20                      |
| Background summary / memory     | `MiniMax-M3.1-Flash`   | OpenAI Chat Completions (`/v1/chat/completions`) | $0.06 / $0.24                      |
| Background summary / memory     | `deepseek-v4.1-flash`  | OpenAI Chat Completions (`/v1/chat/completions`) | $0.075 / $0.30                     |

## Step 2: Create a dedicated key with a budget cap

1. Open [Dashboard → API Keys](https://beatapi.io/dashboard/apikeys) and create a key named after your client (for example `sillytavern-rp` or `omate-mobile`).
2. Set a quota cap on that key to enforce a monthly spend ceiling.
3. Use `https://direct.beatapi.io/v1` (or `https://api-asia.beatapi.io/v1` in East and Southeast Asia) as the Base URL for both models.

## Step 3: Wire both models in your client

### In SillyTavern

1. Configure the **primary model** in **API Connections** following [Using BeatAPI in SillyTavern](/integrations/sillytavern).
2. Save the primary configuration as a **Connection Profile** (for example `BeatAPI-Primary`).
3. Create a second Connection Profile (`BeatAPI-Summary`) using `Custom (OpenAI-compatible)`, Base URL `https://direct.beatapi.io/v1` (or `https://api-asia.beatapi.io/v1`), the same BeatAPI key, and Model ID `glm-5.3-flash` or `deepseek-v4.1-flash`.
4. Open SillyTavern's **Summarize** extension (or memory plugin), assign **Connection Profile** to `BeatAPI-Summary`, and cap summary `max_tokens` at `600`–`1000`.

### In OMate

1. Add both the primary model and a flash-tier summary model under **Settings → API / Model Settings** following [Using BeatAPI in OMate](/integrations/omate).
2. Select the primary model for the character chat.
3. In OMate's **Long-Term Memory / Summary** settings, assign the summary task to `glm-5.3-flash`, `MiniMax-M3.1-Flash`, or `deepseek-v4.1-flash`.

## Step 4: Verify split billing

1. Send one normal in-character message and confirm the reply streams from the primary model.
2. Trigger one manual chat summary and confirm the summary returns concisely without truncation.
3. Open [Dashboard → Usage](https://beatapi.io/dashboard) or call `GET /v1/usage` with the client key. Confirm that `by_model` records both the primary model ID and the flash-tier summary model ID separately.

## Related

* [Keep long roleplay memory consistent while controlling token cost](/guides/roleplay-long-memory-cache)
* [Cost optimization](/faq/cost-optimization)
* [402 error from oversized max_tokens](/faq/roleplay-max-tokens-402)