Bring Your Own Key (BYOK)
BYOK lets you power your Chatty bot with your own API key from OpenAI, Anthropic, or OpenRouter — your key, your quota, your cost.
BYOK replies skip Chatty's agentic tool-calling (lead capture, calendar booking, and other actions) — that stays Gemini-only, since each provider's function-calling schema differs enough that wiring them all in is separate work. BYOK replies are still knowledge-base-grounded (the same RAG-augmented system prompt is used), just without the ability to take actions mid-conversation.
Why BYOK?
- Your billing — inference charges go directly to your AI provider account.
- Your quota — no shared rate limits with other Chatty users.
- Model access — use whatever model your provider account supports.
- Data agreements — some enterprise AI contracts require that API calls originate from your own key.
Supported providers
| Provider | Default model (if you don't set one) |
|---|---|
| OpenAI | gpt-4o |
| Anthropic | claude-3-5-sonnet-latest |
| OpenRouter | mistralai/mistral-large — or any model listed at openrouter.ai/models |
You can set any specific model your provider account supports (e.g. gpt-4o-mini, claude-opus-4-8) — it isn't validated against a fixed list, so double-check the model name is one your provider actually serves.
Setting up BYOK
BYOK is configured from the dashboard — it's tied to your logged-in account, not the public API key system used elsewhere in these docs.
- Go to Dashboard → Settings → AI Model
- Select your provider and (optionally) a specific model
- Paste your API key into the Your API Key field
- Click Save — the key is encrypted at rest before storage
To remove BYOK and revert to Chatty's shared Gemini model, clear the provider/key fields and save again.
Security model
- Keys are encrypted at rest with Fernet (symmetric AES-128-CBC + HMAC) before being stored in the database.
- The encryption key (
BYOK_ENCRYPTION_KEY) is a secret stored in the server environment, never in the database. - All AI provider calls are made server-side — your key is never exposed to the browser.
GET-ing your BYOK status never returns the decrypted key — only the provider/model and whether one is configured.
Cost considerations
When BYOK is active, AI inference costs are billed directly to your provider account. Chatty still charges your subscription for platform usage (bots, seats, storage, support) but not for token consumption.