Cloud Text to Speech API for IVR Integration

By VocalEdge editorial team · Updated 2026-11-18

This documentation provides the technical specifications for integrating VocalEdge’s cloud Text-to-Speech API into your IVR systems. It is designed for IVR developers and contact center managers who need to replace robotic voices with clear, realistic synthetic speech to reduce customer friction. You will find the exact endpoint structure, authentication methods, and voice parameters required to build natural-sounding phone menus.

Learn how to generate audio files using standard HTTP requests or the official OpenAI SDKs. This page covers essential details like rate limits, supported languages, and response formats such as MP3 and WAV. Use these facts to implement reliable speech synthesis that fits seamlessly into your existing telephony infrastructure without needing custom plugins or proprietary SDKs.

Cloud Text to Speech API for IVR Integration

Frequently asked questions

How do I get an API key?

Sign up on the /get-api-key/ page using Google or an email and password. The dashboard displays your active Bearer token, balance, and usage statistics. Each account holds one active key; issuing a new one immediately invalidates the previous one, ensuring secure access to the speech endpoint.

Can I use the OpenAI Python SDK?

Yes. The API uses the same request shape as the OpenAI speech endpoint. Simply configure your SDK’s base_url to https://api.tmb666casino.com/v1 and provide your VocalEdge key. This allows you to use standard OpenAI client libraries without custom integration code for generating audio from text.

What is the maximum text length?

Each request supports up to 4096 characters, including spaces and punctuation. For longer texts, split the input into chunks of this size and join the resulting audio files. This limit applies to both tts-1 and tts-1-hd models, ensuring consistent processing behavior across different voice presets.

How do I set the language explicitly?

Include the optional 'language' field with an ISO code in your JSON body. If omitted, the system guesses the language, defaulting to English for Latin script. Explicitly setting it is recommended for non-English Latin texts to ensure accurate pronunciation across our 23 supported languages.

Does the API support streaming?

No. The API returns the complete audio file in the response body; there is no WebSocket or real-time partial audio streaming. You receive the full file once synthesis completes. This approach simplifies integration for IVR systems that require complete audio segments before playing them to callers.

What happens if I exceed rate limits?

The limit is 60 requests per minute per key (10 per minute before the first top-up). Excess requests wait in a queue and process sequentially. If synthesis fails, the charge is returned in full. Under load, requests may experience delays due to sequential processing.

Can I generate audio in parallel?

Requests are processed one after another, so parallel generation may cause queuing delays. You can split long texts into parts and generate them, but requests are processed sequentially. This sequential nature ensures consistent resource usage but may increase total generation time for large volumes.

Is the API key tied to an IP?

No. The key is tied to your account, not a specific IP address. You can use it from any server or location. Just include the Authorization header with your Bearer token. This flexibility allows easy deployment across different contact center infrastructures without IP whitelisting requirements.

How do I handle large text files?

Split your text into segments of up to 4096 characters. Send each segment as a separate POST request to the speech endpoint. Then, join the returned audio files in the correct order. This method ensures you stay within character limits while maintaining the flow of your IVR messages.

Do I need to install a specific library?

No. You can use the official OpenAI SDKs or plain HTTP requests. The API follows standard REST conventions. No proprietary library or mobile SDK is required. Simply send a JSON payload with your key, model, voice, and input text to receive the generated audio file.

First request

curl

curl https://api.tmb666casino.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.tmb666casino.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.tmb666casino.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 and Keys

Sound wave illustration for: Authentication and Keys

Access the VocalEdge API by signing up on the /get-api-key/ page. You can register using Google or an email and password combination. Each account receives a unique API key that serves as the credential for all requests.

Generate Your API Key

Generate Your API Key

Navigate to the dashboard to view your active key and usage details. The key begins with 'tts-' and is tied to your specific site account. Ensure you keep this credential secure, as it controls your billing and access.

  • Sign up via Google or email/password
  • One active key per account
  • View key in dashboard

Authorization Header Format

Authorization Header Format

Include your key in the HTTP header for every request. Use the format 'Authorization: Bearer tts-<your_key>'. This header authenticates your identity and links the audio generation to your account balance.

Rotating Keys for Security

You can issue a new key at any time from your dashboard. When a new key is generated, the old one stops working immediately. This allows for quick revocation if a key is compromised without affecting your balance or usage history.

  • Issue new key anytime
  • Old key stops at once
  • Immediate security rotation

Endpoint: Create Audio

Sound wave illustration for: Endpoint: Create Audio

