# Models

Choose which AI models your bots think with, using your own subscription, 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:

- **Sign in** with a ChatGPT or Claude subscription to use the plan you already pay for.
- **Connect API key** for OpenAI, Anthropic, Google, OpenRouter and many others.
- **OpenAI-compatible server URL** for a model you host yourself, such as Ollama or vLLM on your own
  machine. Paste the address, choose **Find models**, and pick one. Under **Advanced** you can set
  its context limit, whether it supports images, and its reasoning effort.
  On a self-hosted install, a server on a private or loopback address such as
  `http://127.0.0.1:11434/v1` needs `MODEL_ALLOW_PRIVATE_ENDPOINT=true` on the API and worker; until
  then connecting says the installation does not allow local model servers. See
  [Self-host models](/docs/self-host-models/#openai-compatible-connections).

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

> [!NOTE]
> On sfcrewai.com you can skip this and choose **Use SFCrew AI credits**, which includes monthly model
> credits. See [Account and billing](/docs/account/).

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

## Subscription account pool scaffold

The account-pool schema, priority/health helpers, reorder RPC and usage ledger are present.
The `runWithFailover` helper is not connected to run execution, so these additions do not yet
make a running bot rotate subscription accounts or populate failover history automatically.
Account-pool priority controls remain a scaffold until that execution wiring is implemented
and verified. This is separate from the existing model fallback list above.

Assisted client subscription setup reuses the account connection flow. Pasting client tokens
remains disabled; integrating these branches does not enable that route.

## 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 **Advanced**, 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.


## 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 or
require an environment variable. 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 private-endpoint opt-in, HTTPS,
redirect and custom-header checks apply to every protocol.
