Cloud Text-to-Speech API: Integration Guide

By TableSpeak editorial team · Updated 2026-11-19

This guide details the integration of the TableSpeak cloud text-to-speech API, designed for developers managing high-volume multilingual audio delivery. You will find specific technical instructions for authenticating requests, configuring parameters, and handling responses using standard HTTP methods.

The documentation covers endpoint structures, rate limits, and OpenAI SDK compatibility to streamline your engineering workflow. It provides concrete examples for generating audio files in various formats, ensuring your team can focus on content strategy and client integration without managing the synthesis layer.

Cloud Text-to-Speech API: Integration Guide

Frequently asked questions

What is the base URL for the API?

The API base URL is https://api.ibat789.info/v1. Use this endpoint for all requests, including POST /v1/audio/speech, GET /v1/voices, and GET /v1/models. Ensure your Authorization header uses the Bearer scheme with your specific API key to authenticate requests correctly.

Does the API support streaming?

No, the API does not support streaming, WebSocket connections, or real-time partial audio delivery. You send a text payload and receive the complete audio file upon successful synthesis. Requests are processed sequentially, so longer texts may experience queue delays under load.

Can I use the official OpenAI Python SDK?

Yes, the official OpenAI SDKs work by changing the base_url to https://api.ibat789.info/v1. Use your TableSpeak API key for authentication. The request shape matches the OpenAI speech endpoint, allowing seamless integration with existing Python codebases without requiring custom client implementations.

How do I handle long texts exceeding 4096 characters?

Split your input text into chunks of up to 4096 characters. Send each chunk as a separate request to the speech endpoint. Then, join the resulting audio files in your application logic. This ensures compliance with the per-request character limit while preserving content integrity.

Is SSML supported in the input field?

No, the API does not support SSML. The input field accepts plain text only. You cannot use SSML tags for pronunciation, pauses, or emphasis. For custom pronunciation, you must rely on the standard voice presets and language settings provided by the API.

What is the default voice if none is specified?

The API does not have a single default voice. You must explicitly provide a voice parameter from the eight available presets.

How do I rotate my API key?

Issue a new API key from your account dashboard. The new key becomes active immediately, and the old key stops working at once. This allows seamless rotation without downtime. You can generate a new key anytime to maintain security without affecting active integrations.

Do you have a WebSocket endpoint?

No, the API does not offer a WebSocket endpoint. All interactions occur via standard HTTP requests. You send a POST request with your text and receive the audio file in the response body. There is no persistent connection or streaming capability available.

First request

curl

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

Authenticate requests by including your API key in the Authorization header. Each account holds one active key, issued upon registration. Pass it as a Bearer token to ensure your synthesis jobs are billed correctly to your balance.

Keys are tied to your account’s usage limits. If you generate a new key, the previous one becomes invalid immediately. Rotate keys when distributing them to different client projects to maintain clear audit trails for billing and rate limit tracking.

Bearer Token Usage

Bearer Token Usage

Include the header Authorization: Bearer tts-<your-key> in every POST request. The key must be valid and active. Failed requests still count toward your rate limit but are not charged if synthesis fails.

Use the key from your /get-api-key/ dashboard. It identifies your account and applies your specific rate limits and balance.

  • Header format: Authorization: Bearer tts-...
  • One key per account
  • Invalid keys return 401 Unauthorized

Key Rotation

Key Rotation

Generate a new key from your dashboard at any time. The old key stops working immediately upon creation of the new one. This allows zero-downtime rotation if you manage multiple integration points.

Use this to isolate client projects or reduce exposure if a key is potentially exposed in logs.

  • Old key invalid immediately
  • New key active instantly
  • No downtime required

Single Active Key

Each account maintains exactly one active key at a time. You cannot have multiple concurrent keys for the same account. This simplifies billing and rate limit management.

If you need separate limits for different teams, create separate accounts. Each account has its own key, balance, and 60 RPM limit.

  • One key per account
  • Simplifies billing
  • Use separate accounts for team isolation

Endpoint Overview

Sound wave illustration for: Endpoint Overview

The API provides three primary endpoints for audio synthesis and metadata retrieval. The speech endpoint accepts text and parameters to generate audio files, while the voices and models endpoints return available configuration data. All endpoints require a valid Bearer token in the Authorization header.

