Skip to main content

Capabilities

STT

Whisper and GPT-4o transcription models

LLM

GPT-4o, GPT-4.1, and GPT-3.5 family with full tool-calling support

TTS

Six neural voices via the OpenAI audio API

Realtime

Bidirectional audio session via gpt-4o-realtime-preview

API Key

Set OPENAI_API_KEY as an environment variable or pass it inline under api_keys in config.json. Get your key at platform.openai.com/api-keys.

Quick Config

Available LLM Models

The factory default when model is empty and llm_provider is "openai" is gpt-3.5-turbo.

Available STT Models

Set via stt_model in config. The default STT service (stt.NewOpenAI) uses whisper-1 when stt_model is not specified.

TTS Voices

Set via tts_voice in config. The TTS model (e.g. tts-1, tts-1-hd) can be set via tts_model.

Tool Calling (MCP)

OpenAI is one of two providers in Voxray that implement LLMServiceWithTools. When an MCP server is configured (mcp.command in config), Voxray registers discovered tools with the OpenAI service, and the model can invoke them during a turn. Tool calls are streamed, accumulated across chunks, executed in index order, and the results are appended to the conversation before a recursive Chat call completes the response. This is fully transparent to the rest of the pipeline.

Realtime Mode

OpenAI Realtime runs a persistent bidirectional audio session using gpt-4o-realtime-preview. Instead of the STT → LLM → TTS pipeline, audio is streamed directly to OpenAI and responses arrive as audio — significantly reducing first-audio latency.
Use realtime.NewFromConfig(cfg, "openai") in code; avoid importing the realtime package directly from services to prevent an import cycle. Realtime mode requires a voice-enabled build (CGO_ENABLED=1) when using WebRTC transport.

Configuration Reference

Notes and Limitations

  • The factory treats "openai" as the default LLM and STT provider. If provider, stt_provider, llm_provider, and tts_provider are all unset, Voxray falls back to OpenAI for all three stages.
  • tts-1-hd produces higher-quality audio at the cost of higher latency; tts-1 is recommended for real-time voice.
  • Tool calling requires llm_provider: "openai" — it is not available when using the Realtime session path.
  • Realtime mode and the STT→LLM→TTS pipeline are mutually exclusive per session. Choose one via config.