AI Voice API
AI voice for your product
Add speech synthesis and speech-to-text to your app with a REST API. Choose the Pro or Flash model, stream audio in real time, manage API keys and track credits and history.
Create an API key in your account and follow the integration guide to get started.
One POST, one audio file
Send text with a voice ID, get MP3 or WAV back. Credits come from your account balance.
Main endpoints
- GET
/v1/tts/voicesVoices, voice IDs and preview audio. - POST
/v1/text-to-speech/{voice_id}Read text, returns MP3 or WAV. - POST
/v1/text-to-speech/{voice_id}/streamReceive audio in chunks while it is generated. - POST
/v1/speech-to-textTranscribe an audio file, 30 languages. - POST
/v1/voice-enrollmentsEnroll a cloned voice. - GET
/v1/user/subscriptionCredit balance and monthly quota.
quickstart.mjs
import fs from "node:fs/promises";
const voiceId = process.env.VOICE_ID ?? "vi_02";
const apiKey = process.env.SNAPVOICE_API_KEY;
if (!apiKey) throw new Error("Set SNAPVOICE_API_KEY on your server");
const res = await fetch(
`https://api.snapvoice.ai/v1/text-to-speech/${encodeURIComponent(voiceId)}`,
{
method: "POST",
headers: {
"xi-api-key": apiKey,
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Xin chào từ SnapVoice",
model_id: "silverai/silver-tts-pro",
}),
signal: AbortSignal.timeout(330_000),
},
);
if (!res.ok) throw new Error(await res.text());
await fs.writeFile("speech.wav", Buffer.from(await res.arrayBuffer()));One API for voice and transcription
- REST API
- Send text and receive 24 kHz MP3 or WAV audio to store or play in your app.
- Pro and Flash
- Choose the right model for each request with an explicit model_id.
- Real-time streaming
- Receive PCM audio chunks while generation is running for instant playback, ideal for assistants and call centres.
- Speech to Text
- Send an audio file and get text back in 30 languages, with a chosen language or auto-detect.
- Built-in and cloned voices
- Fetch models, voice IDs and preview audio from the catalogue; enroll cloned voices through the API.
- API keys, credits and history
- Scope each key separately; track your credit balance and API audio and transcription history.
Three steps to your first call
- Create an API key
In your account, choose the scopes each key needs.
- Get a voice ID
GET /v1/tts/voices returns the voices and their preview audio.
- Send a POST
POST /v1/text-to-speech/{voice_id} returns an audio file. Out of credits returns 402.
Start integrating the SnapVoice API
Create an API key, choose the scopes you need and run the docs example.