Required API Keys
Stanzo integrates with three external services that require API keys:- Deepgram - Real-time speech-to-text transcription
- Google Gemini - AI-powered claim extraction from debate transcripts
- Perplexity - Fact-checking and verification of claims
Local Development Setup
Create environment files
Create two separate environment files in your project root:
.env.local - For Next.js environment variables:.env - For Convex environment variables (managed separately):Next.js and Convex use different environment variable systems. Next.js reads from
.env.local, while Convex environment variables must be set using the Convex CLI.Get Deepgram API Key
Deepgram provides real-time speech-to-text transcription for debate audio.
- Sign up at deepgram.com
- Navigate to your API Keys section
- Create a new API key
- Set it in Convex:
The Deepgram API key is used in
convex/deepgramToken.ts:12 to mint temporary client tokens for browser-based transcription.Get Google Gemini API Key
Google Gemini powers the claim extraction system that identifies factual statements in debate transcripts.
- Visit Google AI Studio
- Create a new API key
- Set it in Convex:
Used in
convex/claimExtraction.ts:119 with the gemini-2.5-flash model to extract verifiable claims from debate transcripts.Get Perplexity API Key
Perplexity provides real-time fact-checking capabilities with source citations.
- Sign up at perplexity.ai
- Navigate to API settings
- Generate a new API key
- Set it in Convex:
Used in
convex/factCheck.ts:107 with the sonar model to verify claims and provide corrections with citations.Set Convex URL
After deploying your Convex backend, set the deployment URL in your Next.js environment:
- Run
npx convex devto get your development URL, ornpx convex deployfor production - Copy the deployment URL (e.g.,
https://your-deployment.convex.cloud) - Add to
.env.local:
Environment Variable Reference
Next.js Environment Variables
Set these in.env.local:
| Variable | Required | Description | Example |
|---|---|---|---|
NEXT_PUBLIC_CONVEX_URL | Yes | Convex deployment URL | https://happy-animal-123.convex.cloud |
Convex Environment Variables
Set these usingnpx convex env set VARIABLE_NAME value:
| Variable | Required | Description | Used In |
|---|---|---|---|
DEEPGRAM_API_KEY | Yes | Deepgram API key for speech-to-text | convex/deepgramToken.ts |
GEMINI_API_KEY | Yes | Google Gemini API key for claim extraction | convex/claimExtraction.ts |
PERPLEXITY_API_KEY | Yes | Perplexity API key for fact-checking | convex/factCheck.ts |
CONVEX_SITE_URL | Recommended | Your application URL for auth | convex/auth.config.ts |
Verifying Your Setup
After setting all environment variables, verify your setup:Check Convex environment variables
Check Next.js environment
Start the development server and check the browser console:The Convex client should initialize without errors.
Production Deployment
For production deployments (e.g., Vercel):- Set
NEXT_PUBLIC_CONVEX_URLin your hosting platform’s environment variables - Deploy your Convex backend with
npx convex deploy --prod - Set all Convex environment variables in production:
The
--prod flag ensures environment variables are set in your production Convex deployment, not development.