Get Started with cURL or the OpenAI SDK for TTS

By IVR Voice Lab editorial team · Updated 2026-11-18

This guide helps product teams and call center architects integrate the IVR Voice Lab TTS API for high-volume speech synthesis. We cover the technical essentials for generating audio via cURL or the OpenAI SDK, focusing on clarity, language support, and cost efficiency. You will learn how to configure requests, manage authentication, and handle common constraints like character limits and rate limits, including the 60 requests per minute limit.

By following these steps, you can quickly test voice presets like Aria or Felix, select appropriate audio formats for telephony, and understand pricing models. The documentation provides concrete examples for IVR flows, ensuring you can deploy synthetic voices reliably without unnecessary complexity or hidden fees.

Get Started with cURL or the OpenAI SDK for TTS

Frequently asked questions

How do I get an API key?

Sign up on https://ck555apk.com/get-api-key/ using Google or email. Accounts are per site. The dashboard displays your active key, balance, and usage. You can issue a new key at any time; the old one stops immediately upon creation.

Does the API support SSML?

No. The API accepts plain text input up to 4096 characters. It does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. You must manage pauses and emphasis through text structure or post-processing if needed.

What is the maximum text length?

Each request supports up to 4096 characters. For longer texts, split the input into parts of this size and join the resulting audio files. Spaces and punctuation count toward the character limit.

Can I use the OpenAI SDK?

Yes. The endpoint matches the OpenAI speech shape. Change the SDK's base_url to https://api.ck555apk.com/v1 and use your site's key. The official OpenAI SDKs work directly with this configuration.

How do I change the voice speed?

Include the speed field in your request JSON. Valid values range from 0.25 to 4.0. This applies to all eight voice presets and adjusts the playback rate of the generated audio.

Is streaming supported?

No. The API returns the complete audio file in the response. There is no WebSocket or real-time partial audio streaming. Requests are processed sequentially, so longer texts may queue under load.

What audio formats are available?

You can request mp3, wav, opus, flac, or pcm. Set the response_format field in your request body. These formats cover standard use cases for IVR systems and outbound campaigns.

How do I handle rate limits?

The limit is 60 requests per minute per key (10 before first top-up). Requests process sequentially, so under load, a request may wait in a queue. Monitor your dashboard for usage stats.

What happens if the key is expired?

Keys do not expire automatically. You can issue a new key anytime via the dashboard. The old key stops working immediately when the new one is created. Failed requests are free.

Can I use custom pronunciation?

No. The API does not support custom pronunciation lexicons or phoneme dictionaries. Voices are based on licensed recordings from LibriTTS-R and LibriVox. You cannot upload custom voice data or design new voices.

Is there a webhook for long requests?

No. The API returns the audio file directly in the response. There are no webhooks or callbacks for long-running synthesis tasks. You must handle the response synchronously or manage queues yourself.

Do I need a dedicated IP?

No. Authentication is handled via the Authorization: Bearer header with your API key. There is no requirement for a dedicated IP address. Use standard HTTP requests from any network.

How do I test the API?

Use the ready curl example on your dashboard. Sign up for a free trial ($0.50 credit) via Google to start. Send a POST request to the speech endpoint to receive an audio file.

Is documentation versioned?

The documentation describes the current v1 endpoint. The API uses a fixed request shape compatible with OpenAI SDKs. There is no explicit versioning system mentioned; the endpoint remains stable as described.

First request

curl

curl https://api.ck555apk.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.ck555apk.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.ck555apk.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 API Key

Sound wave illustration for: Authentication and API Key

Accessing the IVR Voice Lab API requires a valid bearer token. You can generate your key on the /get-api-key/ page using Google Sign-In or an email account. The interface displays your active key, current balance, and usage metrics immediately upon login.

Every API call must include the Authorization header with your token. This single key authenticates all requests to the speech endpoint. You can revoke and issue a new key at any time from your dashboard; the old key becomes invalid immediately upon creation.

Generating Your API Key

Generating Your API Key

Navigate to the /get-api-key/ page to create your account. Sign in with Google for an instant trial credit of $0.50, or use email and password for standard access (no trial credit). Your unique API key appears on the dashboard alongside your balance and character usage statistics.

  • Google Sign-In provides $0.50 trial credit valid for 7 days
  • Email/password accounts start with zero balance
  • Key is visible immediately after login

Bearer Token Authorization

Bearer Token Authorization

Include your key in the HTTP header as Authorization: Bearer tts-... for every request. This token authorizes access to the POST /v1/audio/speech endpoint and other API routes. Ensure the key is sent securely to prevent unauthorized usage of your billing account.

  • Format: Authorization: Bearer tts-<your-key>
  • Required for all API endpoints
  • Single active key per account

Revoking and Issuing New Keys

You can issue a new key at any time from your dashboard. When a new key is generated, the previous one stops working immediately. This allows you to rotate keys if you suspect exposure or need separate credentials for different development environments.

  • Revoke old keys instantly upon new generation
  • No downtime during rotation
  • Manage keys directly from the dashboard

