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.xAI API key for Grok models (Grok 3, Grok 4, Grok Code)Get your key: console.x.ai
OpenAI API key for GPT modelsGet your key: platform.openai.com/api-keys
Anthropic API key for Claude models (Haiku, Sonnet, Opus)Get your key: console.anthropic.com
Groq API key for fast inferenceGet your key: console.groq.com
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
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
PostgreSQL database connection URLFormat:
postgresql://user:password@host:port/databaseExample: postgresql://postgres:password@localhost:5432/sciraFor production, use a managed PostgreSQL service like:Redis connection URL for serverless caching and rate limitingFormat:
redis://default:password@host:portRecommended: Upstash Redis for serverless RedisVercel 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
Secret key for Better Auth session encryptionGenerate a secure random string:
GitHub OAuth
GitHub OAuth application client IDCreate an OAuth app: github.com/settings/developersSet callback URL to:
https://yourdomain.com/api/auth/callback/githubGitHub OAuth application client secret
Google OAuth
Google OAuth 2.0 client IDCreate OAuth credentials: console.cloud.google.com/apis/credentialsSet authorized redirect URI to:
https://yourdomain.com/api/auth/callback/googleGoogle OAuth 2.0 client secret
Twitter/X OAuth
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/twitterTwitter/X OAuth 2.0 client secret
Search & Web APIs
Tavily API key for web search and financial newsGet your key: tavily.com
Exa API key for AI-powered web search, academic search, and content retrievalRequired for: Web search featureGet your key: exa.ai
Firecrawl API key for web scraping with structured extractionGet your key: firecrawl.dev
Supadata API key for YouTube search, transcripts, and social media contentGet your key: supadata.ai
Media & Entertainment
The Movie Database (TMDB) API key for movie and TV show dataGet your key: themoviedb.org/settings/api
YouTube endpoint for video search and transcript extraction
ElevenLabs API key for voice synthesis (Pro feature)Get your key: elevenlabs.io
Maps & Location
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
Mapbox access token for map renderingGet your token: mapbox.com/account/access-tokens
TripAdvisor API key for location and travel dataGet your key: tripadvisor.com/developers
Weather & Aviation
OpenWeatherMap API key for weather data and forecastsGet your key: openweathermap.org/api
Aviation Stack API key for flight trackingGet your key: aviationstack.com
Memory & MCP
Supermemory API key for memory management and connector search (Pro feature)Enables searching connected Google Drive, Notion, and OneDrive.Get your key: supermemory.ai
Smithery API key for Model Context Protocol (MCP) integrationGet your key: smithery.ai
Cron & Security
Secret key for authenticating cron job requestsUsed by Lookouts (scheduled research agents) to authenticate scheduled executions.Generate a secure random string:
Subscription & Payments
Polar webhook secret for verifying webhook signatures
Product ID for Starter subscription tier (Polar)
Product slug for Starter subscription tier (Polar)
Dodo Payments API key for premium subscription managementGet your key: dodopayments.com
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.
Public Mapbox token for client-side map renderingGet your token: mapbox.com/account/access-tokens
Public Google Maps API key for client-side maps
PostHog project API key for analyticsGet your key: posthog.com
PostHog API host URLDefault:
https://app.posthog.comPublic API key for Scira client features
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.
