Integrate Text-to-Speech Audio Generation

By CreatorVoice API editorial team · Updated 2026-11-18

This page provides the technical documentation for the CreatorVoice API, enabling YouTubers and developers to integrate high-quality text-to-speech synthesis directly into their content workflows. You will find precise specifications for generating audio files via standard HTTP requests, ensuring seamless compatibility with existing backend systems without requiring proprietary tools or complex setup procedures.

The guide covers essential integration details including authentication, endpoint structures, and parameter configurations for voice selection and speed control. You can also review the OpenAI SDK compatibility, rate limits, and error handling strategies to ensure reliable audio generation at scale. All pricing and technical constraints are listed explicitly so you can estimate costs and performance before committing to production.

Integrate Text-to-Speech Audio Generation

Frequently asked questions

Which SDKs are compatible?

The official OpenAI SDKs work by changing the base_url. Simply change the base_url to https://api.tk33apk.com/v1 and use your site’s key. The request shape matches the OpenAI speech endpoint exactly. You can also use plain HTTP requests with standard JSON bodies. No proprietary SDK is required, allowing flexible integration into any Python, Node.js, or Go application.

Do I need to install a specific library?

No specific library is required. You can use the official OpenAI SDK by adjusting the base URL, or send standard HTTP POST requests. Any HTTP client capable of sending JSON and receiving binary audio data will work. This ensures compatibility with your existing infrastructure without forcing a dependency on a custom wrapper.

How do I handle rate limits?

The limit is 60 requests per minute per key, or 10 per minute before the first top-up. Exceeding this may cause delays as requests are processed sequentially. Implement retry logic in your code to handle queue waits gracefully. Monitor your usage via the dashboard to stay within limits and avoid unnecessary delays during peak generation times.

What happens if the server is down?

There is no formal SLA or uptime guarantee. If synthesis fails, the charge is returned in full. Requests are processed one after another, so under load, a request may wait in a queue. Support is available via email only; there is no live chat or phone support for immediate incident resolution.

Is the API synchronous or asynchronous?

The API is synchronous. You send a POST request and receive the audio file in the response. There is no webhook or async callback mechanism. For long texts, you must split the input into parts of up to 4096 characters, generate each part, and join the resulting audio files in your application logic.

Can I stream the audio?

No, the API does not support streaming, WebSockets, or real-time partial audio. The entire audio file is returned in the response body after synthesis completes. This means you must wait for the full generation process to finish before receiving the data, which may take several seconds for longer texts depending on queue load.

Does the API support SSML?

No, the API does not support SSML. You cannot use phoneme dictionaries or custom pronunciation lexicons. Input is plain text up to 4096 characters. If you need specific pronunciation or pacing, you must adjust the text manually or use the speed parameter. There are no emotion tags or advanced markup options available.

How do I rotate my API key?

You can issue a new key at any time from your account dashboard. When a new key is issued, the old one stops working immediately. This ensures secure access without downtime. You do not need to update your application configuration during the switch if you handle both keys, but typically you update the active key in your code.

What is the maximum text length?

The maximum input length is 4096 characters per request. Spaces and punctuation count toward this limit. For longer texts, you must split the content into chunks of 4096 characters or less. Generate audio for each chunk individually and then join the resulting audio files in your application to create the final continuous track.

Can I change the voice mid-sentence?

No, each request accepts only one voice preset. To change voices, you must split the text into separate requests, generate each part with the desired voice, and join the audio files. There is no built-in mechanism to switch voices within a single audio stream or response. This requires manual orchestration in your code.

Does the API support custom speeds?

Yes, you can adjust the speed between 0.25 and 4.0. This allows you to speed up narration or slow down dialogue for clarity. The speed parameter is included in the JSON body alongside the model and voice. Note that generation time scales with speed; faster speeds may process quicker.

How do I detect the language automatically?

If you do not set the language field, the system guesses it from the script. Latin script defaults to English. For non-English Latin text, you should explicitly set the language parameter. Supported languages include Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, and Turkish.

What happens if I send invalid JSON?

The API will return an error response indicating the invalid format. Failed requests are free, so no charge is applied if synthesis fails due to input errors. Ensure your JSON body includes the required fields: model, input, and voice. Check the response status code and error message to correct your request before retrying.

Is there a test environment?

There is no separate test environment. You use the same production endpoint at https://api.tk33apk.com/v1. You can test with your free trial credit of $0.50, valid for 7 days. This provides about 50,000 characters for testing. Use this credit to verify integration, voice quality, and response formats before committing to paid top-ups.

First request

curl

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

Accessing the CreatorVoice API requires a valid API key. You can generate your key by signing up on the /get-api-key/ page using Google or an email account. The dashboard displays your active key, balance, and usage statistics immediately upon creation.

