.env.example to .env.local and fill in each value before running the app.
Required variables
API key for OpenAI. Used for all chat models (
gpt-4o-mini, gpt-4o, gpt-4-turbo) and image generation (dall-e-2, dall-e-3).Obtain your key from the OpenAI API keys page.A random secret used to sign and encrypt session tokens. Must be at least 32 characters long.Generate one with:You can also use the Vercel secret generator.
PostgreSQL connection string for the application database. Required at runtime and during migrations.Example format:See the database setup guide for instructions on provisioning a Vercel Postgres (Neon) database.
Optional variables
API key for Fireworks AI. Required only if you want to use the reasoning model (
deepseek-r1). If omitted, the reasoning model option will be unavailable in the UI, but all other models continue to work normally.Obtain your key from the Fireworks AI API keys page.Access token for Vercel Blob storage. Required if you want users to be able to upload files (images, attachments) in the chat interface.When deploying to Vercel, this token is automatically created and injected when you add a Blob store to your project. For local development, copy the token from your Vercel project’s environment variables.
Without this token, file upload functionality will not work, but the rest of the app operates normally.
Full .env.local example
.env.local