Text-to-Speech API Documentation for Developers

By WordHush editorial team · Updated 2026-11-18

This page provides a clear, step-by-step guide to integrating WordHush’s text-to-speech API into your indie projects. You will find the exact endpoints, request parameters, and code examples needed to generate audio files from text. Whether you are building a no-code app or a custom web service, this documentation covers the essential details for reliable synthesis without enterprise complexity.

We cover authentication, supported voices, and audio formats like MP3 and WAV. You will learn how to use the OpenAI SDK with our base URL, handle rate limits, and manage long texts by splitting and joining audio segments. All information is based on current API behavior, ensuring you can start sending requests and receiving audio files quickly.

Text-to-Speech API Documentation for Developers

Frequently asked questions

How do I authenticate?

Send your API key in the Authorization header as a Bearer token: Authorization: Bearer tts-.... You get one active key per account. If you issue a new key, the old one stops immediately. Find your key on the /get-api-key/ page after signing up with Google or email.

What is the main endpoint?

The main endpoint is POST https://api.ktv88th.com/v1/audio/speech. Send a JSON body with your text, voice, and model. You can also use GET /v1/voices to list available voices or GET /v1/models to check model details. This follows the standard OpenAI speech request shape.

Can I use the OpenAI SDK?

Yes. The request shape matches the OpenAI speech endpoint. Simply change the base_url in the official OpenAI SDK to https://api.ktv88th.com/v1 and use your site’s key. This allows you to integrate quickly without learning a new library structure or writing custom HTTP clients from scratch.

What models are available?

Two models are available: tts-1 and tts-1-hd. They use the same engine and have the same price. You can choose either based on your preference.

What audio formats are supported?

You can request MP3, WAV, OPUS, FLAC, or PCM audio. Set the response_format field in your JSON body to your preferred type. These formats cover most use cases for indie apps, from web playback to high-quality archival storage, without requiring external conversion tools.

How do I set the voice?

Specify one of eight presets in the voice field: aria, nova, luna, sage, felix, milo, atlas, or orion. Each voice has a distinct tone, from warm narrators to deep documentary styles. You can also optionally set a language code to ensure correct pronunciation for non-English texts.

What is the character limit?

Each request supports up to 4096 characters of input text. For longer texts, split your content into chunks of this size and join the resulting audio files. Spaces and punctuation count toward the limit, so plan your text segmentation accordingly to avoid rejection.

How do I handle errors?

If synthesis fails, the charge is returned in full. Failed requests do not cost you credits. Ensure your input text is within the 4096-character limit and your API key is valid. Use standard HTTP status codes to detect errors and retry if necessary, as requests are processed sequentially.

What are the rate limits?

You are limited to 60 requests per minute per key. New accounts start with a lower limit of 10 requests per minute until the first top-up is processed. Requests are processed sequentially, so under load, you may experience slight delays while your request waits in the queue.

How do I top up via USDT?

Send USDT on the TRON network (TRC-20) to top up your balance. The minimum amount is $5. Credits are added automatically within minutes after the transfer is confirmed. There are no monthly plans or subscriptions; your balance does not expire and can be used at any time.

Is there an SDK for mobile?

No official mobile SDK exists. You can use the standard OpenAI SDK or plain HTTP requests, which work on any platform. Since the API is RESTful, you can easily integrate it into iOS, Android, or cross-platform frameworks using standard networking libraries available in your preferred language.

How do I rotate my API key?

You can issue a new key at any time from your account page. When you generate a new key, the old one stops working immediately. This ensures that if a key is compromised, you can revoke access instantly without waiting for a manual review or batch process.

First request

curl

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

Your API key authenticates every request to the TTS service. It acts as your unique identifier for billing and rate limiting, ensuring only your account's usage is tracked and charged.

API Key format

API Key format

Keys always start with the prefix tts- followed by a random alphanumeric string. You generate this key when you sign up or visit your dashboard.

Bearer token

Bearer token

Include your key in the Authorization header of every HTTP request. Use the standard Bearer token format to ensure the API recognizes your credentials immediately.

  • Format: Authorization: Bearer tts-your-key-here

Key rotation

You can issue a new key at any time from your account settings. When you generate a new key, the old one stops working immediately, so update your integrations promptly.

Endpoints Overview

Sound wave illustration for: Endpoints Overview

The API provides three core endpoints for interaction. The speech endpoint handles audio generation, while the voices and models endpoints list available options and engine details.

Use these endpoints to discover supported languages, audio formats, and pricing before making synthesis requests.

Speech endpoint

Send text to receive an audio file via POST to /v1/audio/speech. Use the standard OpenAI request shape with your API key in the Authorization header.

  • Endpoint: POST /v1/audio/speech
  • Input: JSON body with text, voice, and format

Voices list

Retrieve available voices, languages, and formats via GET /v1/voices. This helps you select the right preset for your content type.

  • 8 voice presets available
  • 23 languages supported

Models list

List available models via GET /v1/models. Currently, 'tts-1' and 'tts-1-hd' share the same engine and price, so model selection is primarily for compatibility.

image:

Request Parameters

Sound wave illustration for: Request Parameters

Configure the synthesis request by selecting a model, defining the input text, and choosing a voice preset. These parameters determine the engine quality, content length, and vocal style of the generated audio file.

Model selection

Choose between "tts-1" or "tts-1-hd" using the model field. Both presets use the same underlying engine and pricing structure, allowing you to switch without changing your integration logic.

Input text limit

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

Voice selection

Select one of eight presets via the voice parameter. Options include female voices like aria, nova, luna, and sage, or male voices like felix, milo, atlas, and orion. Each voice is a preset based on licensed recordings.

Response Formats

Sound wave illustration for: Response Formats