Each account maintains one active key at a time. You must include this key in the HTTP Authorization header for every request to authenticate your identity and track character consumption against your balance.

API Key Generation

API Key Generation

Keys are issued instantly upon sign-up via Google or email. The /get-api-key/ dashboard shows your current key and allows you to generate a new one at any time.

Keys are tied to your account balance and rate limits. Ensure you copy the key exactly as displayed, as it is unique to your account.

  • Sign up via Google or email on /get-api-key/
  • Copy the key from the dashboard
  • Keys are unique per account

Bearer Token Usage

Bearer Token Usage

Include your key in the Authorization header as a Bearer token. The format is: Authorization: Bearer tts-....

This header is required for all endpoints, including POST /v1/audio/speech and GET /v1/voices.

  • Format: Authorization: Bearer tts-<your-key>
  • Required for all API requests
  • Case-sensitive

Key Rotation Policy

Issuing a new key immediately invalidates the previous one. There is no overlap period.

Use this feature if you suspect a key has been compromised. The old key stops working instantly.

Generate a new key from the dashboard to restore access.

  • Old key stops immediately
  • No overlap period
  • Generate new key from dashboard

Endpoints Overview

Sound wave illustration for: Endpoints Overview

The API exposes three primary endpoints for generating audio and managing resources. The core synthesis endpoint accepts text and parameters to return audio files, while discovery endpoints provide metadata about available voices and models without consuming credits.

POST /v1/audio/speech

This endpoint processes text input and returns synthesized audio. It accepts a JSON body containing the model, input text, voice selection, and optional parameters like speed and language. The request shape mirrors the OpenAI speech endpoint, allowing standard SDK integration by adjusting the base URL.

  • Accepts up to 4096 characters per request
  • Returns audio in mp3, wav, opus, flac, or pcm formats
  • Supports speed adjustment from 0.25x to 4.0x

GET /v1/voices

Returns a list of all available voice presets and their associated metadata. This includes voice IDs, names, and supported languages, allowing developers to dynamically populate UI selectors without hardcoding values.

  • Lists all 8 voice presets
  • Shows supported language codes
  • Returns current pricing per character

GET /v1/models

Returns available model identifiers and their technical specifications. Currently, this includes "tts-1" and "tts-1-hd," which share the same engine and pricing structure but allow for future differentiation.

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts text input up to 4096 characters per request. Spaces and punctuation count toward this limit, so ensure your payload fits within this constraint to avoid truncation or errors.

Input Text Limits

For longer content, split your text into chunks of 4096 characters or fewer. Generate audio for each part separately, then concatenate the resulting audio files to create the final output.

Voice Selection

Choose from eight preset voices, such as Aria (warm narrator) or Felix (energetic promo). Each voice supports all 23 listed languages. If the input language is not Latin script or you need precise control, explicitly set the language parameter using an ISO code.

Speed Control

Adjust playback speed between 0.25 and 4.0. Default speed is 1.0. Lower values slow down the narration for clarity, while higher values accelerate delivery, useful for quick updates or dynamic content.

Response Formats

Sound wave illustration for: Response Formats

The API returns generated audio directly in the HTTP response body, allowing you to save the file or stream it to your application. Supported formats include MP3, WAV, OPUS, FLAC, and PCM, giving you flexibility for different playback environments.

Audio File Delivery

Audio is delivered as a binary blob within the response body. You must handle the raw bytes and save them with the correct extension based on your chosen response_format parameter. For long texts, the service returns the audio file for the last processed chunk; you must concatenate the files from each chunk yourself.

  • Supported formats: mp3, wav, opus, flac, pcm
  • Binary response body containing the audio data
  • Single file output even for long-text splitting

Error Responses

Errors are returned as JSON objects with a code and message field. Common issues include invalid API keys, rate limit exceeded (429), or invalid voice IDs (400). Failed synthesis requests are fully refunded, so you do not lose credit for errors.

  • 400: Bad Request (invalid parameters)
  • 401: Unauthorized (invalid or expired key)
  • 429: Too Many Requests (rate limit hit)
  • 500: Internal Server Error

Content-Type Headers

The response Content-Type header matches the requested format (e.g., audio/mpeg for MP3). This ensures your application correctly interprets the binary data. Always check this header if you are handling multiple format requests in the same session.

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

The CreatorVoice API mirrors the OpenAI speech endpoint structure, allowing you to reuse existing OpenAI SDK clients with minimal configuration. By adjusting the base URL, you leverage familiar libraries while accessing our dedicated TTS infrastructure.

This approach simplifies integration for developers already comfortable with OpenAI’s ecosystem, ensuring a smooth transition without learning a new client library.

Base URL Configuration

Set the client's base URL to https://api.tk33apk.com/v1. This redirects requests to our TTS engine while maintaining the standard request shape compatible with OpenAI SDKs.