POST /v1/audio/speech

Accepts JSON payloads with text input (up to 4096 characters), voice preset, and format preferences. Returns the generated audio file directly in the response body. Failed synthesis requests are free: if synthesis fails, the charge is returned in full.

  • Endpoint: POST https://api.ibat789.info/v1/audio/speech
  • Auth: Bearer token required
  • Input: JSON body with model, input, voice, response_format

GET /v1/voices

Returns a list of available voice presets, supported languages, and output formats. This endpoint helps developers determine valid voice IDs and language codes before making synthesis requests. Supports 23 languages including English, Spanish, and Japanese.

  • Endpoint: GET https://api.ibat789.info/v1/voices
  • Returns: Voice metadata, language codes, format options

GET /v1/models

Lists available TTS models. Currently supports tts-1 and tts-1-hd, which use the same engine and pricing tier. This endpoint confirms model availability and helps standardize requests across different integration environments.

  • Endpoint: GET https://api.ibat789.info/v1/models
  • Returns: Model ID, name, and metadata

Request Parameters

Sound wave illustration for: Request Parameters

Configure the synthesis engine and payload constraints before sending audio requests. The API accepts standard parameters to define voice characteristics and input limits.

Model Selection

Select tts-1 for standard processing or tts-1-hd for higher fidelity. Both models use the same engine and pricing tier, allowing seamless upgrades without code changes.

Input Text Field

The input field accepts plain text up to 4096 characters per request. Spaces and punctuation count toward this limit. For longer scripts, split the text into chunks and join the resulting audio files sequentially.

Voice Preset

Choose from eight distinct voice presets. Each voice supports all 23 supported languages. If the language field is omitted, the system guesses the language based on the script, defaulting to English for Latin text.

  • 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

Response Formats

Sound wave illustration for: Response Formats

The API returns binary audio data directly in the response body, eliminating the need for intermediate storage or polling. Clients receive the complete audio file upon successful synthesis, allowing for direct writing to disk or playback buffers.

MP3 Output

MP3 is the default format, offering a balance between file size and compatibility. It is ideal for web delivery and general-purpose audio players where bandwidth efficiency matters for high-volume agency workflows.

WAV Output

WAV provides uncompressed PCM audio, ensuring maximum fidelity without decoding artifacts. Use this format when downstream processing requires raw audio data or when playing back on legacy systems that do not support compressed codecs.

Opus and FLAC

Opus offers efficient compression for network transmission, while FLAC provides lossless compression for archival quality. Choose Opus for efficient network transmission and FLAC when preserving every bit of generation detail is necessary for quality audits.

OpenAI SDK Compatibility

Sound wave illustration for: OpenAI SDK Compatibility

TableSpeak’s API mirrors the OpenAI speech endpoint structure, allowing you to reuse existing integration code with minimal changes. By pointing your client to our base URL, you can leverage the same SDK methods without rewriting the synthesis logic.

This compatibility reduces engineering overhead for agencies already familiar with the OpenAI pattern, ensuring a smooth transition for high-volume multilingual audio delivery pipelines.

Base URL Configuration

Update your SDK’s base_url to https://api.ibat789.info/v1. This directs all requests to our infrastructure while maintaining the standard endpoint paths.

Ensure your environment variables or configuration files reflect this change before initializing the client instance.

  • Base URL: https://api.ibat789.info/v1

SDK Method Usage

Use the standard audio.speech.create() method. Pass the model, input, voice, and response_format parameters exactly as defined in the OpenAI schema.

The SDK handles the JSON serialization and HTTP POST to https://api.ibat789.info/v1/audio/speech automatically.

Header Adjustments

Set the Authorization header to Bearer tts-<your_key>. Use your specific TableSpeak API key, not an OpenAI key.

No additional custom headers are required for standard requests. The SDK manages content-type and other standard headers automatically.

OpenAI SDK Compatibility

Error Handling

Sound wave illustration for: Error Handling

TableSpeak’s API returns standard HTTP status codes to indicate request outcomes. Understanding these codes helps you implement robust retry logic and error handling in your audio delivery pipeline.

400 Bad Request

