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

> Use BeatAPI as the chat model behind an AnythingLLM workspace and keep documents and embeddings local.

# Using BeatAPI in AnythingLLM

AnythingLLM builds a private knowledge base over your own documents and answers questions against them. BeatAPI supplies the chat model through its **Generic OpenAI** provider; the documents and the vector index stay wherever you deploy AnythingLLM.

## Prerequisites

1. **AnythingLLM installed** — desktop build for Windows, macOS, or Linux, or a Docker deployment.
2. **A BeatAPI API key** — create one in [Dashboard → API Keys](https://beatapi.io/dashboard/apikeys).

## Step 1: Open LLM settings

Launch AnythingLLM and click **Open settings** at the bottom left, then **LLM Preference** in the left menu.

## Step 2: Configure BeatAPI

Select **Generic OpenAI** as the LLM Provider, then fill in:

| Field      | Value                                     |
| ---------- | ----------------------------------------- |
| API Key    | Your BeatAPI API key                      |
| Base URL   | `https://api.beatapi.io/v1`               |
| Chat Model | A model ID, for example `claude-sonnet-5` |

> **Note**
>
> The Base URL here **does** include `/v1`, and nothing after it. AnythingLLM appends `/chat/completions`.

Click **Save**. AnythingLLM tests the connection and reports the result.

| Model ID           | Choose it for                                           |
| ------------------ | ------------------------------------------------------- |
| `claude-sonnet-5`  | Balanced quality and cost for document Q\&A             |
| `claude-fable-5-1` | The newest generation, for demanding synthesis          |
| `gpt-5.6-terra`    | A strong general alternative                            |
| `gemini-3.7-flash` | Fast and inexpensive over large document sets           |
| `glm-5.3-flash`    | The cheapest tier for high query volume                 |
| `kimi-k3`          | Long context, useful when retrieval returns many chunks |

The full catalogue is on the [Text API](/text-api) pages and the [pricing page](https://beatapi.io/pricing).

## Step 3: Choose an embedding model

> **Note**
>
> **BeatAPI does not serve an embeddings endpoint.** Leave the Embedding Provider on AnythingLLM's built-in embedder, or point it at a service that offers one. Configuring **Generic OpenAI** under Embedding Preference with the BeatAPI base URL will fail, because `/v1/embeddings` is not part of the published surface.

AnythingLLM ships with a local embedder that runs on the same machine and needs no key. For a private knowledge base that is usually the better answer anyway: the document text never leaves the deployment, and only the retrieved excerpts are sent to the chat model.

## Step 4: Create a workspace and add documents

1. Click **+ New Workspace** and name it.
2. Click **Upload Documents** and add files, or drag them in.
3. Wait for processing — documents are chunked and embedded locally.

Supported inputs include `.txt`, `.md`, `.pdf`, `.docx`, source files, `.csv`, `.json`, and pages fetched by URL.

## Step 5: Ask questions

Type a question in the workspace. AnythingLLM retrieves relevant chunks from your documents and sends them to the BeatAPI model together with the question.

Each workspace has its own documents, its own system prompt, and its own history, so one deployment can serve several unrelated knowledge bases.

## FAQ

### AnythingLLM cannot connect

1. Base URL must be `https://api.beatapi.io/v1` — with `/v1`, no trailing slash.
2. Confirm the key is active in [Dashboard → API Keys](https://beatapi.io/dashboard/apikeys).
3. For a Docker deployment, confirm the container itself can reach `api.beatapi.io`; a desktop test proves nothing about the container's network.

### Embedding configuration fails

Expected — see Step 3. BeatAPI serves chat, not embeddings. Use the built-in embedder.

### Retrieval returns nothing useful

That is a retrieval problem, not a model problem. Re-upload after checking the document parsed correctly, lower the similarity threshold, or raise the number of returned chunks in workspace settings. Changing the chat model will not fix an empty retrieval.

### Answers are slow

Move to a faster tier — `gemini-3.7-flash` or `glm-5.3-flash` — and reduce how many chunks are retrieved per question. Retrieval size drives the input token count directly.

### 402 insufficient_credits

Insufficient balance: the balance is zero or below the price of the request. Top up from the dashboard.

### Checking usage and spend

The dashboard shows calls, tokens, and cost per API key; the same figures come from [`GET /v1/usage`](/quick-guide). Give AnythingLLM its own key so its consumption is separable from everything else.

## Support

Open a support ticket from the [dashboard](https://beatapi.io/dashboard) and include the `request_id` from the failing response.