Configuration
All configuration lives in a single .env file at the repository root. Copy .env.example and fill it in. Next.js reads the environment at boot, so restart the server after editing .env.
Provider keys
Most integration secrets can be managed in the admin UI (ElevenLabs keys, SMTP, WhatsApp provider mode, payment gateways). The .env values are bootstrap defaults / fallbacks.
App & secrets
APP_NAME="CallMineAI"
APP_ENV=local # production in prod
APP_DEBUG=false
APP_URL=http://localhost:3000
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_DEMO_MODE=false # true = read-only demo (no create/update/delete)
# Exposed to the browser bundle — keep in sync with the two above
NEXT_PUBLIC_APP_NAME="CallMineAI"
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Signs the session cookies (cm_session / cm_admin). 32+ random chars.
AUTH_SECRET=
# Authorizes the scheduled tasks at /api/cron/*. Falls back to AUTH_SECRET.
CRON_SECRET=
| Key | Purpose |
|---|---|
AUTH_SECRET | Signing key for the JWT session cookies — rotating it signs everyone out |
CRON_SECRET | Shared secret the worker / cron sends as X-Cron-Secret |
APP_KEY | Only needed when the database already holds Laravel-encrypted values (SMTP passwords, gateway secrets, integration_settings). Copy it verbatim, base64: prefix included |
APP_DEMO_MODE | Blocks every create/update/delete in both panels |
Seed accounts (used once by npm run db:seed — set before seeding to override):
ADMIN_SEED_EMAIL=admin@spagreen.net
ADMIN_SEED_PASSWORD=12345678
CLIENT_SEED_EMAIL=client@spagreen.net
CLIENT_SEED_PASSWORD=12345678
CLIENT_SEED_NAME="Customer User"
Database
One connection string, read by Prisma:
DATABASE_URL="mysql://user:password@127.0.0.1:3306/callmineai"
There is nothing else to configure — cache entries, rate limits and scheduler locks live in the cache table, and sessions are stateless JWT cookies.
The scheduled tasks are required
Calls dial from POST /api/cron/dispatch. Keep npm run worker (or an equivalent cron) running — see Deployment.
AI / LLM brain
Powers the agent conversation and call analysis (sentiment + lead scoring).
| Key | Purpose | Default |
|---|---|---|
AI_PROVIDER | Active AI provider | openai |
OPENAI_API_KEY | OpenAI key | — |
OPENAI_MODEL | Default model | gpt-4o-mini |
OPENAI_MAX_TOKENS | Max tokens per completion | 4096 |
AI_PROVIDER=openai
AI_OPENAI_ENABLED=true
OPENAI_API_KEY=
OPENAI_MODEL=gpt-4o-mini
See Voice & AI for per-model credit costs.
Voice (ElevenLabs)
Keys are managed in Admin → ElevenLabs; these are a bootstrap fallback.
| Key | Purpose | Default |
|---|---|---|
ELEVENLABS_ENABLED | Enable the voice stack | true |
ELEVENLABS_API_KEY | Fallback key | — |
ELEVENLABS_MAX_CONCURRENCY | Concurrency cap per key | 30 |
ELEVENLABS_DEFAULT_VOICE_ID | Default voice | — |
ELEVENLABS_TTS_MODEL | TTS model | eleven_flash_v2_5 |
Calling economics
Overridable in admin settings.
| Key | Purpose | Default |
|---|---|---|
CALL_CREDIT_PRICE_CENTS | Price of one credit | 10 |
CALL_VOICE_COST_CENTS | Voice cost per minute | 10 |
CALL_NUMBER_COST_CREDITS | Monthly cost per phone number | 50 |
CALL_DEFAULT_LLM | Default LLM | gpt-4o-mini |
See Billing & Credits.
Telephony (Twilio / Plivo)
Without credentials, number search/buy is disabled but manual (BYO) numbers still work. See Telephony.
TELEPHONY_PROVIDER=twilio # twilio | plivo
TWILIO_ENABLED=true
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_DEFAULT_FROM=
PLIVO_ENABLED=true
PLIVO_AUTH_ID=
PLIVO_AUTH_TOKEN=
PLIVO_DEFAULT_FROM=
Callback URLs are derived from APP_URL at dial time (/webhooks/twilio/status, /webhooks/twilio/recording, and the Plivo equivalents). Override them only if the carrier must reach a different host:
TWILIO_STATUS_CALLBACK_URL=
TWILIO_RECORDING_CALLBACK_URL=
TWILIO_INBOUND_VOICE_URL=
Messaging add-on (Email + WhatsApp)
Live provider mode is set in Admin → Messaging. See Messaging.
MESSAGING_ENABLED=true
WHATSAPP_PROVIDER_MODE=disabled # disabled | meta | whatsway | both
META_APP_ID=
META_APP_SECRET=
META_CONFIG_ID=
META_VERIFY_TOKEN=callmineai
META_GRAPH_VERSION=v21.0
WHATSWAY_BASE_URL=
WHATSWAY_API_KEY=
Billing gateways
Enable a gateway by setting its *_ENABLED=true and filling credentials. Success/cancel URLs point at the customer billing/pricing pages.
BILLING_STRIPE_ENABLED=false
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=
BILLING_PAYPAL_ENABLED=false
PAYPAL_CLIENT_ID=
PAYPAL_CLIENT_SECRET=
PAYPAL_SANDBOX=true
BILLING_PADDLE_ENABLED=false
PADDLE_API_KEY=
PADDLE_ENVIRONMENT=sandbox
PADDLE_WEBHOOK_SECRET=
SIP trunk add-on
See SIP trunks.
SIP_ENABLED=true
SIP_DEFAULT_ENGINE=elevenlabs # elevenlabs | openai
OPENAI_REALTIME_MODEL=gpt-4o-realtime-preview
Mobile app links (optional)
Landing-page App Store / Google Play badges (omit until your apps are live):
APP_STORE_URL=
GOOGLE_PLAY_URL=