This error indicates a client-side issue, such as an invalid voice ID, malformed JSON, or text exceeding the 4,096 character limit per request. Check your payload structure and ensure the input field contains valid UTF-8 text.

  • Verify voice IDs against GET /v1/voices
  • Ensure text length ≤ 4096 characters
  • Check JSON syntax and encoding

429 Rate Limit

You have exceeded the allowed request rate. New accounts start with 10 requests per minute, scaling to 60 RPM after top-up. The response includes a Retry-After header indicating when to resume sending requests.

  • Rate limit is per API key
  • Use the Retry-After header value
  • Implement exponential backoff for retries

500 Server Error

A server-side error occurred during synthesis. These are rare but may happen during peak load. Failed requests are free: if synthesis fails, the charge is returned in full.

Rate Limits

Sound wave illustration for: Rate Limits

Your API key allows a maximum of 60 requests per minute under normal operation. This limit applies to the POST /v1/audio/speech endpoint, ensuring stable synthesis throughput for high-volume agency pipelines.

60 Requests Per Minute

The standard rate limit is 60 requests per minute per key. This capacity supports consistent audio generation for multilingual content delivery without requiring complex batching logic on the client side.

Initial 10 RPM Limit

New accounts start with a reduced limit of 10 requests per minute. This applies until the first top-up is processed. Once a USDT (TRC-20) transfer is confirmed, the limit automatically increases to 60 RPM.

Queue Behavior

Requests are processed sequentially, so under load a request may wait in a queue. This prevents burst traffic from disrupting ongoing synthesis tasks. Typical speed is roughly real time on long texts (about 25 characters of text per second of generation).

  • Requests are queued, not rejected, when the limit is exceeded.
  • Processing is sequential, so under load, wait times may increase.
  • Limit resets to standard 60 RPM after first top-up.

Curl Example

Sound wave illustration for: Curl Example

This section demonstrates the core workflow for generating audio via the TableSpeak API. It covers the essential cURL command structure, the required JSON payload, and how to process the binary audio response in a terminal environment.

The examples assume a valid API key and focus on the POST /v1/audio/speech endpoint, which is the primary interface for audio synthesis.

Basic Request

Send a POST request to the API endpoint with your bearer token. Replace YOUR_API_KEY with your actual key from the dashboard.

The command below requests an MP3 file using the nova voice for a short English phrase.

  • curl -X POST https://api.ibat789.info/v1/audio/speech \
  • -H "Authorization: Bearer YOUR_API_KEY" \
  • -H "Content-Type: application/json" \
  • `-d '{"model": "tts-1", "input": "Hello world", "voice": "nova", "response_format": "mp3"}'`

JSON Body Structure

The request body is standard JSON. The input field accepts up to 4096 characters. Spaces and punctuation count toward the character limit.

You can specify response_format (mp3, wav, opus, flac, pcm) and speed (0.25–4.0). The language field is optional; if omitted, the system guesses the language based on the script.

  • model: "tts-1" or "tts-1-hd"`
  • input: string, max 4096 chars`
  • voice: one of 8 presets (e.g., "nova", "atlas")`
  • response_format: "mp3", "wav", "opus", "flac", or "pcm"`
  • speed: float, 0.25 to 4.0`

Response Handling

A successful request returns the audio file directly in the response body with a 200 OK status. Save the output using > audio.mp3.

If the request fails, the API returns a JSON error object with a code and message. Failed synthesis requests are free and do not charge your balance.

  • 200 OK: Binary audio data`
  • 400 Bad Request: Invalid parameters`
  • 429 Rate Limit: Exceeded 60 RPM`
  • 500 Server Error: Internal synthesis failure`

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Understanding technical constraints is critical for agencies managing high-volume audio delivery.

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. Tether (USDT)
  3. Creative Commons Attribution 4.0
  4. W3C WAI: making audio and video accessible
  5. curl documentation
  6. ISO 639 language codes
  7. TRON developer hub: TRC-20
  8. LibriTTS-R paper (arXiv 2305.18802)
  9. IETF RFC 7845: Ogg Opus
  10. Node.js documentation
  11. Python documentation
  12. LibriTTS-R corpus (OpenSLR 141)

More on this site