API Documentation for Text to Speech Generation

By IVR Voices editorial team · Updated 2026-11-18

This documentation provides a practical guide for developers building IVR systems and call center applications with IVR Voices. We help startups integrate reliable text-to-speech audio without enterprise contracts, offering clear voices and transparent pricing. You will find concrete steps to authenticate, send requests, and handle responses using standard HTTP methods.

Get started quickly with our OpenAI-compatible endpoint. We cover essential topics including rate limits, supported formats like MP3 and WAV, and voice selection. Whether you are using cURL or the official OpenAI SDK, this guide ensures you can generate synthetic speech for your telephony workflows efficiently and correctly.

API Documentation for Text to Speech Generation

Frequently asked questions

How do I get an API key?

Visit /get-api-key/ to sign up using Google or email. Your account page displays your active API key, balance, and usage. You can issue a new key at any time; the previous one stops immediately. This key authenticates all requests to the API.

What is the maximum text length?

Each request supports up to 4096 characters of input text. Spaces and punctuation count toward this limit. For longer texts, split the content into chunks of 4096 characters or less, generate audio for each part, and join the resulting audio files.

Can I stream audio?

No, the API does not support streaming or WebSocket connections. You send a POST request and receive the complete audio file in the response. This is a standard RESTful endpoint, so you receive the full file after processing completes.

Does the API support SSML?

No, the API does not support SSML. It accepts plain text input only. There are no phoneme dictionaries or custom pronunciation lexicons available. You control pacing and tone by adjusting the speed parameter or selecting different voice presets.

How do I handle errors?

Failed requests are free, and the charge is returned in full if synthesis fails. Check the response status code for details. Ensure your API key is valid and your input text is under 4096 characters. Support is by email only.

What is the base URL?

The API base URL is https://api.xx555bd.com/v1. Use this for all endpoints, including POST /v1/audio/speech for generation and GET /v1/voices for listing available options. Official OpenAI SDKs work by changing their base_url to this address.

Are there SDKs for other languages?

We do not provide an official SDK. However, since the request shape matches the OpenAI speech endpoint, you can use the official OpenAI SDKs for any language by setting the base_url to https://api.xx555bd.com/v1. Plain HTTP requests also work.

How do I split long texts?

Split your text into parts of up to 4096 characters each. Send each part as a separate POST request to /v1/audio/speech. Once you receive all audio files, join them together to create the final complete audio track for your IVR system.

What happens if the server is busy?

Requests are processed sequentially. Under load, a request may wait in a queue. Typical speed is roughly real-time (25 characters per second), but short phrases may take a few seconds. Failed requests remain free even if delayed.

Is the API RESTful?

Yes, the API is RESTful. It uses standard HTTP methods: POST for generating speech and GET for retrieving voices or models. You send JSON bodies and receive audio files or JSON metadata. This makes it easy to integrate with any web stack.

Can I use the same key for multiple projects?

Yes, one active API key per account is issued. You can use this single key across multiple projects or applications. The rate limit of 60 requests per minute applies to the key, so ensure your combined usage stays within this limit.

How do I verify the audio format?

Specify the desired format in the request body using the response_format field. Options include mp3, wav, opus, flac, and pcm. The API returns the audio file in the exact format you requested, ensuring compatibility with your IVR system's requirements.

What is the speed range?

You can adjust the speech speed between 0.25 and 4.0. The default speed is 1.0. Lower values slow down the narration, while higher values increase the pace. This helps you match the voice to your specific IVR tone requirements.

Do I need a developer to use it?

While a developer can integrate the API easily, the documentation provides ready curl examples. You can use the API directly via HTTP requests if you are comfortable with basic technical tasks.

First request

curl

curl https://api.xx555bd.com/v1/audio/speech \
  -H "Authorization: Bearer $TTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"tts-1","voice":"aria","input":"Hello from the API.","response_format":"mp3"}' \
  --output hello.mp3

Python (openai)

from openai import OpenAI

client = OpenAI(base_url="https://api.xx555bd.com/v1", api_key="tts-...")

with client.audio.speech.with_streaming_response.create(
    model="tts-1", voice="nova", input="Hello from Python.", response_format="mp3"
) as response:
    response.stream_to_file("hello.mp3")

Node.js (openai)

import OpenAI from "openai";
import fs from "node:fs";

const client = new OpenAI({ baseURL: "https://api.xx555bd.com/v1", apiKey: process.env.TTS_API_KEY });
const res = await client.audio.speech.create({ model: "tts-1", voice: "milo", input: "Hello from Node.js." });
fs.writeFileSync("hello.mp3", Buffer.from(await res.arrayBuffer()));
voice
ariafemale
novafemale
lunafemale
sagefemale
felixmale
milomale
atlasmale
orionmale
language
arالعربية
zh中文
daDansk
nlNederlands
enEnglish
fiSuomi
frFrançais
deDeutsch
elΕλληνικά
heעברית
hiहिन्दी
itItaliano
ja日本語
ko한국어
msBahasa Melayu
noNorsk
plPolski
ptPortuguês
ruРусский
esEspañol
swKiswahili
svSvenska
trTürkçe