First Request with cURL

Sound wave illustration for: First Request with cURL

Send a POST request to https://api.ck555apk.com/v1/audio/speech with your API key in the Authorization header. The endpoint accepts JSON bodies containing the text to synthesize and optional configuration parameters.

POST Endpoint Structure

Use the standard TTS endpoint URL. Include your bearer token as Authorization: Bearer tts-.... Ensure the request header specifies Content-Type: application/json.

JSON Body Parameters

Provide the input text (max 4096 characters), model (tts-1 or tts-1-hd), voice (one of 8 presets), and response_format (mp3, wav, opus, flac, pcm). The speed parameter accepts values between 0.25 and 4.0.

  • model: tts-1 or tts-1-hd
  • voice: aria, nova, luna, sage, felix, milo, atlas, orion
  • input: text string up to 4096 chars
  • response_format: mp3, wav, opus, flac, pcm
  • speed: 0.25–4.0
  • language: optional ISO code

Receiving the Audio File

The API returns the generated audio file directly in the response body. Failed requests are free (the charge is returned in full) and provide error details. For texts exceeding 4096 characters, split the input and join the resulting audio files.

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

To integrate IVR Voice Lab into your call center workflows, use the official OpenAI SDKs by adjusting the base_url to https://api.ck555apk.com/v1. This allows you to leverage familiar client methods while connecting to our specific text-to-speech endpoint.

Initialize the client with your API key, ensuring it follows the tts-... format. Once configured, standard generation methods work seamlessly, returning audio files directly to your application for playback or storage in your outbound campaigns.

Setting the Base URL

Point your SDK client to https://api.ck555apk.com/v1 instead of the default OpenAI endpoint. This single configuration change directs all requests to IVR Voice Lab’s infrastructure while maintaining compatibility with existing code structures.

Ensure your development environment uses a recent version of the OpenAI Python or Node.js SDK to support custom base URLs effectively.

Configuring the Client

Pass your API key via the Authorization: Bearer header. The SDK handles header construction automatically when you provide the key during initialization.

Set the model parameter to either tts-1 or tts-1-hd. Both use the same engine and pricing, so you can switch between them without changing your client logic.

  • Key format: tts-...
  • Base URL: https://api.ck555apk.com/v1
  • Auth: Bearer token

Using Official SDK Methods

Call the audio.speech.create method (or equivalent in your language) with your text, voice, and format parameters. The SDK handles the JSON serialization and HTTP POST to /v1/audio/speech.

Receive the audio response directly as a binary stream or file object. You can then pipe this output to your telephony system or save it for later use in your IVR flows.

Available Models and Voices

Sound wave illustration for: Available Models and Voices

The API supports two model variants, tts-1 and tts-1-hd, which share the same engine and pricing structure. This simplifies integration for call center architects who need consistent behavior across different quality tiers without managing separate model configurations or cost structures. Both models process input text up to 4,096 characters per request. They deliver synthetic speech with an inaudible watermark, ensuring clear attribution of generated audio files used in IVR flows or outbound campaigns.

tts-1 and tts-1-hd Models

Both tts-1 and tts-1-hd utilize identical underlying engines and incur the same rate of $0.01 per 1,000 characters. This uniformity allows product teams to switch between models for A/B testing voice clarity without adjusting budget forecasts or altering request payloads beyond the model field. The pricing consistency extends to rate limits and character counting rules, where spaces and punctuation are included. This predictability is critical for high-volume TTS integration, ensuring that cost estimates remain accurate regardless of the selected model variant.

  • Same engine and price for both variants
  • Uniform rate limits and character counting rules
  • Simplified A/B testing for voice quality

8 Preset Voices for IVR

The API provides eight distinct voice presets designed for various professional contexts. These voices are based on licensed recordings from LibriTTS-R and public-domain audiobook readings, ensuring legal compliance for commercial use. Each voice maintains consistent tone and clarity, essential for maintaining brand identity in automated phone systems. Voices include female options like Aria and Luna, and male options like Felix and Atlas. They cover a range from warm narrators to neutral news readers, allowing teams to match the voice to the specific tone of their IVR menu or promotional campaign.

Voice Selection by Gender and Tone

Voice selection is based on gender and tonal characteristics rather than complex emotional tags. For instance, Aria offers a warm, clear narration suitable for general inquiries, while Felix provides an energetic tone ideal for promotional messages. Atlas delivers a neutral, news-like delivery for status updates, and Orion offers a deep, documentary style for longer explanations. Each voice can speak any of the 23 supported languages. If the language parameter is omitted, the system guesses the language from the script, defaulting to English for Latin script. Explicitly setting the language code ensures accurate pronunciation for non-English text, preventing miscommunication in multilingual IVR flows.

Supported Audio Formats

Sound wave illustration for: Supported Audio Formats

