Overview
The Allternit Voice Service provides a unified HTTP API for speech synthesis and recognition. It exposes endpoints for text-to-speech (TTS), speech-to-text (STT), voice cloning, session management, and service introspection. The service is distributed in two forms:- Rust service (
services/voice) — a lightweight, standalone HTTP server that ships with the Allternit workspace. It simulates the voice API contract and is ideal for local development, CI, and integration testing. - Python service (
services/voice/api) — a full-featured FastAPI wrapper backed by Chatterbox, XTTS, Piper, and Whisper for real inference.
The Python inference backend runs models locally or on hardware you control. Audio data and model state stay on the host.
Base URL
Default bind address:api/ directory with your preferred ASGI server.
Key features
Supported backends
Preset voices are configured in the Python service and exposed through the voices API.
REST endpoints
Health check
Voices and models
List TTS voices
Get a voice
List STT models
Text-to-speech
Synthesize speech
Request fields
Streaming TTS
Speech-to-text
Transcribe audio
Streaming STT
Session management
Voice sessions track TTS/STT context and activity timestamps. A session can be created intts, stt, or both mode.
Create a session
List sessions
Get a session
Delete a session
204 No Content on success.
Service stats
Rust client
Thevoice-service crate includes an async HTTP client for callers that want a typed interface.
http://localhost:8001. Point it at another host with VoiceClient::new(base_url).
Voice cloning (Python backend)
The Python inference backend supports voice cloning from a reference audio URL.Error handling
Testing
The Rust service includes integration tests that exercise the router in-process via Tower’sServiceExt::oneshot, so no network port is required.