Send your text payload to the /v1/audio/speech endpoint via a simple HTTP POST request. The service processes the input and returns the synthesized audio file directly in the response body, allowing IVR systems to cache the audio for playback.

JSON Body Structure

The request body must be a valid JSON object containing the necessary parameters for synthesis. The engine expects specific fields to determine the voice model, input text, and output format.

  • model: "tts-1" or "tts-1-hd"
  • input: your text string (max 4096 characters)
  • voice: one of the 8 available presets
  • response_format: mp3, wav, opus, flac, or pcm

Required and Optional Fields

The input field carries the actual script text, while voice selects from presets like Aria or Atlas. You can optionally specify speed (0.25–4.0) and language (ISO code) to fine-tune the output.

Voice Parameters

Sound wave illustration for: Voice Parameters

VocalEdge provides eight distinct voice presets designed for IVR systems, ranging from the warm, clear narrator 'Aria' to the energetic, promo-focused 'Felix'. These licensed recordings, sourced from LibriVox, allow contact center managers to select tones that reduce customer friction, whether for calm instructional guides or upbeat promotional alerts.

Available Voice Presets

Female voices include Aria (warm narrator), Nova (bright and upbeat), Luna (soft storytelling), and Sage (calm instructional). Male options offer Felix (energetic promo), Milo (friendly conversation), Atlas (neutral news), and Orion (deep documentary). Each voice is optimized for natural-sounding automated calls.

  • Aria: Warm, clear narrator
  • Nova: Bright, upbeat
  • Luna: Soft, storytelling
  • Sage: Calm, instructional
  • Felix: Energetic, promo
  • Milo: Friendly, conversational
  • Atlas: Neutral, news
  • Orion: Deep, documentary

Speed Control (0.25–4.0)

Adjust the speed parameter between 0.25 and 4.0 to match your IVR pacing. Faster speeds suit quick menu prompts, while slower rates improve clarity for complex instructions. Keep in mind that shorter phrases may take a few seconds to generate, so test latency under load.

Language Code Specification

Specify the language parameter using an ISO code for 23 supported languages, including English, Spanish, German, French, Japanese, and Mandarin. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Explicitly setting the language ensures accuracy for non-English Latin scripts.

Response Formats

Sound wave illustration for: Response Formats

Choose the audio format that matches your telephony infrastructure. MP3 provides efficient compression for modern web players and VoIP gateways, while WAV offers uncompressed quality for legacy PBX systems that require standard PCM wave files.

Select Opus, FLAC, or PCM based on your bandwidth and storage needs. Opus ensures efficient compression for IVR prompts, FLAC preserves lossless quality for archival, and PCM delivers raw data for direct hardware integration.

MP3 for Web Players

MP3 is the default choice for modern web-based IVR interfaces. It balances file size and quality, ensuring quick loading times for users accessing phone menus via mobile browsers or web apps.

  • Supports standard web audio players
  • Efficient bandwidth usage for high-traffic calls

WAV for Legacy Systems

WAV files provide uncompressed audio, ideal for legacy PBX systems that require standard PCM wave files. Many legacy PBX systems require standard WAV formats to ensure consistent playback.

Use WAV when your existing IVR hardware has strict format requirements. It guarantees bit-perfect audio delivery, preserving the clarity of your synthetic voices for customers on older landline connections.

  • Uncompressed, high-fidelity audio
  • Compatible with older PBX hardware

Opus, FLAC, and PCM Options

Opus offers superior compression for low-bandwidth environments, making it perfect for mobile IVR interactions where data speed is critical. FLAC provides lossless compression for archival purposes without sacrificing audio quality.

PCM delivers raw audio data, suitable for direct integration with hardware devices. Use these formats when your specific infrastructure demands precise control over audio encoding.

  • Opus: Low latency, high compression
  • FLAC: Lossless quality for archives
  • PCM: Raw data for hardware integration

Rate Limits and Throttling

Sound wave illustration for: Rate Limits and Throttling

VocalEdge enforces a rate limit of 60 requests per minute per API key. This capacity supports steady IVR call flows without overwhelming the synthesis engine during peak hours.

60 Requests Per Minute

The standard limit allows 60 synthesis requests per minute. This throughput is sufficient for most contact center volumes when requests are batched or triggered by user dial actions.

10 Requests Before Top-up

New accounts or those without a recent top-up are limited to 10 requests per minute. This lower threshold prevents resource exhaustion before your USDT payment is confirmed.

Handling Queue Delays

