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

# Using BeatAPI in Chub AI

> Configure BeatAPI in Chub AI's Secrets Reverse Proxy using the exact /v1 rule for OpenAI-compatible models and the bare host rule for Claude models.

Chub AI (`chub.ai`, Web / iOS / Android) lets you chat directly on community character cards and lorebooks through its **Secrets** menu. The main setup trap in Chub AI is that its **OpenAI** and **Anthropic** Reverse Proxy fields append different path prefixes, so they require different BeatAPI URL formats.

## OpenAI vs Anthropic Reverse Proxy URLs in Chub AI

Create a dedicated BeatAPI key with a quota cap in [Dashboard → API Keys](https://beatapi.io/dashboard/apikeys), then open **`≡` → Secrets** in Chub AI, toggle **Reverse Proxy** on, and match the URL to the tab:

| Chub AI Secrets tab | Reverse Proxy URL                                                                      | Why the suffix differs              | BeatAPI models                                                                 |
| ------------------- | -------------------------------------------------------------------------------------- | ----------------------------------- | ------------------------------------------------------------------------------ |
| **OpenAI**          | `https://direct.beatapi.io/v1` (East/Southeast Asia: `https://api-asia.beatapi.io/v1`) | Chub AI appends `/chat/completions` | DeepSeek, Gemini, Grok, MiniMax, GLM, GPT, Qwen, Kimi, `-free` models          |
| **Anthropic**       | `https://direct.beatapi.io` (East/Southeast Asia: `https://api-asia.beatapi.io`)       | Chub AI appends `/v1/messages`      | `claude-sonnet-5-5`, `claude-opus-5-5`, `claude-haiku-5-5`, `claude-fable-5-2` |

Adding `/v1` under Chub AI's **Anthropic** tab doubles the path into `/v1/v1/messages` and returns `404`. Omitting `/v1` under Chub AI's **OpenAI** tab also returns `404`.

## Selecting a model and generation cap inside a chat

1. Paste the BeatAPI key into the selected tab in **Secrets** and save.
2. Open any character card, open the chat's API settings, and enter an exact case-sensitive BeatAPI model ID (test at zero balance with `deepseek-v4.1-flash-free` or `glm-5.3-flash-free` under the OpenAI tab, or use paid IDs from the [Text API reference](/text-api) and [pricing page](https://beatapi.io/pricing)).
3. Keep **Streaming** enabled and cap `max_tokens` at `2000`–`4096` (`4096`–`8192` for reasoning models) so small balances clear BeatAPI's `max_tokens` pre-check.

## Related troubleshooting

* [Claude 404 in roleplay apps](/faq/roleplay-claude-404)
* [Roleplay timeouts and cut-offs](/faq/roleplay-timeout-truncation)
* [Reasoning `<think>` cut-offs & loops](/faq/roleplay-thinking-tags-cutoff)
* [402 error from oversized max_tokens](/faq/roleplay-max-tokens-402)