Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Wikedhart18/nextjs-ai-chatbot/llms.txt

Use this file to discover all available pages before exploring further.

Copy .env.example to .env.local and fill in each value before running the app.
cp .env.example .env.local
Never commit .env.local to version control. It contains secrets that must stay private.

Required variables

OPENAI_API_KEY
string
required
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.
AUTH_SECRET
string
required
A random secret used to sign and encrypt session tokens. Must be at least 32 characters long.Generate one with:
openssl rand -base64 32
You can also use the Vercel secret generator.
POSTGRES_URL
string
required
PostgreSQL connection string for the application database. Required at runtime and during migrations.Example format:
postgres://user:password@host:5432/dbname
See the database setup guide for instructions on provisioning a Vercel Postgres (Neon) database.

Optional variables

FIREWORKS_API_KEY
string
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.
BLOB_READ_WRITE_TOKEN
string
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
# OpenAI — chat and image models
OPENAI_API_KEY=sk-...

# Fireworks AI — reasoning model
FIREWORKS_API_KEY=fw_...

# Auth session secret
AUTH_SECRET=your-generated-secret-here

# Vercel Blob — file uploads
BLOB_READ_WRITE_TOKEN=vercel_blob_rw_...

# Postgres — database
POSTGRES_URL=postgres://user:password@host:5432/dbname

Build docs developers (and LLMs) love