We provide five output formats to match your infrastructure needs, ensuring compatibility across diverse playback environments and storage constraints.

MP3 for General Use

MP3 is the default choice for web players and mobile apps. It offers an optimal balance between file size and audio quality, making it suitable for most general-purpose IVR menus and outbound notifications.

WAV and PCM for Telephony

WAV and uncompressed PCM formats are suitable for telephony systems. These formats ensure maximum compatibility with legacy PBX hardware and SIP trunks, delivering clear voice without codec conversion artifacts.

OPUS and FLAC for Storage

OPUS provides high compression for efficient archival, while FLAC offers lossless compression for quality preservation. Use these formats when storing long-form audio for later playback or detailed analysis.

Supported Audio Formats

Language and Speed Settings

Sound wave illustration for: Language and Speed Settings

Precise language specification ensures accurate pronunciation in international IVR systems. While the API guesses language from script, explicit ISO codes eliminate ambiguity for Latin-script texts that are not English.

Optional ISO Language Code

Set the language field to an ISO code (e.g., de, es, ja) to force specific pronunciation. This is critical when the default English guess fails for non-English Latin text. All 8 voices support all 23 listed languages.

  • Supported: Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Turkish.
  • Unsupported: Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, Bengali.

Speed Range from 0.25 to 4.0

Adjust playback speed via the speed parameter to match caller patience or agent training needs. Values range from 0.25 (slow) to 4.0 (fast). Standard IVR flows typically use speeds between 1.0 and 1.5 for clarity.

Auto-Detection Logic

If language is omitted, the API guesses based on the input script. Latin script defaults to English. Non-English Latin text requires explicit language setting to avoid mispronunciation.

Rate Limits and Errors

Sound wave illustration for: Rate Limits and Errors

The API enforces a strict rate limit of 60 requests per minute per key. This ceiling ensures stable performance for high-volume IVR and outbound campaigns, preventing sudden spikes from degrading voice clarity or causing queuing delays on longer texts.

60 Requests Per Minute Limit

Each active API key is capped at 60 requests per minute. Requests are processed sequentially, so under heavy load, synthesis may wait in a queue. This limit applies globally to the key, regardless of the number of concurrent connections.

10 Requests Before First Top-Up

New accounts without a top-up are restricted to 10 requests per minute. This lower threshold applies until you add USDT (TRC-20) to your balance. Once topped up, the limit automatically increases to the standard 60 requests per minute.

Handling 429 Too Many Requests

When the limit is exceeded, the API returns a 429 status code. Implement exponential backoff in your integration to retry after a short delay. Failed requests are free, so retrying safely restores service without extra cost.

Troubleshooting Common Issues

Sound wave illustration for: Troubleshooting Common Issues

When integrating our TTS API into IVR systems, three technical issues frequently disrupt voice delivery. This guide addresses authentication failures, input length constraints, and format compatibility to ensure smooth high-volume speech synthesis.

We focus on concrete resolution steps for product teams managing call center workflows.

Invalid API Key Errors

If you receive a 401 error, verify that your Authorization: Bearer tts-... header matches the key issued on the /get-api-key/ page. Remember, each account holds only one active key; issuing a new key immediately invalidates the previous one, so update your configuration promptly to avoid service interruption.

Ensure no trailing spaces exist in your key string, as the API requires exact string matching for authentication.

  • Check the /get-api-key/ dashboard for the current active key.
  • Revoke old keys immediately to prevent unauthorized usage.
  • Verify no hidden whitespace in the API header string.

Input Exceeding 4096 Characters

The API limits each request to 4096 characters, including spaces and punctuation. If your IVR script exceeds this, split the text into segments and join the resulting audio files client-side.

Long texts should be processed sequentially, as requests are handled one after another. Plan your splitting logic to maintain natural pauses between segments.

Note that typical generation speed is roughly real-time, so large inputs may require queuing logic in your application.

  • Split text into chunks of max 4096 characters.
  • Join audio files on the client side.
  • Account for processing queues during high-volume loads.

Audio Format Mismatches

Ensure your telephony infrastructure supports the requested response_format. For standard IVR, MP3 is recommended for general use, while WAV or PCM may be required for specific telephony protocols.

OPUS and FLAC are better suited for storage rather than real-time playback. Verify that your system can decode the chosen format without latency.

Failed requests return no audio, so always check the response status code before attempting to play the file.

  • Use MP3 for general IVR playback.
  • Use WAV/PCM for strict telephony requirements.
  • Reserve OPUS/FLAC for archival storage.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Streamline customer interactions by optimizing voice flow and reducing agent handle time efficiently.

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. MDN: Web Speech API
  3. Creative Commons Attribution 4.0
  4. Python documentation
  5. curl documentation
  6. LibriTTS-R paper (arXiv 2305.18802)
  7. ISO 639 language codes
  8. Node.js documentation
  9. openai-node on GitHub
  10. FFmpeg documentation
  11. Tether (USDT)
  12. OpenAI API reference: create speech

More on this site