TTS APIAvailable

Tetrax TTS API

Turn any text into natural-sounding audio with a single API call. Powered by neural TTS, the TTS API returns a hosted MP3/PCM audio URL — ideal for IVR prompts, voice flows, accessibility, e-learning, and dynamic content. Billed per character from your prepaid wallet.

Overview

The TTS API lets you synthesize lifelike speech from plain text. Send your text, choose a voice preset and output format, and receive a hosted audio URL you can play, embed, or stream anywhere.

Unlike clip-based TTS, there is nothing to pre-record — the neural engine generates natural speech on demand, so every response is unique.

Neural TTS Engine

Our neural TTS engine generates lifelike speech from any text.

Hosted Audio URLs

Every synthesis returns a public MP3/PCM URL served by the platform.

Per-Character Billing

Pay ₹0.001 per character (₹0.01 minimum) from your prepaid wallet.

ℹ️
API Base URLAll API endpoints are relative to https://APIURL.tetrax.in/v1.

Authentication

The TTS API uses API key authentication. You must include your trx_tts_* API key in the x-api-key header of every request.

Getting Your API KeyGenerate a TTS API key from the Applications page in the Tetrax dashboard. Create an application with TTS capability and copy the trx_tts_* key.
x-api-key: trx_tts_your_key_here

API Key Types

trx_tts_*Used for synthesizing speech. Include in x-api-key header.
JWT Bearer TokenUsed for dashboard operations (view history, analytics). Include as Authorization: Bearer <token>.

Quickstart

Synthesize your first clip in under a minute. Replace the API key and text with your own values.

curl -X POST https://APIURL.tetrax.in/v1/tts/synthesize \\
  -H "Content-Type: application/json" \\
  -H "x-api-key: trx_tts_your_key" \\
  -d '{
    "text": "Hello! Welcome to TetraX.",
    "voice": "alloy",
    "format": "mp3"
  }'
{
  "success": true,
  "generation_id": "gen_xxx",
  "job": {
    "id": 1,
    "characters": 26,
    "voice": "alloy",
    "format": "mp3",
    "audio_url": "https://APIURL.tetrax.in/v1/tts/audio/s2_1_xxx.mp3",
    "charge": 0.03
  },
  "meta": {
    "characters": 26,
    "charge": 0.03,
    "per_char": 0.001,
    "format": "mp3",
    "audio_url": "https://APIURL.tetrax.in/v1/tts/audio/s2_1_xxx.mp3"
  },
  "model": "tetrax-neural-tts",
  "pricing": { "per_char": 0.001, "minimum_bill": 0.01 }
}
ℹ️
What happens next?Your audio is generated, stored on the platform, and served at the returned audio_url. Your wallet is charged only after a successful synthesis — a provider failure never bills you.

Voice Presets

Six natural voice presets are available out of the box. Use the GET /v1/tts/voices endpoint to fetch the live list.

Voice IDStyleDescription
defaultNaturalBalanced, natural-sounding default voice
alloyBrightBright and energetic female voice
echoWarmWarm and confident male voice
fableExpressiveExpressive, storybook female voice
onyxDeepDeep and authoritative male voice
novaSoftSoft and clear female voice
shimmerArticulateNeutral and articulate female voice
⚠️
Custom voices are not supportedThe engine only accepts the preset voice IDs above. Custom voice ids will be rejected with a 400 error — use the presets for maximum compatibility.

API Endpoints

Synthesize Speech

POST/v1/tts/synthesize

Convert text to speech and receive a hosted audio URL. Billed per character after successful synthesis.

{
  "text": "Hello! Welcome to TetraX.",
  "voice": "alloy",        // optional: default | alloy | echo | fable | onyx | nova | shimmer
  "format": "mp3"          // optional: mp3 | pcm
}

Response

