CXB Core reads configuration from a .env file at the project root. Defaults are for local development. Production fleet hosts override the worker and storage values explicitly.

Core settings

VariableDefaultDescription
CXB_API_CONFIG_URLhttp://localhost:8080/api/v1/configCXB API config API base URL
CXB_API_URLhttp://localhost:8080CXB API base URL for non-config internal endpoints
CXB_CORE_SECRETcxb-core-internal-secretShared secret for CXB API ↔ CXB Core auth
ENVIRONMENTdevelopmentSet to production on live hosts to enable startup safety checks
MAX_CONCURRENT_CALLS5Local dev default. Production fleet workers should use 1 so one worker equals one call slot.
CXB_CORE_WORKERS4Worker count reported in health endpoints. Production must match the actual systemd/container worker count.
CXB_CORE_SOCKET""Unix socket path for a single worker, set by the systemd template
AUDIO_SAMPLE_RATE8000Default audio sample rate (Hz)
LOG_LEVELINFOLogging level (DEBUG, INFO, WARNING, ERROR)
Do not use the local MAX_CONCURRENT_CALLS=5 default in production. Current production architecture is one call per worker, enforced by both MAX_CONCURRENT_CALLS=1 and nginx max_conns=1.

Object storage

VariableDefaultDescription
MINIO_ENDPOINTlocalhost:9000S3-compatible endpoint
MINIO_ACCESS_KEYminioadminAccess key
MINIO_SECRET_KEYminioadminSecret key
MINIO_BUCKETrecordingsBucket for call recordings
MINIO_SECUREfalseUse HTTPS for storage endpoint

LiveKit (SIP transports)

VariableDefaultDescription
LIVEKIT_URL(empty)LiveKit server URL (e.g., wss://livekit.example.com)
LIVEKIT_API_KEY(empty)LiveKit API key
LIVEKIT_API_SECRET(empty)LiveKit API secret
LiveKit variables are only required if using LiveKit SIP inbound or outbound transports. The WebSocket and Exotel transports do not need them.

OpenTelemetry

VariableDefaultDescription
OTEL_ENABLEDfalseEnable OpenTelemetry tracing
OTEL_ENDPOINThttp://localhost:4317OTLP exporter endpoint
OTEL_SERVICE_NAMEcxb-coreService name in traces

API keys

STT, LLM, and TTS API keys can be set in environment variables but are typically provided through bot config from CXB API:
VariableService
STT_STREAMING_API_KEYStreaming / turn-detecting STT engine
STT_MULTILINGUAL_API_KEYMultilingual STT engine
LLM_PROVIDER_A_API_KEYLLM provider A
LLM_PROVIDER_B_API_KEYLLM provider B
TTS_ENGINE_A_API_KEYTTS engine A
TTS_ENGINE_B_API_KEYTTS engine B

LLM caching

VariableDefaultDescription
CONTEXT_CACHE_TTL_SECONDS3600TTL (seconds) for the CachedContent used by live and post-call explicit caching on the explicit-cache LLM providers. Floored at 300s; workers proactively recreate caches after ~90% of TTL.

TTS cache

VariableDefaultDescription
TTS_CACHE_REDIS_URL""Redis URL used by the TTS audio cache. Required only when a bot enables tts.cache_config.enabled.

Durable outboxes

CXB Core persists result delivery and Agent Desk enqueue attempts before trying to send them to CXB API.
VariableDefaultDescription
RESULT_OUTBOX_DIR/tmp/cxb-core-result-outboxDirectory for pending call-result webhook payloads
RESULT_OUTBOX_POLL_SECONDS30.0Background retry poll interval
RESULT_OUTBOX_RETRY_SECONDS30.0Initial retry delay
RESULT_OUTBOX_MAX_RETRY_SECONDS300.0Max retry delay
AGENT_DESK_OUTBOX_DIR/tmp/cxb-core-agent-desk-outboxDirectory for pending Agent Desk handoff payloads
AGENT_DESK_OUTBOX_POLL_SECONDS10.0Background retry poll interval
AGENT_DESK_OUTBOX_RETRY_SECONDS5.0Initial retry delay
AGENT_DESK_OUTBOX_MAX_RETRY_SECONDS60.0Max retry delay
AGENT_DESK_WAIT_ESTIMATE_SECONDS120Wait estimate sent with Agent Desk handoffs
AGENT_DESK_WAIT_ANNOUNCEMENT_ENABLEDtrueWhether the bot announces the wait before handoff
When ENVIRONMENT=production, CXB Core refuses to start with default secrets or /tmp outbox directories. Use persistent disk paths for outboxes on live hosts.

Production example

CXB_API_CONFIG_URL=https://api.cxbridge.io/api/v1/config
CXB_CORE_SECRET=your-secret-here
ENVIRONMENT=production
MAX_CONCURRENT_CALLS=1
CXB_CORE_WORKERS=16
AUDIO_SAMPLE_RATE=8000
LOG_LEVEL=info

RESULT_OUTBOX_DIR=/var/lib/core/result-outbox
AGENT_DESK_OUTBOX_DIR=/var/lib/core/agent-desk-outbox

MINIO_ENDPOINT=sgp1.digitaloceanspaces.com
MINIO_BUCKET=cxbridge-recordings
MINIO_SECURE=true

LIVEKIT_URL=wss://livekit.cxbridge.io

OTEL_ENABLED=false