API Documentation

Integrate Speech to Speech AI into your applications with a simple REST API.

Quickstart

Get started with the Speech to Speech AI API in under 5 minutes.

Base URL
https://api.speechtospeechai.com/v1
1. Start a job

Every tool is a POST with your API key. The answer is a job id, not the audio.

cURL
curl -X POST https://api.speechtospeechai.com/v1/tts/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "text=Hello! Welcome to Speech to Speech AI." \
  -F "model=kokoro" \
  -F "voice_id=af_heart" \
  -F "format=mp3"

{"uuid": "3f2c...", "job_id": "...", "status": "queued"}
2. Poll for the result

Ask for the job every few seconds until the status is completed, then download result_url.

cURL
curl "https://api.speechtospeechai.com/v1/speech/results/?uuid=3f2c..." \
  -H "Authorization: Bearer YOUR_API_KEY"

{"status": "completed", "result_url": "https://.../output.mp3"}

Authentication

All API requests require authentication via an API key in the Authorization header.

Header
Authorization: Bearer YOUR_API_KEY
Get your API key from your account dashboard.

Voice Cloning

POST /v1/voice-clone/

Speak a text in the voice of a short reference recording.

Request Body (multipart/form-data)
Parameter Type Required Description
reference_audio file Yes Recording of the voice to clone (10-30 seconds recommended, up to 60)
text string Yes Text to speak in that voice
model string No chatterbox, openvoice, tortoise or gpt-sovits
language string No Language code (default: en)
Response

A job id (uuid). Poll GET /v1/speech/results/?uuid= until status is completed and download result_url.

Text to Speech

POST /v1/tts/

Convert text to speech audio.

Request Body (multipart/form-data)
Parameter Type Required Description
text string Yes Text to convert (max 5000 characters)
model string No kokoro (default), piper, vits or bark
voice_id string No Voice id from GET /v1/speech/voices/?model=
language string No Language code (default: en)
speed float No Speed multiplier (0.5-2.0, default 1.0)
format string No wav (default), mp3, ogg or flac. SSML tags are removed before synthesis.
Response

A job id (uuid). Poll GET /v1/speech/results/?uuid= until status is completed and download result_url.

Speech to Text

POST /v1/transcribe/

Transcribe audio to text with timestamps.

Request Body (multipart/form-data)
Parameter Type Required Description
file file Yes Audio/video file to transcribe
model string No large-v3 (default) or turbo
language string No Language code, or auto to detect it (default)
enable_word_timestamps bool No Add a start and end time to every word
callback_url string No URL that receives the result by POST when the job finishes
Response

A job id (uuid). Poll GET /v1/transcribe/results/?uuid= until status is completed; the answer then carries text, language and segments.

Available Models

Text-to-Speech Models
Model ID Description Best For
kokoro Fast multilingual TTS General use, low latency
piper Lightweight multilingual TTS (commercially licensed voices only) Fast renders in 11 languages
vits LJSpeech plus 108 VCTK English speakers English accents
bark Generative TTS, 130 presets in 13 languages Varied, expressive delivery (slow)
openvoice Voice cloning and optional voice conversion Alternative to Chatterbox
chatterbox Zero-shot voice cloning in 23 languages; default voice conversion model Cloning from a short sample
Speech-to-Text Models
Model ID Description Best For
whisper-large-v3 OpenAI Whisper Large v3 Highest accuracy, multilingual
whisper-turbo Optimized Whisper for speed Fast transcription

Error Codes

Code Status Description
invalid_api_key 401 Invalid or missing API key
insufficient_credits 402 Not enough credits for this operation
rate_limit_exceeded 429 Too many requests
invalid_request 400 Malformed request body
model_not_found 404 Requested model doesn't exist
voice_not_found 404 Requested voice doesn't exist
file_too_large 413 Uploaded file exceeds size limit
server_error 500 Internal server error