Configuration
Which API keys do I need to self-host?
Section titled “Which API keys do I need to self-host?”Three secrets are required:
| Secret | What it is |
|---|---|
ANTHROPIC_API_KEY |
Your Anthropic API key. AnswerKit uses Claude to write answers and handoff summaries, and bills nothing on top. |
ADMIN_PASSWORD |
The password for the admin dashboard (at least 8 characters). |
AUTH_SECRET |
A random secret that signs admin sessions (at least 16 characters). |
Everything else is optional. Embeddings and vector search run on your own Cloudflare account through Workers AI and Vectorize, so they need no extra key.
Set secrets with npx wrangler secret put NAME. For local development, put them in .dev.vars.
Optional settings
Section titled “Optional settings”| Setting | Default | Purpose |
|---|---|---|
ADMIN_EMAIL |
admin@answerkit.local |
The email you sign in with. |
ANSWER_MODEL |
claude-haiku-4-5-20251001 |
Model for answers. Each bot can override it. See Other models. |
SUMMARY_MODEL |
the answer model | Claude model for handoff summaries. |
DEFAULT_CONFIDENCE_THRESHOLD |
0.6 |
Below this retrieval score or model confidence, the bot offers a person. Each bot can override it. |
MAX_MESSAGES_PER_CONVERSATION |
30 |
Messages per conversation before the visitor must start a new one. |
SLACK_WEBHOOK_URL |
none | Default Slack incoming webhook for handoffs, used when a bot has none. |
SUPPORT_EMAIL |
none | Default address for handoff email, used when a bot has none. |
RESEND_API_KEY |
none | Resend key for handoff email. |
EMAIL_FROM |
none | Sender for handoff email, on a domain verified in Resend. |
TURNSTILE_SITE_KEY |
none | Cloudflare Turnstile site key. The widget loads it automatically. |
TURNSTILE_SECRET |
none | Turnstile secret. When set, every new conversation must pass Turnstile. |
RATE_LIMIT_IP_PER_MIN |
20 |
Chat messages per minute per visitor IP. |
RATE_LIMIT_VISITOR_PER_MIN |
10 |
Chat messages per minute per visitor. |
RATE_LIMIT_BOT_PER_MIN |
120 |
Chat messages per minute per bot. |
Using other models through OpenRouter
Section titled “Using other models through OpenRouter”Set OPENROUTER_API_KEY, then use a model name that starts with openrouter:, such as openrouter:google/gemini-2.5-flash, as ANSWER_MODEL, SUMMARY_MODEL, or a bot’s model on its Setup tab. Requests go through OpenRouter’s chat API, only to endpoints that support structured output. Set OPENROUTER_ZDR to true to route only to providers that keep no data.
Not every model answers as reliably as Claude. Run the evals (see the repository’s docs/EVALS.md) before switching a bot’s model, and keep the old model if the pass rate drops.
Can I use Firecrawl instead of the built-in crawler?
Section titled “Can I use Firecrawl instead of the built-in crawler?”Not yet. AnswerKit crawls with a plain fetch scraper, and falls back to Cloudflare Browser Rendering for pages that only render with JavaScript. The scraper is built behind a provider interface so that Firecrawl and Context.dev can be added, and SCRAPER_PROVIDER and SCRAPER_API_KEY are reserved for them, but today fetch is the only provider. Setting SCRAPER_PROVIDER to anything else disables POST /v1/scrape.
Per-bot settings
Section titled “Per-bot settings”Set these on the bot’s Setup tab in the dashboard:
- Allowed domains: the sites that may embed the widget. See Security.
- Handoff email and Slack webhook: where handoffs are sent. See Human handoff.
- Model and confidence threshold: override the defaults above.
Each source also has a page limit, set when you add it (default 50).