# AI provider keys

> Run your business bot on your own Anthropic, OpenAI or OpenAI-compatible key, with a monthly spending cap.

# AI provider keys

Your [AI bot](https://docs.facia.chat/business/ai) can run on your own AI account. You pay your provider directly, and Facia shows the spend and stops at your monthly cap.

**HQ → Settings → AI** (`page=ai`). Owners and admins can see it, but only the **owner** can change it. If the page says the AI assistant isn't available for your business, ask Facia support.

## Providers

| Provider | Where to get a key | Models Facia suggests |
| --- | --- | --- |
| **Anthropic** (Claude) | [console.anthropic.com](https://console.anthropic.com) → API keys | Claude Opus 5.5 (best answers), Claude Sonnet 5.5 (fast and capable), Claude Haiku 5.5 (cheapest) |
| **OpenAI** (GPT) | [platform.openai.com](https://platform.openai.com) → API keys | GPT-5, GPT-5 mini (cheaper), GPT-5 nano (cheapest), GPT-4.1 |
| **Your own endpoint** | Any OpenAI-compatible server: vLLM, Ollama, LM Studio, OpenRouter… | Any model id it serves |

You can also type any model id your provider offers.

## Connect a key

1. Create a key at your provider. Give it a name like "Facia" so you can recognise and revoke it later.
2. In Facia, open **HQ → Settings → AI**, pick the provider, and paste the key.
3. Pick a **model**.
4. Set a **monthly cap** in USD (default $20). The bot pauses when this month's estimated spend reaches it. `0` means no cap.
5. **Your own endpoint** only: also give the **base address** (ending in `/v1`, e.g. `https://my-server.example.com/v1`), and your **price in and price out per 1M tokens**, so the cap means something.
6. Save, then turn the bot on in **HQ → Bots**.

The key is stored encrypted, and only its last 4 characters are shown. **Change key or settings** replaces it, and **Remove** deletes it (the bot stops until a new key is added).

## The spend meter

The page shows **This month**: the estimated spend so far. When it reaches the cap, the bot shows **Paused: this month's budget is used up** until the next month or until you raise the cap.

| Typical use | Suggested model | Suggested cap |
| --- | --- | --- |
| Small business, a few questions a day | Claude Haiku 5.5 or GPT-5 mini | $5–10 |
| Busy inbox, receipts read every day | Claude Sonnet 5.5 or GPT-5 | $20–50 |
| Best answers and long reports | Claude Opus 5.5 | $50+ |

Your actual cost depends on how many chats and photos it reads. Start low and raise the cap if it pauses.

## What is sent to your provider

- Conversations and numbers it needs to answer, with clients shown **by alias and tier only**: never names, usernames, phones, emails or devices.
- Receipt photos, for photo reads (with codes shortened).
- Nothing about other businesses.

## Running your own model

With **Your own endpoint**, you can run open models on your own hardware and pay nothing per token. Example with Ollama:

```bash
ollama pull qwen3:14b
OLLAMA_HOST=0.0.0.0 ollama serve
```

Ollama's OpenAI-compatible address is `http://<your-server>:11434/v1`. Put it behind HTTPS (for example a Cloudflare Tunnel) so Facia can reach it, then use that https address as the base address and `qwen3:14b` as the model. Set both prices to `0`.

> [!NOTE]
> If Facia already runs an AI helper for your business, it keeps answering, and your key is only used while that helper is offline. Payment tagging, deals, client notes and nightly notes currently need that helper. See [The AI bot](https://docs.facia.chat/business/ai#privacy).
