Complete Quickstart Guide to Our Text-to-Speech API

By CallFlow Editorial Team · Updated 2026-11-18

This guide provides the essential technical details for integrating ClearVoice’s text-to-speech API into your call center or IVR infrastructure. You will learn how to authenticate, format requests, and manage character limits to ensure reliable audio generation at scale. The documentation covers the complete workflow from key generation to error handling, designed for engineering teams deploying high-volume voice solutions.

We assume you are familiar with basic HTTP concepts and JSON structures. The examples use cURL and the OpenAI SDK for compatibility, but the endpoint follows a standard REST pattern. This resource helps you quickly implement synthetic voice generation for agent prompts, customer notifications, and automated phone systems without needing custom SDKs or complex setup procedures.

Complete Quickstart Guide to Our Text-to-Speech API

Frequently asked questions

How do I get an API key?

Sign up on the /get-api-key/ page using Google or email. Accounts are per site. The dashboard displays your active API key, balance, and usage statistics. You can issue a new key at any time, which immediately invalidates the previous one. This ensures secure access for your call center integrations.

Can I use the OpenAI Python SDK?

Yes. The request shape matches the OpenAI speech endpoint. Simply change the base_url to https://api.play76s.com/v1 and use your ClearVoice key. This allows you to use the official OpenAI SDKs directly by changing the base URL, simplifying integration for your development teams.

What is the base URL for the API?

The base URL is https://api.play76s.com/v1. All requests, including speech synthesis and voice listing, use this domain. Ensure your authentication header uses Bearer followed by your specific API key to authorize requests correctly against the ClearVoice infrastructure.

How do I specify the voice?

Include the voice field in your JSON body with one of eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. You can also optionally set the language ISO code to guide synthesis, though the system guesses Latin script as English by default.

What format does the response return?

The API returns an audio file directly in the response body. Supported formats include mp3, wav, opus, flac, and pcm. You specify your preferred format using the response_format field. The file is generated and returned in the response upon successful synthesis completion.

What happens if I exceed the rate limit?

You are limited to 60 requests per minute per key (10 before the first top-up). Requests are processed sequentially, so under load, requests may queue. Exceeding limits may result in delays or temporary rejection until the window resets. Monitor your usage via the dashboard.

Can I change the speed of the voice?

Yes. Use the speed parameter with a value between 0.25 and 4.0. This allows you to adjust playback speed for IVR prompts or call center scripts. The default speed is 1.0. Adjustments apply to both tts-1 and tts-1-hd models.

Is SSML supported in the input?

No. The API accepts plain text input only. There is no support for SSML tags, phoneme dictionaries, or custom pronunciation lexicons. You must format your text as standard strings. The input is limited to 4096 characters per request.

How do I handle errors in my code?

Failed requests are free: if synthesis fails, the charge is returned in full. Your code should check the HTTP status code. If synthesis fails, the API returns an error response without consuming your character balance. Ensure your integration handles these responses gracefully to maintain billing accuracy.

Do I need to split text manually?

Yes. Each request supports up to 4096 characters. For longer texts, you must split the input into parts, send separate requests, and join the resulting audio files. This ensures reliable synthesis within the character limit constraints of the API endpoint.

First request

curl

curl https://api.play76s.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.play76s.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.play76s.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

Secure your API access by generating a unique key on the /get-api-key/ page. You can sign up using Google or create an account with an email and password. Each account is tied to a single active key, which is displayed alongside your current balance and usage statistics.

The authentication mechanism relies on a standard Bearer token included in the HTTP header. This format ensures compatibility with existing HTTP clients and allows for straightforward integration into your call center’s IVR infrastructure without requiring proprietary middleware.

Generate Your API Key

Navigate to the /get-api-key/ page after signing in. The dashboard displays your active key, current balance, and character usage. You can generate a new key at any time, which immediately invalidates the previous one, ensuring tight control over access credentials.

  • Sign up via Google or email/password
  • View key, balance, and usage stats
  • Generate new key anytime to invalidate old

Bearer Token Format

Include your key in the Authorization header as a Bearer token. The format is Authorization: Bearer tts-<your-key>. This standard header works with the OpenAI SDK and any standard HTTP client, simplifying integration for large teams managing hundreds of agents.

The key format begins with tts- to distinguish it from other potential identifiers. Ensure no extra whitespace is included in the header value to avoid authentication errors during high-volume IVR requests.

  • Format: Authorization: Bearer tts-<your-key>
  • Works with standard HTTP clients
  • No extra whitespace in header

Key Rotation Policy

