Skip to main content

Loading configuration

Voxray reads a single JSON file at startup. Pass the path with the -config flag or the VOXRAY_CONFIG environment variable:
After parsing the JSON, 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):
  1. Environment variable (e.g. VOXRAY_PORT)
  2. config.json field value
  3. Internal Go default (zero value or documented default)
To start, copy the example file:
Never commit config.json with real API keys to a git repository. In production, leave all api_keys values as empty strings and set the actual secrets via environment variables or a secrets manager. The VOXRAY_SERVER_API_KEY, OPENAI_API_KEY, and similar variables are the 12-factor-compliant approach.

Server settings

These control what address and port the HTTP server binds to, and which network transports are enabled.

Provider selection

Voxray resolves providers per pipeline stage. Set provider 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 the api_keys map. Each key is the provider’s short name; each value is the secret.
The api_keys object is the only section of config.json that should never be committed with real values. Use the environment variable approach in any environment beyond your local machine.
Resolution order for each key: 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

If VAD misses the second utterance in a conversation or quiet microphones are silently skipped, lower vad_min_volume to 0.2 and vad_threshold to 0.01. These are the two most common tuning levers.

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 include echo, 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 via POST /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.
The dsn field contains database credentials. Do not commit it. Set VOXRAY_TRANSCRIPTS_DSN in production.

Security

Controls server authentication, CORS, request body limits, and TLS.
In most production deployments, TLS is terminated at a reverse proxy (nginx, AWS ALB, GCP Load Balancer) or Ingress controller. In that case, leave tls_enable false and bind to a private interface. Set server_api_key to protect voice endpoints even on internal networks.

Observability

Controls structured logging and Prometheus metrics.

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-oriented config.json with all major sections populated. Copy config.example.json as your starting point and adapt from there.
Set sensitive values (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

All VOXRAY_* 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.