All docs

AI providers

The chat is built on the Vercel AI SDK with a unified provider layer, so switching model or provider is a configuration change — not a rewrite.

Supported providers

ProviderEnv variableNotes
OpenAIOPENAI_API_KEYGPT-4o, GPT-4o mini
AnthropicANTHROPIC_API_KEYClaude Sonnet, Claude Haiku
GoogleGOOGLE_GENERATIVE_AI_API_KEYGemini Flash — free tier, the default

You only need one key to start chatting. Add it to .env and restart.

The model catalog

Every model the app exposes is listed in — the single source of truth. Each entry has:

  • id"<provider>:<modelId>", the exact key the AI SDK registry expects and the value stored on a conversation
  • label / description — shown in the model selector
  • creditsPerMessage — how many credits a message with this model costs

Add, remove or reprice a model by editing this list; nothing else changes.

ts
{  id: "openai:gpt-4o-mini",  providerId: "openai",  label: "GPT-4o mini",  description: "Fast and affordable",  creditsPerMessage: 1,},

Defaults

  • DEFAULT_MODEL_ID — the model a new conversation starts with (Google Gemini Flash, so the template works on a free key).
  • DEFAULT_SYSTEM_PROMPT — the assistant's base prompt. Rename the assistant here to match your brand.

Where the keys come from

  • OpenAI
  • Anthropic
  • Google