You can issue a new key at any time via the dashboard. When a new key is generated, the old key stops working immediately. This allows for zero-downtime rotation if a key is compromised or rotated during regular maintenance cycles.

Since accounts are per site, ensure your team uses the correct domain’s key. There is no need to manage multiple keys for different agents; one key per account handles all requests within the rate limits.

  • New key invalidates old immediately
  • Zero downtime for rotation
  • One key per account

Quickstart with cURL

Sound wave illustration for: Quickstart with cURL

This section demonstrates the core interaction with the ClearVoice API using cURL, the standard tool for call center integration teams. You will send a POST request to the speech endpoint with your audio parameters and receive a binary audio file directly in your terminal or script environment.

The process is straightforward: authenticate with your Bearer token, specify the model and voice, and provide the text input. The API handles the synthesis and returns the audio file, ready for immediate playback or IVR queue insertion.

Basic POST Request

Send a POST request to https://api.play76s.com/v1/audio/speech. Include your API key in the Authorization header and set the content type to application/json. The body must contain the model, input text, and voice preset. For example, use nova for a bright, upbeat tone suitable for promotional IVR messages or atlas for neutral news-style updates.

Ensure your text input does not exceed 4096 characters. The API accepts standard UTF-8 text. You can also optionally specify a speed between 0.25 and 4.0 to adjust the playback rate for your specific call center needs.

  • Endpoint: POST https://api.play76s.com/v1/audio/speech
  • Header: Authorization: Bearer tts-your-api-key
  • Body: JSON object with model, input, voice

Response JSON Structure

On success, the API returns an HTTP 200 status code with the binary audio data in the response body. The content type will match your requested format (e.g., audio/mpeg for mp3). There is no JSON wrapper for the audio itself; the file data is returned in the response body.

If you request a format like WAV or FLAC, the response body contains the corresponding binary data. You can pipe this output directly into a file for storage or pass it to your telephony platform for immediate playback.

Error Handling Codes

If the request fails, the API returns a JSON error object with a descriptive message. Common errors include 401 Unauthorized for invalid API keys, 429 Too Many Requests if you exceed the 60 requests per minute limit, or 400 Bad Request for invalid parameters.

Always check the HTTP status code and parse the error message to debug issues quickly. Failed requests do not consume your character credit, so you can retry them without penalty.

  • 401: Invalid API Key
  • 429: Rate Limit Exceeded
  • 400: Invalid Request Parameters
Quickstart with cURL

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

The ClearVoice API mirrors the OpenAI speech endpoint structure, allowing teams to leverage existing OpenAI SDKs with minimal code changes. This compatibility simplifies integration for call center infrastructure already familiar with standard HTTP client patterns.

By adjusting the base URL, developers can direct requests to our endpoint while retaining the same request shape for model, voice, and input parameters.

Set Base URL

Point your OpenAI SDK client to https://api.play76s.com/v1. This directs all requests to our TTS infrastructure without requiring a custom library.

Configure SDK Client

Initialize the client with your API key using the standard Authorization: Bearer header format. Ensure your key starts with tts-.

Send Speech Request

Pass the text, voice preset, and desired format (mp3, wav, opus, flac, pcm) exactly as you would for the OpenAI speech endpoint. The SDK handles the JSON payload and returns the audio file directly.

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts text inputs up to 4,096 characters per request, with spaces and punctuation counted toward the limit. For longer scripts, clients must split text into chunks and join the resulting audio files sequentially.

Voice selection requires one of eight presets, such as 'aria' for narration or 'atlas' for news. The system guesses the language from the script if not explicitly set, though specifying the ISO code is recommended for Latin-script non-English texts.

Adjust the speed parameter between 0.25 and 4.0 to match IVR pacing needs. Note that generation speed is roughly real-time, averaging 25 characters per second, so longer inputs take proportionally longer to synthesize.

Input Text Limits

The API accepts text inputs up to 4,096 characters per request, with spaces and punctuation counted toward the limit. For longer scripts, clients must split text into chunks and join the resulting audio files sequentially.

Voice Selection

Voice selection requires one of eight presets, such as 'aria' for narration or 'atlas' for news. The system guesses the language from the script if not explicitly set, though specifying the ISO code is recommended for Latin-script non-English texts.

Speed Control

Adjust the speed parameter between 0.25 and 4.0 to match IVR pacing needs. Note that generation speed is roughly real-time, averaging 25 characters per second, so longer inputs take proportionally longer to synthesize.

Supported Output Formats

Sound wave illustration for: Supported Output Formats

