Skip to main content

What you’ll build

A Voxray server that handles end-to-end voice conversations entirely through OpenAI’s APIs:
  • STT: OpenAI Whisper (gpt-4o-mini-transcribe) — streaming transcription
  • LLM: GPT-4o Mini — fast, capable chat completions with streaming
  • TTS: OpenAI TTS (nova voice) — natural-sounding speech synthesis
Expected latency from end of user speech to first audio byte: ~1.1 seconds (STT ~300ms + LLM first token ~500ms + TTS ~300ms).

Prerequisites

  • Voxray binary built (go build -o voxray ./cmd/voxray) or downloaded
  • An OpenAI API key with active billing credits (platform.openai.com/api-keys)
  • No other accounts or keys required

Steps


Available models

Use the tables below to tune the trade-off between cost, speed, and quality.

LLM models (model)

STT models (stt_model)

TTS voices (tts_voice)


Cost estimate

Rough cost for one hour of continuous conversation (OpenAI list prices as of May 2026):
  • STT (gpt-4o-mini-transcribe): ~0.003/min×60= 0.003/min × 60 = **~0.18/hour**
  • LLM (gpt-4o-mini): depends heavily on conversation length; typical voice session ~2k tokens/min → ~$0.12–0.30/hour
  • TTS: ~0.015/1kchars× 300chars/min×60= 0.015/1k chars × ~300 chars/min × 60 = **~0.27/hour**
Total estimate: $0.57–0.75 per hour of conversation. Switch to gpt-4o for best quality at roughly 5–8× the LLM cost. These are rough estimates; check platform.openai.com/pricing for current rates.

Upgrading to GPT-4o Realtime

OpenAI’s Realtime API replaces the separate STT → LLM → TTS chain with a single WebSocket, cutting latency significantly (typically under 500ms TTFR) at a higher per-minute cost. Voxray supports it via runner_transport + the realtime integration. See OpenAI Realtime integration for setup instructions.

Troubleshooting