Overview
The Drift API integrates with multiple external services, each requiring its own API credentials. Authentication is handled via environment variables rather than request headers, as this is currently a development/demo application.Environment Variables
Configure these variables in your.env file in the monorepo root:
Nessie API (Mock Banking Data)
API key for Capital One’s Nessie banking sandboxHow to obtain:
- Visit api.nessieisreal.com
- Sign up for a developer account
- Generate an API key from your dashboard
Base URL for Nessie API (optional, uses default if not set)
697541cf95150878eafea4ff (Alex Morgan - comprehensive demo profile)
Plaid (Real Bank Connectivity)
Your Plaid client identifierHow to obtain:
- Visit dashboard.plaid.com
- Sign up and create a new application
- Copy your Client ID from the dashboard
Your Plaid secret key (environment-specific)Security note: Use sandbox secret for development, production secret only in production
Plaid environment:
sandbox, development, or production- sandbox: Mock data, free testing
- development: Real accounts, limited free usage
- production: Real accounts, requires approval
Gemini AI (Natural Language & Recommendations)
Google Gemini API key for AI-powered featuresHow to obtain:
- Visit aistudio.google.com
- Sign in with your Google account
- Navigate to “Get API Key”
- Create a new API key
- Parsing natural language goals (
/api/parse-goal) - Generating personalized recommendations (
/api/ai/recommendations) - Creating narrative summaries (
/api/ai/generate-narrative) - Conversational voice interactions (
/api/ai/voice-goal,/api/ai/voice-results)
gemini-2.0-flash-exp (fast, cost-effective)ElevenLabs (Text-to-Speech & Speech-to-Text)
ElevenLabs API key for voice featuresHow to obtain:
- Visit elevenlabs.io
- Sign up for an account
- Navigate to Profile → API Keys
- Generate a new API key
- Converting text to speech (
/api/ai/generate-audio) - Streaming audio responses (
/api/ai/stream-audio) - Transcribing voice input (
/api/ai/transcribe) - Full voice interaction pipeline (
/api/ai/voice-goal)
Default voice for text-to-speechAvailable voices:
rachel: Female, calm and professionaladam: Male, deep and authoritativejosh: Male, friendly and conversational (default)bella: Female, warm and engaging
Checking Service Availability
The API gracefully handles missing credentials:Nessie
IfNESSIE_API_KEY is not set, you’ll see a warning on server startup:
Plaid
Check if a user has linked Plaid accounts:ElevenLabs
Check available voices and configuration status:configured: false), voice endpoints will return 503 errors:
Complete .env Example
Security Best Practices
Development
- Use sandbox/development credentials for all services
- Rotate API keys regularly
- Use separate keys for each developer/environment
Production
- Store secrets in environment variables or a secret manager (AWS Secrets Manager, HashiCorp Vault)
- Use production credentials only in production environments
- Implement API authentication to prevent unauthorized access
- Enable HTTPS/TLS for all API communications
- Restrict CORS to your frontend domain
- Implement rate limiting per user/API key
- Monitor API usage and set up alerts for anomalies
Request Authentication (Future)
While the current API doesn’t require authentication headers, a production implementation should include:API Key Authentication
JWT Bearer Tokens
OAuth 2.0
For user-specific operations (linking bank accounts, storing preferences), implement OAuth 2.0 flow:- User authenticates with your app
- App receives access token
- Access token included in all API requests
- Token validated on server-side
Troubleshooting
”Warning: NESSIE_API_KEY not set”
Solution: Add your Nessie API key to.env and restart the server.
Plaid endpoints return 500 errors
Solution: VerifyPLAID_CLIENT_ID, PLAID_SECRET, and PLAID_ENV are correctly set.
Gemini endpoints return errors
Solution:- Verify
GEMINI_API_KEYis valid - Check your API quota at aistudio.google.com
- Ensure you’re not exceeding rate limits
ElevenLabs returns 503 errors
Solution:- Add
ELEVENLABS_API_KEYto.env - Restart the server
- Voice features will become available
”Failed to fetch accounts”
Solution:- For Nessie: Verify customer ID exists (try default:
697541cf95150878eafea4ff) - For Plaid: User must complete Plaid Link flow first (
/api/plaid/create-link-token)
Next Steps
Run Simulations
Execute Monte Carlo forecasts with your configured data sources
Nessie Endpoints
Explore mock banking data endpoints
Plaid Integration
Connect and retrieve real bank account data
Goal Parsing
Use Gemini for natural language goal understanding