Bring your own key
One variable. The provider is read from the key itself:
| Key looks like | Provider | Default model |
|---|---|---|
sk-ant-... | Anthropic | claude-haiku-4-5 |
sk-or-... | OpenRouter | openai/gpt-5-nano |
sk-... | OpenAI | gpt-5.4-mini |
AIza... | Google Gemini | gemini-2.5-flash |
vck_... | Vercel AI Gateway | openai/gpt-5-nano |
gsk_... | Groq | llama-3.3-70b-versatile |
xai-... | xAI | grok-4-fast-non-reasoning |
Create the key with a spending limit where the provider offers one: OpenRouter can cap the credits a key may spend, OpenAI has usage limits per project. The key never reaches the browser, but the chat itself is open to anyone who has your URL, so the cap is what bounds the cost.
Set CHAT_MODEL to use a different model. For Mistral or DeepSeek, whose keys have no recognisable shape, add AI_PROVIDER=mistral or AI_PROVIDER=deepseek. For any OpenAI-compatible server (Ollama, LM Studio, vLLM, LiteLLM, Together) set AI_BASE_URL and CHAT_MODEL. Every provider's usual variable (OPENAI_API_KEY, ANTHROPIC_API_KEY, ...) works too. See .env.example.
Source captured: 2026-10-11