Skip to main content
POST
TTS Inference
Currently in beta. You’re on the priority waitlist and among the first to get access.

Overview

Get the complete synthesized audio in one response. Best for downloads or batch processing. For streaming playback, see TTS Streaming or TTS Realtime.
Passing numbers, IDs, dates, or currency as raw strings causes mispronunciations. See the Input Formatting Guide for correct formatting of phone numbers, account numbers, PINs, Aadhaar, vehicle registration numbers, GSTIN, currency, and more.

Available Voices

To see the available voices, click here.

Endpoint

Authentication

All requests require the following headers:

Request Parameters

Send a JSON body with the following structure:
string
required
The text to synthesize into speech. Pass numbers, dates, and currency as spoken words to avoid mispronunciations — see Input Formatting Guide.
string
required
TTS model to use. Currently supported: Timbre v2.0 / Timbre v2.5
string
ID of a pre-defined voice. See Available Voices
integer
default:"48000"
Sample rate in Hz. Supported: 8000, 16000, 22050, 24000, 44100, 48000.
integer
required
Number of audio channels (e.g., 1 for mono, 2 for stereo)
integer
required
Sample width in bytes (e.g., 2 for 16-bit audio)
string
default:"linear_pcm"
Audio encoding. Options: linear_pcm, pcm_s16le, pcm_mulaw, pcm_alaw, oggopus. For telephony, prefer container=mulaw or container=alaw over this field — both produce the same output. Use oggopus (or container=ogg) for a playable OGG Opus file.
string
default:"wav"
Output container. Options: wav, raw, mp3, ogg, mulaw, alaw. Use ogg for OGG Opus. Use mulaw or alaw for G.711 telephony (forces 8000 Hz regardless of sample_rate).
string
default:"128k"
MP3 bitrate. Only used when container is mp3. Supported: 32k, 64k, 96k, 128k, 192k.

Audio Format Reference

Encoding aliases — produce identical output to the container rows above: bitrate only applies when container=mp3. container=mulaw/alaw override sample_rate to 8000 Hz.

Response

A successful request returns 200 OK with raw binary audio in the format specified by audio_config.container (for example audio/wav, audio/mpeg, or audio/ogg).

Code Example


Python SDK

The official Python SDK lets you synthesize speech in one line, without constructing JSON payloads or handling binary audio responses manually.

Installation

Requires Python 3.10+.

Authentication

Synthesize Speech

The synthesize method returns the complete audio as bytes, which you can write to a file or pass directly to an audio player.

Custom Audio Config

Control the sample rate, encoding, and container format of the output audio.

List Available Voices

Supported Languages

The Gnani Timbre v2.0 API supports 2 languages.

Headers

X-API-Key-ID
string
required

Body

application/json

Request body for TTS inference.

text
string
required
model
enum<string>
required

Supported TTS models.

Available options:
timbre-v2.5,
timbre-v2.0
audio_config
AudioConfig · object
required

Audio output configuration.

voice
string

Voice name from the Timbre catalog.

language
string

Language code. Use IND-IN for Timbre v2.0. For Timbre v2.5 use auto, hi-IN, en-IN, ta-IN, te-IN, kn-IN, ml-IN, mr-IN, pa-IN, bn-IN, or gu-IN.

speed
number

Playback speed multiplier (Timbre v2.5 only). Range: 0.85–1.15.

Response

Successful audio synthesis

The response is of type file.