Skip to main content
Version: v2

Base URL

All API requests should be prefixed with the following base URL:
base-url
https://tts-api.voice.ai/api/v2

Authentication

All API requests must be authenticated using an API key. Include your API key in the request headers as:
auth-header
X-API-Token: YOUR_API_KEY
You can obtain your API key from the Voice.ai TTS platform settings page.

Endpoints Overview

This page documents the following endpoints:
  • POST /voice/create – Create a voice from a base64-encoded audio sample.
  • GET /voice/get-voices – List your voices.
  • POST /voice/update – Update an existing voice.
  • POST /voice/delete – Delete a voice.
  • POST /audio/speech – Convert text to speech (supports streaming and non-streaming).

Create a Voice

Method: POST
Path: /voice/create
Create a voice from a base64-encoded audio sample.

Request Body

  • name (string, required): Name of the voice.
  • type (string, required): Visibility of the voice. Example: PUBLIC or PRIVATE.
  • audio (string, required): Base64-encoded audio data.
  • description (string, optional): Optional description of the voice.
  • voiceTags (string[], optional): Optional list of tag IDs.

Example Request Body

create-voice.json
{
  "name": "My Voice",
  "description": "Optional description",
  "type": "PUBLIC",
  "voiceTags": ["tag_id_1", "tag_id_2"],
  "audio": "BASE64_ENCODED_AUDIO"
}

Code Examples

# Create a voice
FILE_PATH="./sample.wav"
curl -X POST "https://tts-api.voice.ai/api/v2/voice/create" \
  -H "Content-Type: application/json" \
  -H "X-API-Token: YOUR_API_KEY" \
  -d '{
    "name": "My Voice",
    "type": "PUBLIC",
    "description": "Optional description",
    "voiceTags": ["tag_id_1", "tag_id_2"],
    "audio": "'"$(base64 < "$FILE_PATH" | tr -d '
')"'"
  }'

List Voices

Method: GET
Path: /voice/get-voices
List your voices.

Query Parameters

  • filter (string, optional): Filter voices. Example: my.

Code Examples

# List your voices
curl -X GET "https://tts-api.voice.ai/api/v2/voice/get-voices?filter=my" \
  -H "X-API-Token: YOUR_API_KEY"

Update a Voice

Method: POST
Path: /voice/update
Update an existing voice.

Request Body

  • id (string, required): Voice ID.
  • name (string, optional): New name.
  • description (string, optional): New description.
  • type (string, optional): New type, e.g. PRIVATE.

Code Examples

# Update a voice
curl -X POST "https://tts-api.voice.ai/api/v2/voice/update" \
  -H "Content-Type: application/json" \
  -H "X-API-Token: YOUR_API_KEY" \
  -d '{
    "id": "VOICE_ID",
    "name": "New Name",
    "description": "New description",
    "type": "PRIVATE"
  }'

Delete a Voice

Method: POST
Path: /voice/delete
Delete a voice.

Request Body

  • id (string, required): Voice ID to delete.

Code Examples

# Delete a voice
curl -X POST "https://tts-api.voice.ai/api/v2/voice/delete" \
  -H "Content-Type: application/json" \
  -H "X-API-Token: YOUR_API_KEY" \
  -d '{
    "id": "VOICE_ID"
  }'

Text to Speech – Non-Streaming

Method: POST
Path: /audio/speech
Generate audio by sending text and a voice ID. Non-streaming returns the full audio file in the response.

Common Request Fields

  • text (string, required): Text to convert to speech.
  • voice (string, required): Voice ID.
  • audio_format (string, optional): e.g. mp3. Defaults to mp3.
  • streaming (boolean, optional): false for non-streaming.
  • latency_setting (number, optional): 0 or 1.

Non-Streaming Code Examples

# Non-streaming (download full audio)
curl -X POST "https://tts-api.voice.ai/api/v2/audio/speech" \
  -H "Content-Type: application/json" \
  -H "X-API-Token: YOUR_API_KEY" \
  --output output.mp3 \
  -d '{
    "text": "Hello world",
    "voice": "d1bf0f33-8e0e-4fbf-acf8-45c3c6262513",
    "audio_format": "mp3",
    "streaming": false,
    "latency_setting": 0
  }'

Text to Speech – Streaming

Streaming returns audio bytes as they are generated, which is useful for low-latency use cases like Voice AI agents.

Streaming Code Examples

# Streaming (pipe chunks)
curl -N -X POST "https://tts-api.voice.ai/api/v2/audio/speech" \
  -H "Content-Type: application/json" \
  -H "X-API-Token: YOUR_API_KEY" \
  -d '{
    "text": "Hello world",
    "voice": "d1bf0f33-8e0e-4fbf-acf8-45c3c6262513",
    "audio_format": "mp3",
    "streaming": true,
    "latency_setting": 1
  }' > stream.mp3

Schemas

CreateVoiceRequest

Type: object Properties:
  • name (string)
  • type (PUBLIC | PRIVATE)
  • audio (string, base64)
  • description (string, optional)
  • voiceTags (string[], optional)

UpdateVoiceRequest

Type: object Properties:
  • id (string)
  • name (string, optional)
  • description (string, optional)
  • type (PUBLIC | PRIVATE, optional)

DeleteVoiceRequest

Type: object Properties:
  • id (string)

SpeechRequest

Type: object Properties:
  • text (string)
  • voice (string)
  • audio_format (“mp3” | “wav”, optional, default “mp3”)
  • streaming (boolean, optional, default false)
  • latency_setting (0 | 1, optional, default 0)
  • creativity (number, optional)
  • diversity (number, optional)
  • precision (number, optional)
  • adherence (number, optional)
  • guidance (number, optional)