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:
  1. 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.
  2. Python service (services/voice/api) — a full-featured FastAPI wrapper backed by Chatterbox, XTTS, Piper, and Whisper for real inference.
Both implementations speak the same REST contract so callers can develop against the Rust service and deploy against the Python inference backend without code changes.
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:
The Rust service is started with:
The Python service can be started from the 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

Response:

Voices and models

List TTS voices

Response:

Get a voice

List STT models

Response:

Text-to-speech

Synthesize speech

Response:

Request fields

Streaming TTS

Response:

Speech-to-text

Transcribe audio

Response:

Streaming STT

Response:

Session management

Voice sessions track TTS/STT context and activity timestamps. A session can be created in tts, stt, or both mode.

Create a session

Response:

List sessions

Get a session

Delete a session

Response is HTTP 204 No Content on success.

Service stats

Response:

Rust client

The voice-service crate includes an async HTTP client for callers that want a typed interface.
The default client points to 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.
Upload reference audio first if needed:

Error handling

Testing

The Rust service includes integration tests that exercise the router in-process via Tower’s ServiceExt::oneshot, so no network port is required.