{
  "success": true,
  "generation_id": "gen_xxx",
  "job": {
    "id": 1,
    "characters": 26,
    "voice": "alloy",
    "format": "mp3",
    "audio_url": "https://APIURL.tetrax.in/v1/tts/audio/s2_1_xxx.mp3",
    "charge": 0.03
  },
  "model": "tetrax-neural-tts",
  "pricing": { "per_char": 0.001, "minimum_bill": 0.01 }
}

Request Parameters

ParameterTypeRequiredDescription
textstringYesThe text to synthesize. Max 5,000 characters.
voicestringNoVoice preset. Defaults to "default". See voice presets above.
formatstringNoOutput format: mp3 or pcm. Defaults to mp3.

Synthesis History

GET/v1/tts/jobs

Retrieve synthesis history for your account. Requires dashboard JWT auth.

GET /v1/tts/jobs?limit=50

Response

{
  "jobs": [
    {
      "id": 1,
      "text": "Hello! Welcome to TetraX.",
      "characters": 26,
      "voice": "alloy",
      "format": "mp3",
      "audio_url": "https://APIURL.tetrax.in/v1/tts/audio/s2_1_xxx.mp3",
      "status": "completed",
      "charge": 0.03,
      "created_at": "2026-07-23T12:00:00.000Z"
    }
  ],
  "total": 12
}

Analytics

GET/v1/tts/analytics

Get month-to-date synthesis analytics including character and spend totals.

GET /v1/tts/analytics

Response

{
  "summary": {
    "total_syntheses": 12,
    "total_characters": 1240,
    "total_charge": 1.24,
    "avg_chars_per_job": 103
  }
}

List Voice Presets

GET/v1/tts/voices

List the available voice presets for the S2.1 Pro model.

GET /v1/tts/voices

Response

{
  "voices": [
    { "id": "default", "name": "Default (Natural)", "description": "Balanced, natural-sounding default voice" },
    { "id": "alloy", "name": "Alloy", "description": "Bright and energetic female voice" }
  ]
}

Error Codes

The TTS API uses standard HTTP status codes to indicate success or failure. Error responses include a descriptive message in the response body.

CodeDescription
200OK — Speech synthesized and audio URL returned.
400Bad Request — Missing text, invalid voice, or unsupported format (only mp3/pcm).
401Unauthorized — Missing or invalid API key. Include the x-api-key header with a valid trx_tts_ key.
403Forbidden — Invalid API key type. A Tetrax TTS API Key (trx_tts_...) is required.
402Payment Required — Insufficient wallet balance. Top up from the Billing page.
429Too Many Requests — Rate limit exceeded for your account.
502Bad Gateway — The TTS provider failed to synthesize audio. Retry the request (you were not charged).
503Service Unavailable — TTS provider is not configured on the platform yet.

Rate Limits

Rate limits protect the API from abuse and ensure fair usage across all customers. Limits are enforced per API key and configured per account (set per account — no monthly fee).

AccountMax Syntheses Per MinutePrice Per Character
StandardUp to 240/min₹0.001/char
Enterprise600/minCustom
⚠️
Rate Limit ResponseWhen a rate limit is exceeded, the API returns a 429 Too Many Requests response with the number of seconds to wait before retrying.

Pricing & Billing

The TTS API uses prepaid wallet billing at ₹0.001/char per character with a ₹0.01 minimum bill per synthesis — no subscriptions, no monthly fees. The charge is deducted from your wallet only after a successful synthesis, and the exact amount is recorded in your wallet transaction history under tts_usage.

Pay As You Go

One flat price
₹0.001 per character

Same rate for every account — no subscriptions, no monthly fees. ₹0.01 minimum bill per synthesis.

Rate limitUp to 240 syntheses/min
Higher limitsContact support to raise
ℹ️
Example Cost1,000 characters of speech costs ₹1.00. A typical 200-character welcome message costs ₹0.20 — deducted only on success.

Try it in the Dashboard

Test the TTS API interactively from the TTS Playground in your dashboard.

Open Dashboard →

Was this page helpful?

Help us improve our documentation.