ClearVoice provides five distinct audio formats to match your IVR infrastructure needs, allowing you to optimize for bandwidth, compatibility, or file size without extra cost. Each format is generated by the same high-quality engine, ensuring consistent voice quality regardless of your selection.

MP3 Compression

MP3 is the default and most widely supported format for call center systems. It offers an optimal balance between file size and audio clarity, making it ideal for high-volume IVR deployments where bandwidth efficiency matters.

WAV Lossless

WAV provides uncompressed, lossless audio data. This format is best for archival purposes or when downstream systems require raw audio data without any compression artifacts. It results in larger file sizes compared to MP3 but preserves every detail of the generated speech.

Opus and FLAC Options

Opus offers superior compression efficiency for low-bandwidth environments, while FLAC provides lossless compression for smaller file sizes without quality loss. Choose Opus for modern VoIP systems or FLAC when storage efficiency is critical but quality must remain intact.

Supported Output Formats

Rate Limits and Throttling

Sound wave illustration for: Rate Limits and Throttling

Rate limits protect system stability during high-volume IVR deployments. Your API key governs all request throughput, ensuring consistent performance for call center traffic. Understanding these constraints helps you design robust retry logic and manage agent scaling effectively.

We enforce strict per-key limits to maintain reliability. Initial accounts start with a lower threshold, which increases automatically after your first top-up. This structure supports both testing and production workloads.

60 Requests Per Minute

Once your account is funded, you can make up to 60 requests per minute. This capacity is sufficient for most call center scenarios, allowing multiple concurrent lines or batch processing of text-to-speech assets.

Each request consumes one unit of your quota. If you send 60 requests within a 60-second window, subsequent requests will be rejected until the window resets. Monitor your usage dashboard to track consumption trends.

  • Limit is per API key, not per IP address.
  • Applies to all request types, including model checks.
  • Resets every 60 seconds, rolling basis.

10 Requests Initial Limit

New accounts begin with a limit of 10 requests per minute. This lower threshold helps prevent abuse during the initial phase before you verify your payment method.

The limit increases to 60 requests per minute immediately after your first successful top-up via USDT (TRC-20). No manual review is required; the system updates your quota automatically within minutes of the transfer confirmation.

  • Initial limit: 10 requests/minute.
  • Increases to 60 requests/minute after first top-up.
  • No waiting period for the increase.

Queue Behavior

Requests are processed sequentially within the rate limit window. Under heavy load, additional requests may enter a queue rather than being rejected immediately. This ensures that your traffic is handled smoothly without losing valid requests.

If the rate limit is breached, you will receive a 429 Too Many Requests error. Implement exponential backoff in your application to handle these retries efficiently, especially for high-volume IVR systems.

  • Requests are processed in order.
  • Exponential backoff recommended for retries.
  • 429 error indicates limit breach.

Handling Long Texts

Sound wave illustration for: Handling Long Texts

Long-form content requires splitting input into chunks of up to 4096 characters, as each request is limited to this length. This ensures consistent processing and prevents timeouts during high-volume IVR generation.

4096 Character Split

Divide your text into segments not exceeding 4096 characters. Each segment becomes a separate API call, maintaining the integrity of the speech synthesis engine.

Audio Joining Logic

After receiving audio files for each chunk, concatenate them sequentially. This creates a seamless audio stream for your call center agents or IVR system.

Character Counting

Count all characters, including spaces and punctuation. This count determines your usage billing and helps you stay within the 4096-character limit per request.

Handling Long Texts

Common Errors

Sound wave illustration for: Common Errors

The API returns specific error codes to help you troubleshoot integration issues quickly. Most failures are related to authentication, limits, or input constraints.

Invalid API Key

Returns 401 if the Authorization: Bearer header is missing, malformed, or revoked. Note that issuing a new key immediately invalidates the previous one.

  • Check for typos in the key string

Rate Limit Exceeded

Returns 429 if you exceed 60 requests per minute (or 10 initially). Requests are processed sequentially, so high volume may cause queue delays before timing out.

  • Implement exponential backoff for retries

Input Too Long

Returns 400 if the input field exceeds 4096 characters. Split your text into chunks and join the resulting audio files manually.

  • Count spaces and punctuation as characters

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Our automated system guides callers through complex options with natural, human-like conversation.

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. Creative Commons Attribution 4.0
  3. MDN: Web Speech API
  4. W3C WAI: making audio and video accessible
  5. openai-node on GitHub
  6. TRON developer hub: TRC-20
  7. LibriVox public-domain audiobooks
  8. Python documentation
  9. LibriTTS-R paper (arXiv 2305.18802)
  10. Tether (USDT)
  11. curl documentation
  12. FFmpeg documentation

More on this site