On this page
User guide
Voice
Speech-to-text and text-to-speech with two honest provider tiers. Nothing is faked: if no provider is available, the tools return a clear error saying exactly what to install or configure.
Providers
Speech-to-text (transcribe_audio), auto-selected in order:
local— faster-whisper on your machine. Offline, private, audio never leaves the box. Optional dependency:pip install agentkai[voice](downloads a ~140 MBbasemodel on first use).openai— OpenAI Whisper API. NeedsOPENAI_API_KEY; audio leaves the machine.
Text-to-speech (speak_text), auto-selected in order:
openai— OpenAI TTS (tts-1; voices alloy, echo, fable, onyx, nova, shimmer). NeedsOPENAI_API_KEY. Natural-sounding.local—espeak/espeak-ngon Linux,sayon macOS. Free and offline, but robotic.
There is deliberately no free third-party TTS endpoint: undocumented scraped endpoints break without notice and would be a dishonest dependency.
Run provider_matrix() in agentkai.voice (or ask the agent) to see what works on your machine right now.
Setup
pip install agentkai[voice] # offline STT (faster-whisper)
sudo apt install espeak-ng # offline TTS (Linux); macOS ships `say`
# sudo apt install ffmpeg # for non-wav audio input
export OPENAI_API_KEY=... # API tiers (or ~/.agentkai/openai_token.json)
Audio formats
mp3, wav, m4a, ogg/oga, opus, flac, webm, aac. Non-wav input is converted to 16 kHz mono wav via ffmpeg when available; otherwise the tool errors clearly.
Voice notes in chat
Messaging channels download incoming voice-note files and transcribe them before the agent sees the message. Transcription failures come back as readable ERROR: … strings so the gateway replies usefully instead of crashing.
What's not here
- No real-time voice conversation / telephony in v1 — transcription and file-based synthesis only.
- No speaker identification.