The API returns audio data directly in the response body, allowing seamless integration into existing workflows. You can choose from five formats: MP3, WAV, Opus, FLAC, or PCM. Select the one that best fits your application’s bandwidth and quality requirements.

Audio formats

Supported response formats include mp3, wav, opus, flac, and pcm. Each format offers different trade-offs between file size and audio fidelity. Choose MP3 for efficient storage, WAV for uncompressed quality, or Opus for modern web compatibility.

  • mp3: Standard compressed audio, widely compatible.
  • wav: Uncompressed audio file.
  • opus: Efficient compression, ideal for web apps.
  • flac: Lossless compression for archival quality.
  • pcm: Raw, uncompressed audio samples.

Speed control

Adjust the playback speed using the speed parameter, which accepts values between 0.25 and 4.0. The default speed is 1.0. This allows you to match the audio to your specific use case, such as faster narration for tutorials or slower pacing for language learning.

Language code

You can explicitly set the language using an ISO code in the language field. If omitted, the system guesses the language based on the text script, defaulting to English for Latin characters. Explicitly setting the language ensures accurate pronunciation, especially for non-English text in Latin script.

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

The API mirrors the OpenAI speech endpoint structure, allowing you to reuse existing OpenAI SDKs with minimal configuration. By updating the base URL, you can send standard TTS requests without learning a new client library or rewriting your integration logic.

Base URL change

Point your SDK client to https://api.ktv88th.com/v1 instead of the OpenAI endpoint. This single change directs all requests to our infrastructure while preserving the standard request body format.

SDK compatibility

The official OpenAI SDKs work directly because we follow the same JSON schema. You only need to ensure you are using the speech endpoint method. No custom wrappers or proprietary clients are required.

Code example

Initialize the client with your base URL and API key. The key format is tts-... and must be passed as a Bearer token.

  • Set base_url="https://api.ktv88th.com/v1"
  • Pass Authorization: Bearer tts-<your-key>
  • Call client.audio.speech.create() with model, input, and voice
OpenAI SDK Integration

Error Handling

Sound wave illustration for: Error Handling

When synthesis fails, the charge is returned in full, so you are not billed for broken audio files. Knowing the error type helps you decide whether to retry or switch parameters immediately.

Common errors

Return a standard HTTP error code (4xx or 5xx) with a message. Check your input format, voice ID, or API key validity. Each voice is a preset based on licensed recordings, so ensure you use one of the eight available IDs.

  • 400 Bad Request: Invalid JSON or missing fields.
  • 401 Unauthorized: Incorrect or expired API key.
  • 429 Too Many Requests: Rate limit exceeded.

Rate limits

The limit is 60 requests per minute per key. New accounts start at 10 requests per minute. Exceeding this returns a 429 error.

  • 60 req/min after top-up.
  • 10 req/min initially.
  • Hard limit per API key.

Retry logic

Implement exponential backoff for 429 errors. For 500 errors, retry once. Since requests are processed sequentially, wait before retrying to avoid queueing delays.

  • Use exponential backoff for 429s.
  • Retry 500s once.
  • Avoid immediate bursts.

Rate Limits

Sound wave illustration for: Rate Limits

The API enforces a standard limit of 60 requests per minute per active key. This ceiling applies uniformly regardless of the model selected, ensuring predictable throughput for your applications. Requests are processed sequentially, meaning high-volume jobs may experience brief queueing during peak usage.

Requests per minute

Each API key allows up to 60 synthesis requests within a rolling 60-second window. This limit is consistent across both the tts-1 and tts-1-hd models, simplifying capacity planning for indie developers who need steady audio generation without complex tier management.

Initial limit

New accounts start with a reduced limit of 10 requests per minute. This initial cap applies until you complete your first top-up. Once the transfer is confirmed, your quota increases to the full 60 requests per minute immediately.

Upgrade process

To increase your rate limit, send a top-up via USDT on the TRON network (TRC-20). The minimum amount is $5. After the blockchain confirms the transaction, typically within minutes, your account automatically upgrades to the standard 60 requests per minute limit.

Long Text Handling

Sound wave illustration for: Long Text Handling

The API processes text in chunks of up to 4096 characters per request. For longer inputs, you must split the text yourself and send multiple requests. This ensures consistent generation speed and predictable resource usage.

Since requests are processed sequentially, splitting allows you to manage queue waits effectively without blocking the entire synthesis pipeline.

Character limit

Each request accepts a maximum of 4096 characters. Spaces, punctuation, and special symbols count toward this limit. If your input exceeds this, the API returns an error rather than truncating silently.

Keep your strings under this threshold to avoid rejection and ensure reliable processing.

Splitting strategy

Split your text into logical segments, such as paragraphs or sentences, ensuring each part stays within the 4096-character boundary. Avoid breaking mid-word to maintain audio coherence.

Send each segment as a separate POST request to the speech endpoint. Requests are processed sequentially, so splitting allows you to manage queue waits effectively.

  • Use sentence boundaries for natural pauses.
  • Keep segments under 4096 characters.
  • Avoid splitting mid-word.

Audio joining

After receiving audio files for each segment, concatenate them in the original order to reconstruct the full audio. Use standard libraries like ffmpeg or built-in language utilities to merge the files seamlessly.

Concatenate the resulting audio files in the original order to reconstruct the full audio.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. The integration with IBM Cloud services allows for seamless deployment in enterprise environments.

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. LibriVox public-domain audiobooks
  4. ISO 639 language codes
  5. TRON developer hub: TRC-20
  6. MDN: Web Speech API
  7. Node.js documentation
  8. OpenAI API reference: create speech
  9. Python documentation
  10. W3C WAI: making audio and video accessible
  11. FFmpeg documentation
  12. openai-python on GitHub

More on this site