# Models

Choose which AI models your bots think with, using your own API key or a model you run yourself.

## Connect a provider

Open **Settings → Models**. Under **Add provider**, pick a provider and connect it:

- **Connect API key** for OpenAI, Anthropic, Google, OpenRouter and many others.
- **OpenAI-compatible server URL** for a model you host yourself at an HTTPS address the internet
  can reach, such as Ollama or vLLM. Paste the address and its models are found automatically;
  choose one. If none are found, choose **Try again**. Under **Advanced** you can set the protocol
  and custom headers. After you connect, open the model under the provider to set its
  **Context limit**, **Supports images** and **Thinking**.

For project-scoped connections, enter the **Project ID** and **Region** alongside the API key.
Use the region where your model is available; the form starts with `global`. These settings
belong to each connection and are used both when checking the key and when running a bot.

Connected providers are listed under **Providers** and are available in every [space](/docs/spaces/).

Models connect with an API key. Signing in with a consumer plan, such as a ChatGPT or Claude
subscription, is not supported.

> [!NOTE]
> Pepperbot's own model is available only when a Pepperbot admin grants it to your organization.
> See [Beta usage](/docs/account/#beta-usage).

## Main model and fallbacks

**Main model** is what every bot uses unless you choose otherwise. Choose **Add fallback** to list
backup models; if the main model fails or hits a limit, the bot moves to the next one. **Move up**
and **Move down** set the order.

Each model has a **Thinking** level, from **Minimal** to **Max**. Higher thinking is slower and
costs more, and helps on hard, multi-step work.

## Approval model

**Approval model** is the model that checks bot actions when approvals are set to **Auto**. A fast,
inexpensive model works well here. See [Approvals](/docs/approvals/).

## Per bot and per routine

To give one bot a different model, open its settings, expand **Settings**, and choose its
**Model** and **Thinking**. A [routine](/docs/routines/) can also have its own
model, for example a cheaper one for a simple daily check.

> [!TIP]
> Bots that use the computer's screen need a model that can read images. Models that can't are
> marked **Can't read images** in the picker.

## Usage

**Settings → Usage** shows runs, tokens and cost by model. To open it from a bot chat, type `/` at
the start of a draft and choose **Settings: Usage**.

## Compatible server wire protocol

OpenAI-compatible connections default to Chat Completions. For an endpoint that serves another
protocol, the shared `models/connect` RPC accepts `apiProtocol: "responses"` (OpenAI Responses API)
or `apiProtocol: "anthropic-messages"` (Anthropic Messages API) alongside `provider:
"openai-compatible"`, `baseUrl`, and `modelId`. Use `apiProtocol: "chat-completions"` to switch back.
The settings screens offer the same choice as **Protocol** when a custom server URL is connected.
This optional API setting applies to one saved connection; it does not change other connections.
Changing the base URL through the API without specifying a protocol
resets it to Chat Completions.
Anthropic Messages reads the key with Anthropic's own headers and posts to `/v1/messages`, so the
base URL stays the server root, with or without `/v1`. The same HTTPS, redirect and custom-header
checks apply to every protocol.