Do not use the standard OpenAI base URL; doing so will direct traffic to OpenAI’s infrastructure rather than CreatorVoice's.

  • Base URL: https://api.tk33apk.com/v1
  • Compatible with official OpenAI SDKs

Client Initialization

Initialize the OpenAI client using your environment variable for the API key. Ensure the key starts with tts- to distinguish it from standard OpenAI keys.

The SDK handles authentication headers automatically when configured correctly.

No additional SDK downloads are required beyond the standard OpenAI package.

  • Use standard OpenAI SDK initialization
  • Pass tts-... key via environment variable

Standard Method Calls

Call the audio.speech method exactly as you would for OpenAI. Pass your model (tts-1 or tts-1-hd), input text, voice, and response_format.

The response returns the full audio file.

Parameters like speed and language are supported directly within this method call.

  • Method: audio.speech()
  • Supports speed and language parameters
OpenAI SDK Integration

cURL Example

Sound wave illustration for: cURL Example

Use cURL to test the API directly from your terminal. This method requires no external libraries, making it ideal for quick verification of your API key and voice selection before integrating into your application.

Basic Request

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

  • Endpoint: POST https://api.tk33apk.com/v1/audio/speech
  • Header: Authorization: Bearer YOUR_API_KEY
  • Body: JSON with model, input, voice, and response_format

JSON Body Structure

Define the synthesis parameters in the JSON body. The input field accepts up to 4096 characters. Use tts-1 for standard quality or tts-1-hd for high definition.

  • model: "tts-1" or "tts-1-hd"
  • input: "Hello, this is a test."
  • voice: "nova"
  • response_format: "mp3"

Response Handling

The API returns the audio file directly in the response body. Save the output to a file using > output.mp3. If the request fails, check the status code and error message for details on rate limits or invalid parameters.

Rate Limits

Sound wave illustration for: Rate Limits

The CreatorVoice API enforces a standard rate limit of 60 requests per minute for each active API key. This limit applies uniformly to all synthesis operations, ensuring stable performance during typical usage patterns. Since each request generates audio from scratch, managing your request volume helps maintain consistent processing times, especially when generating longer scripts that require splitting into multiple 4096-character chunks.

For new accounts that have not yet topped up their balance, the initial rate limit is reduced to 10 requests per minute. This lower threshold allows you to test the integration with your free trial credit without overwhelming the service. Once you add USDT to your account, the limit automatically increases to the standard 60 requests per minute.

60 Requests Per Minute

Each active API key is allowed a maximum of 60 synthesis requests within any given minute. This capacity is sufficient for most independent creators generating short-form content or testing voice presets. If you exceed this limit, subsequent requests will receive a 429 Too Many Requests error until the window resets.

Initial Limit

New accounts start with a reduced limit of 10 requests per minute. This applies immediately upon key creation, regardless of whether you are using your free trial credit or have added funds. The limit remains in effect until you complete a top-up transaction via TRON (TRC-20), which upgrades your account to the standard 60 requests per minute capacity.

Queue Behavior

Requests are processed sequentially, meaning they are handled one after another. Under heavy load, a request may wait in a queue before synthesis begins. Typical generation speed is roughly real-time, approximately 25 characters per second, but complex requests or high concurrency can introduce slight delays. Failed requests are free and do not count toward your character usage, but they still consume a slot in the rate limit window.

  • Requests are processed sequentially, one after another.
  • Typical speed is ~25 characters per second.
  • Queues may form under high concurrency.
  • Failed requests do not incur charges but consume a rate limit slot.

Error Handling

Sound wave illustration for: Error Handling

Synthesis failures are billed as zero-cost events, ensuring you only pay for successfully generated audio. The API returns standard HTTP status codes to indicate request status, allowing your application to distinguish between transient network issues and permanent errors.

Common Error Codes

Use 429 Too Many Requests when exceeding the 60 requests per minute limit. A 401 Unauthorized indicates an invalid or expired API key. Input text exceeding 4096 characters per request will return a 400 Bad Request error.

Retry Logic

Implement exponential backoff for transient 5xx server errors. Do not retry 4xx client errors unless the input data changes. Queued requests under load may delay response times but do not incur additional charges.

Refund Mechanism

Failed synthesis requests result in a full credit return to your balance. No manual claim is required; the refund is automatic. Character counts for failed requests are not deducted from your usage limits.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Your voice defines your channel, so speak with genuine emotion to truly connect with your audience.

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. LibriTTS-R paper (arXiv 2305.18802)
  3. W3C WAI: making audio and video accessible
  4. Python documentation
  5. MDN: Web Speech API
  6. openai-node on GitHub
  7. Node.js documentation
  8. Tether (USDT)
  9. TRON developer hub: TRC-20
  10. IETF RFC 7845: Ogg Opus
  11. ISO 639 language codes
  12. OpenAI API reference: create speech

More on this site