Loading configuration
Voxray reads a single JSON file at startup. Pass the path with the-config flag or the VOXRAY_CONFIG environment variable:
ApplyEnvOverrides runs automatically and applies any VOXRAY_* environment variables on top of the file values. The result is a single resolved Config struct used for the lifetime of the process.
Loading precedence (highest to lowest):
- Environment variable (e.g.
VOXRAY_PORT) config.jsonfield value- Internal Go default (zero value or documented default)
Server settings
These control what address and port the HTTP server binds to, and which network transports are enabled.- config.json
- Environment Variables
Provider selection
Voxray resolves providers per pipeline stage. Setprovider as a global default; override per-task with stt_provider, llm_provider, or tts_provider.
See Providers & Services for the full capability matrix and supported config key values.
API keys
API keys are stored in theapi_keys map. Each key is the provider’s short name; each value is the secret.
- config.json
- Environment Variable
api_keys[name] in config → environment variable → empty string (authentication will fail at the first API call). See Providers & Services for the env var name for each provider.
Transport
Controls how clients connect to the server: WebSocket, WebRTC, or both. The WebRTC transport uses the SmallWebRTC signaling protocol.For WebRTC TTS audio (Opus), Voxray must be built with CGO enabled (
CGO_ENABLED=1 go build ./cmd/voxray). Without CGO, WebRTC offers succeed for signaling but TTS audio delivery returns 503 opus encoder unavailable.VAD and turn detection
Voice Activity Detection (VAD) gates when audio is forwarded to STT. Turn detection decides when the user has finished speaking and the LLM should respond.VAD parameters
Turn detection parameters
Interruptions
Controls whether a user can interrupt the bot mid-response (barge-in) and how the interruption is handled.Plugins
The plugin system lets you insert custom processors into the pipeline. Built-in plugins includeecho, frame_filter, wake_check_filter, stt_mute_filter, audio_filter, interruption_controller, external_chain, and rtvi.
See the Extensions documentation for the full plugin authoring API.
Session store
Controls how runner sessions (created viaPOST /start) are stored. Matters for horizontal scaling.
When
session_store is "redis", GET /ready returns 503 if the Redis connection is unhealthy. Use this endpoint for Kubernetes readiness probes.Recording
Enables per-session mixed audio recording, uploaded asynchronously to S3 after each session ends.
AWS credentials for S3 upload are resolved via the standard AWS SDK v2 chain (environment variables, shared config, EC2/ECS IAM role, etc.). No Voxray-specific config is needed beyond the bucket name.
Transcripts
Persists per-message text transcripts (both user and assistant turns) to a relational database.Security
Controls server authentication, CORS, request body limits, and TLS.Observability
Controls structured logging and Prometheus metrics.- config.json
- Environment Variables
MCP (Model Context Protocol)
When configured, Voxray starts an MCP server subprocess at startup and registers its tools with the LLM service. The LLM can then call these tools during a conversation.The MCP subprocess communicates over stdio (the MCP stdio transport). Voxray manages the process lifecycle: it starts the subprocess when the server starts and terminates it on shutdown. The LLM provider must implement
LLMServiceWithTools to use MCP tools; OpenAI and Anthropic providers support this.Complete annotated example
The following shows a production-orientedconfig.json with all major sections populated. Copy config.example.json as your starting point and adapt from there.
api_keys.openai, transcripts.dsn, server_api_key, redis_url) via their environment variable equivalents (OPENAI_API_KEY, VOXRAY_TRANSCRIPTS_DSN, VOXRAY_SERVER_API_KEY, and redis_url in config or a secrets-manager-injected env var) rather than committing them to this file.
Environment variable reference
AllVOXRAY_* overrides are applied by ApplyEnvOverrides immediately after LoadConfig returns. API key env vars (OPENAI_API_KEY, GROQ_API_KEY, etc.) are resolved lazily per-provider at the first GetAPIKey call.