Authentication

Sound wave illustration for: Authentication

Authentication for the IVR Voices API relies on a single bearer token passed in the HTTP header. This key identifies your account and tracks your usage against your current balance. Without a valid key, requests will be rejected immediately.

API Key Header

API Key Header

Include the header Authorization: Bearer tts-... with every request to https://api.xx555bd.com/v1. The key must be sent exactly as generated in your dashboard.

Key Rotation

Key Rotation

You can issue a new key at any time from your account page. The previous key stops working immediately, ensuring no overlap or confusion during rotation.

Single Key Limit

Each account maintains only one active key at a time. This simplifies integration for IVR systems by removing the need to manage multiple token lifecycles or invalidate old tokens manually.

Endpoints

Sound wave illustration for: Endpoints

The API provides three primary endpoints for generating audio and managing resources. Use the speech endpoint to send text and receive an audio file, while the voices and models endpoints list available options and pricing.

Speech Endpoint

Send a POST request to /v1/audio/speech with a JSON body containing the text, voice, and format. The endpoint returns the generated audio file directly in the response.

  • Endpoint: POST https://api.xx555bd.com/v1/audio/speech

Voices List

Call GET /v1/voices to retrieve available voices, languages, and formats. This list includes eight presets like Aria, Nova, and Felix, each with specific tone characteristics suitable for IVR systems.

  • Endpoint: GET https://api.xx555bd.com/v1/voices

Models List

Use GET /v1/models to view available models. Currently, tts-1 and tts-1-hd are available, offering the same engine and price for different quality tiers.

  • Endpoint: GET https://api.xx555bd.com/v1/models

Request Parameters

Sound wave illustration for: Request Parameters

Configure the synthesis request by defining the input text, selecting a voice preset, and choosing the output format. The API accepts plain text up to 4096 characters per request. Spaces and punctuation are counted toward this limit, so split longer texts into multiple requests to ensure reliable delivery.

Input Text Length

Each API call processes a maximum of 4096 characters. If your IVR message exceeds this, split the text into segments and concatenate the resulting audio files. Short phrases typically take a few seconds to generate, while longer texts process at roughly real-time speed.

  • Maximum 4096 characters per request
  • Spaces and punctuation count as characters
  • Split longer texts into multiple requests

Voice Selection

Choose from eight presets based on your IVR tone. Female voices include Aria (warm narrator), Nova (upbeat), Luna (storytelling), and Sage (instructional). Male options are Felix (energetic promo), Milo (conversational), Atlas (neutral news), and Orion (deep documentary).

  • Aria, Nova, Luna, Sage (Female)
  • Felix, Milo, Atlas, Orion (Male)
  • Any voice supports any of 23 languages

Response Format

Select the audio format using the response_format field. Supported formats include MP3, WAV, OPUS, FLAC, and PCM. MP3 and WAV are standard for most IVR systems, while OPUS offers efficient compression for bandwidth-constrained environments.

  • MP3, WAV, OPUS, FLAC, PCM
  • Standard compatibility for IVR players
  • OPUS for bandwidth efficiency

Response Codes

Sound wave illustration for: Response Codes

The API returns standard HTTP status codes to indicate the result of your synthesis request. A 200 OK status confirms that the audio file has been generated and is included in the response body. Failed requests are free: if synthesis fails, the charge is returned in full.

Success Response

Upon successful processing, the endpoint returns a 200 OK status. The response body contains the raw audio data in the requested format (MP3, WAV, OPUS, FLAC, or PCM). You can directly save this binary data to your server for playback in your IVR system.

  • Status: 200 OK
  • Body: Raw audio bytes
  • Content-Type: Matches requested format

Error Handling

The API provides clear error messages for common issues. If the input text exceeds 4096 characters or the voice ID is invalid, you will receive a 400 Bad Request response. Failed synthesis attempts are free, so you can retry with adjusted parameters without incurring charges.

  • 400: Invalid parameters
  • 401: Unauthorized or invalid key
  • 422: Unprocessable input

Rate Limit Errors

If you exceed the limit of 60 requests per minute, the API returns a 429 Too Many Requests error. This ensures fair usage for all startups. Implement exponential backoff in your integration to handle queue delays gracefully without dropping calls.

  • 429: Rate limit exceeded
  • Limit: 60 requests/minute
  • Retry after delay

cURL Example

Sound wave illustration for: cURL Example

Send a POST request to the speech endpoint with your Bearer token and desired parameters. The API processes the text synchronously, returning the audio file directly in the response body.

Basic Request

Use cURL to test the integration quickly. Replace YOUR_API_KEY with your key from the dashboard.

  • Endpoint: https://api.xx555bd.com/v1/audio/speech
  • Method: POST
  • Header: Authorization: Bearer YOUR_API_KEY

