Copy
.env.example to .env.local (for development) or .env (for production) and configure the required variables.AI API Keys
API keys for AI model providers. At minimum, you need OpenAI and Anthropic.string
xAI API key for Grok models (Grok 3, Grok 4, Grok Code)Get your key: console.x.ai
string
required
OpenAI API key for GPT modelsGet your key: platform.openai.com/api-keys
string
required
Anthropic API key for Claude models (Haiku, Sonnet, Opus)Get your key: console.anthropic.com
string
Groq API key for fast inferenceGet your key: console.groq.com
string
Google API key for Gemini models (Gemini 2.5 Flash, Gemini 2.5 Pro, Gemini 3)Get your key: makersuite.google.com/app/apikey
Development & Sandbox
string
Daytona API key for code execution sandboxEnables the code interpreter tool for executing Python code in a sandboxed environment.Get your key: daytona.io
Database & Storage
string
required
PostgreSQL database connection URLFormat:
postgresql://user:password@host:port/databaseExample: postgresql://postgres:password@localhost:5432/sciraFor production, use a managed PostgreSQL service like:string
required
Redis connection URL for serverless caching and rate limitingFormat:
redis://default:password@host:portRecommended: Upstash Redis for serverless Redisstring
Vercel Blob storage token for file uploadsRequired for storing uploaded files (PDFs, images, etc.) and extreme search artifacts.Get your token: vercel.com/storage/blob
Authentication
string
required
Secret key for Better Auth session encryptionGenerate a secure random string:
GitHub OAuth
string
GitHub OAuth application client IDCreate an OAuth app: github.com/settings/developersSet callback URL to:
https://yourdomain.com/api/auth/callback/githubstring
GitHub OAuth application client secret
Google OAuth
string
Google OAuth 2.0 client IDCreate OAuth credentials: console.cloud.google.com/apis/credentialsSet authorized redirect URI to:
https://yourdomain.com/api/auth/callback/googlestring
Google OAuth 2.0 client secret
Twitter/X OAuth
string
Twitter/X OAuth 2.0 client IDCreate an app: developer.twitter.com/en/portal/projects-and-appsSet callback URL to:
https://yourdomain.com/api/auth/callback/twitterstring
Twitter/X OAuth 2.0 client secret
Search & Web APIs
string
Tavily API key for web search and financial newsGet your key: tavily.com
string
required
Exa API key for AI-powered web search, academic search, and content retrievalRequired for: Web search featureGet your key: exa.ai
string
Firecrawl API key for web scraping with structured extractionGet your key: firecrawl.dev
string
Supadata API key for YouTube search, transcripts, and social media contentGet your key: supadata.ai
Media & Entertainment
string
The Movie Database (TMDB) API key for movie and TV show dataGet your key: themoviedb.org/settings/api
string
YouTube endpoint for video search and transcript extraction
string
ElevenLabs API key for voice synthesis (Pro feature)Get your key: elevenlabs.io
Maps & Location
string
Google Maps API key for geocoding and place discoveryEnable APIs: Maps JavaScript API, Geocoding API, Places APIGet your key: console.cloud.google.com/google/maps-apis
string
Mapbox access token for map renderingGet your token: mapbox.com/account/access-tokens
string
TripAdvisor API key for location and travel dataGet your key: tripadvisor.com/developers
Weather & Aviation
string
OpenWeatherMap API key for weather data and forecastsGet your key: openweathermap.org/api
string
Aviation Stack API key for flight trackingGet your key: aviationstack.com
Memory & MCP
string
Supermemory API key for memory management and connector search (Pro feature)Enables searching connected Google Drive, Notion, and OneDrive.Get your key: supermemory.ai
string
Smithery API key for Model Context Protocol (MCP) integrationGet your key: smithery.ai
Cron & Security
string
Secret key for authenticating cron job requestsUsed by Lookouts (scheduled research agents) to authenticate scheduled executions.Generate a secure random string:
Subscription & Payments
string
Polar webhook secret for verifying webhook signatures
string
Product ID for Starter subscription tier (Polar)
string
Product slug for Starter subscription tier (Polar)
string
Dodo Payments API key for premium subscription managementGet your key: dodopayments.com
string
Dodo Payments webhook secret for verifying webhook signatures
Product ID for Premium subscription tier (Dodo Payments)
Product slug for Premium subscription tier (Dodo Payments)
Client-side Environment Variables
These variables are exposed to the browser with theNEXT_PUBLIC_ prefix.
string
Public Mapbox token for client-side map renderingGet your token: mapbox.com/account/access-tokens
string
Public Google Maps API key for client-side maps
string
PostHog project API key for analyticsGet your key: posthog.com
string
PostHog API host URLDefault:
https://app.posthog.comstring
Public API key for Scira client features
string
Server-side Scira API key for internal API authentication
Environment File Examples
Development (.env.local)
Production (.env)
Security Best Practices
Use strong secrets
Generate secrets with
openssl rand -base64 32Rotate regularly
Rotate API keys and secrets periodically
Limit permissions
Use API keys with minimal required permissions
Monitor usage
Track API usage to detect unauthorized access
Validation
Scira validates environment variables at build time using@t3-oss/env-nextjs. Missing required variables will cause build failures with helpful error messages.