Requests are processed sequentially. During high load, a request may wait in a queue before synthesis begins. Longer texts take roughly real-time to generate, so plan your IVR timing accordingly.

  • Requests are processed one after another.
  • Short phrases take a few seconds to generate.
  • Long texts generate at roughly 25 characters per second.
Rate Limits and Throttling

Error Handling

Sound wave illustration for: Error Handling

When integrating VocalEdge into your IVR system, understanding how the API handles errors ensures smooth call flows without awkward silence or abrupt disconnections. Errors are reported via standard HTTP status codes, allowing your telephony platform to react appropriately based on the response type.

HTTP Status Codes

The API returns standard HTTP status codes to indicate success or failure. A 200 OK response confirms the audio file is ready in the response body. Client errors (4xx) indicate issues like invalid authentication or malformed requests, while server errors (5xx) suggest temporary backend issues.

  • 401 Unauthorized: Invalid or missing API key.
  • 400 Bad Request: Missing required fields or invalid JSON.
  • 429 Too Many Requests: Rate limit exceeded.
  • 500 Internal Server Error: Temporary processing failure.

Invalid Voice Names

If you specify a voice not in our preset list, the API returns a 400 error. Ensure you use one of the eight available voices: aria, nova, luna, sage, felix, milo, atlas, or orion. Case sensitivity applies, so use lowercase names exactly as listed.

Text Length Exceeds 4096 Chars

Each request supports a maximum of 4096 characters, including spaces and punctuation. If your IVR script exceeds this limit, split the text into smaller chunks, generate audio for each part, and concatenate the resulting audio files. This ensures no data truncation occurs during synthesis.

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

The VocalEdge API mirrors the OpenAI speech endpoint structure, allowing you to reuse existing integrations with minimal configuration. By simply redirecting the base URL, your current codebase can generate IVR audio without rewriting core logic or adopting a new client library.

Setting the Base URL

Configure your SDK client to point to https://api.tmb666casino.com/v1 instead of the standard OpenAI endpoint. This single change ensures all subsequent requests for audio synthesis route directly to our cloud infrastructure while maintaining the familiar request shape.

Using Official SDKs

Leverage the official OpenAI Python or Node.js SDKs to handle payload serialization. Since we replicate the tts-1 and tts-1-hd model structure, you can switch providers seamlessly without learning new parameter names or response formats.

Code Example in Python

Initialize the client with your tts-... key and override the base URL to integrate VocalEdge. The following snippet demonstrates a standard synthesis call, returning audio data ready for playback in your contact center application.

  • ```python
  • import openai
  • client = openai.OpenAI(api_key="tts-your-key", base_url="https://api.tmb666casino.com/v1")
  • response = client.audio.speech.create(
  • model="tts-1",
  • voice="aria",
  • input="Welcome to our support line."
  • )

Curl Example for Quick Test

Sound wave illustration for: Curl Example for Quick Test

Use curl to verify your API key and voice selection instantly. This method requires no external libraries, making it ideal for quick sanity checks in your contact center workflow before integrating with your IVR platform.

Run the command below, replacing the placeholder with your actual token. The response returns raw audio bytes, which you can pipe directly into a file for immediate playback testing.

Basic POST Request

Send a simple request to test connectivity. This confirms your key is valid and the endpoint is reachable.

curl -X POST "https://api.tmb666casino.com/v1/audio/speech" \ -H "Authorization: Bearer tts-your-key-here" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Hello, welcome to our support line.", "voice": "aria"}'

Including Voice and Format

Specify your preferred voice preset and output format. Aria is a warm narrator suitable for general menus, while Milo offers a friendly, conversational tone for IVR prompts.

Add the format parameter to match your system's requirements. For standard web players, mp3 is efficient. For legacy PBX systems, wav provides uncompressed clarity.

Reading the Response Binary

The API returns raw binary data. Save it to a file using the -o flag to listen immediately.

curl -s -o output.mp3 -X POST "https://api.tmb666casino.com/v1/audio/speech" \ -H "Authorization: Bearer tts-your-key-here" \ -d '{"model": "tts-1", "input": "Your call is important to us.", "voice": "milo", "response_format": "mp3"}'

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Selecting the right vocal identity is critical for IVR effectiveness.

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. openai-python on GitHub
  3. ISO 639 language codes
  4. W3C WAI: making audio and video accessible
  5. Creative Commons Attribution 4.0
  6. curl documentation
  7. Node.js documentation
  8. LibriTTS-R corpus (OpenSLR 141)
  9. MDN: Web Speech API
  10. Tether (USDT)
  11. openai-node on GitHub
  12. FFmpeg documentation

More on this site