JSON Body

Include the model, voice, input text, and response format in the request body. The text must be under 4096 characters.

  • model: "tts-1"
  • voice: "nova"
  • input: "Hello, welcome to our support line."
  • response_format: "mp3"

Audio Output

The response contains the raw audio data. Save this binary output to a file for playback in your IVR system.

cURL Example

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

Integrate our TTS API using the official OpenAI SDKs by simply changing the base_url. This allows you to leverage familiar libraries without rewriting your code logic. The request shape remains identical to the standard OpenAI speech endpoint, ensuring a smooth transition for existing developers.

Our API base URL is https://api.xx555bd.com/v1. By pointing your SDK client to this endpoint, you can use the same SpeechClient methods. This approach works with any language supported by the OpenAI SDK, making deployment quick and reliable for IVR systems.

Base URL Change

Update your client configuration to point to our API base URL: https://api.xx555bd.com/v1. This single change redirects all speech generation requests to our infrastructure while maintaining the standard OpenAI request structure.

Ensure your authentication header uses your unique tts-... key. The SDK will handle the request formatting automatically, so you only need to adjust the endpoint and credentials.

SDK Compatibility

The OpenAI SDKs work seamlessly because our endpoint accepts the same JSON body structure. You can use any language binding available for the OpenAI client, such as Python, Node.js, or Go.

No custom SDK is required. We support the standard model, input, voice, and response_format fields. This compatibility reduces integration time and leverages well-tested client libraries for error handling and retries.

Code Snippet

```python import openai client = openai.OpenAI( base_url="https://api.xx555bd.com/v1", api_key="tts-your-api-key-here" ) response = client.audio.speech.create( model="tts-1", voice="nova", input="Hello, this is a test call for your IVR system.", response_format="mp3" ) response.stream_to_file("output.mp3") `` This example demonstrates a basic integration. Replace tts-your-api-key-here` with your actual key from the dashboard. The SDK handles the HTTP request and saves the audio file directly to your storage.

Rate Limits

Sound wave illustration for: Rate Limits

The API enforces a standard limit of 60 requests per minute per key. This cap applies to all authenticated accounts.

60 Requests Per Minute

You can make up to 60 synthesis requests per minute. This limit is consistent regardless of your balance tier. If you exceed this rate, the API returns a 429 status code.

  • Standard limit: 60 requests/minute
  • Applies per API key
  • Returns 429 on exceed

Trial Limit

New accounts with free trial credit start with a stricter limit of 10 requests per minute. This lower threshold helps prevent rapid consumption of the small trial balance.

Queue Processing

Requests are processed sequentially. Under heavy load, your requests may wait in a queue before synthesis begins. Typical speed is roughly real-time, but short phrases may take a few seconds. Plan your IVR routing accordingly to handle slight delays.

Supported Formats

Sound wave illustration for: Supported Formats

Choose the audio format that best fits your IVR system’s bandwidth and latency requirements. All formats are generated directly from the same high-quality engine, ensuring consistent voice quality regardless of your selection.

MP3

The default format, offering broad compatibility with most telephony systems and web players. It provides a good balance between file size and audio quality for standard voice prompts.

  • Universal playback support
  • Small file size

WAV

Uncompressed PCM audio in a standard container. Ideal for legacy IVR systems that require raw audio data without encoding artifacts, ensuring maximum fidelity for critical announcements.

  • Lossless quality
  • High bandwidth usage

OPUS

A modern, highly efficient codec suitable for web-based IVR interfaces. It delivers excellent audio quality at lower bitrates, reducing data transfer costs for mobile or web applications.

  • High compression efficiency
  • Low latency

FLAC

Lossless compressed audio, preserving the full dynamic range while keeping file sizes smaller than WAV. Useful for archival purposes or high-fidelity voice banking systems.

  • Lossless compression
  • Archival quality

PCM

Raw, uncompressed audio data without container overhead. Best for embedded systems or specialized telephony hardware that handles audio decoding directly from the byte stream.

  • No container overhead
  • Raw data stream

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. You can quickly prototype IVR flows using standard library methods.

Avatar of the voice aria
ariafemale
Avatar of the voice nova
novafemale
Avatar of the voice luna
lunafemale
Avatar of the voice sage
sagefemale
Avatar of the voice felix
felixmale
Avatar of the voice milo
milomale
Avatar of the voice atlas
atlasmale
Avatar of the voice orion
orionmale

23 languages

Any voice speaks any of these languages.

Sources and further reading

  1. Wikipedia
  2. LibriTTS-R paper (arXiv 2305.18802)
  3. curl documentation
  4. openai-node on GitHub
  5. TRON developer hub: TRC-20
  6. Python documentation
  7. LibriTTS-R corpus (OpenSLR 141)
  8. FFmpeg documentation
  9. Tether (USDT)
  10. ISO 639 language codes
  11. openai-python on GitHub
  12. Node.js documentation

More on this site