Text-to-Speech API Documentation and Integration Guide

By VoxSync editorial team · Updated 2026-11-19

This guide provides the technical specifications for the VoxSync Text-to-Speech API, designed for product teams integrating voice into assistants and chatbots. You will find precise details on endpoint structures, authentication, and parameter limits to optimize latency and user experience.

We cover essential integration steps, including key rotation, voice selection, and error handling. The documentation includes concrete code examples in cURL and Python, ensuring you can implement synthetic speech generation with transparent metrics and reliable performance from day one.

Text-to-Speech API Documentation and Integration Guide

Frequently asked questions

How do I generate an API key for the first time?

Sign up on the /get-api-key/ page using Google or an email and password. Accounts created via Google receive a $0.50 trial credit valid for seven days, while email-based accounts start without credit. Each account receives one active API key, which can be regenerated at any time.

Can I use the OpenAI Python SDK with this API?

Yes. The API endpoint matches the OpenAI speech endpoint shape. You can use the official OpenAI SDKs by changing the base_url to https://api.66zz8.info/v1 and providing your site-specific API key. This allows seamless integration with existing Python workflows designed for OpenAI-compatible services.

What is the maximum length of text I can send?

Each request supports up to 4096 characters of input text. For longer texts, you must split the content into parts of this size, generate audio for each part, and join the resulting audio files. Spaces and punctuation count toward this character limit.

How do I specify the language for Indonesian text?

Indonesian is not supported. The API supports 23 languages, including English, Spanish, and Chinese, but explicitly excludes Indonesian, Vietnamese, Thai, and others. If you send Indonesian text, the system may guess the language incorrectly, so ensure you use one of the supported languages.

What happens if I exceed the rate limit?

The limit is 60 requests per minute per key (10 per minute before the first top-up). Requests are processed sequentially, so exceeding the limit or high load may cause your request to wait in a queue. Failed requests are free, but successful ones consume credit.

Does the API support streaming audio chunks?

No. The API returns the complete audio file in the response. There is no streaming, WebSocket, or real-time partial audio support. You receive the full synthesized audio file once generation is complete, which may take time proportional to the text length.

How do I handle errors in the JSON response?

Send a POST request to the speech endpoint. If synthesis fails, the charge is returned in full. You should check the HTTP status code and response body for error details. The API does not provide SSML or custom pronunciation.

Is the audio response base64 encoded or binary?

The response returns the audio file directly. You can specify the format via the response_format parameter (mp3, wav, opus, flac, or pcm). The response returns the audio file directly.

Can I use the same API key for multiple projects?

Yes, each account has one active API key that can be used across multiple projects. You can issue a new key at any time, which immediately invalidates the old one. This allows you to rotate keys for security without changing your account structure.

How do I check my current balance via the API?

The /get-api-key/ page displays your balance, trial status, and characters left. The primary way to view your specific account balance and usage history is through the dashboard page after signing in.

What is the difference between tts-1 and tts-1-hd?

Both models use the same engine and have the same price of $10 per 1 million characters. The choice between tts-1 and tts-1-hd does not affect cost or the underlying voice synthesis engine.

Does the API return a timestamp with the audio?

Request metadata, including time, characters, and status, is kept for billing purposes. The primary data returned is the audio file corresponding to the input text.

How do I cancel a pending request?

Requests are processed sequentially, and if you exceed limits, they wait in a queue. Since there is no streaming or long-running job status endpoint, you cannot explicitly cancel a request once it has been submitted to the API.

Is there a webhook for long-running synthesis jobs?

No. The API does not support webhooks for long-running synthesis jobs. It returns the audio file directly in the response. For long texts, you must split them into 4096-character chunks and handle the joining of audio files yourself after receiving each response.

First request

curl

curl https://api.66zz8.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.66zz8.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.66zz8.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 and Keys

Sound wave illustration for: Authentication and Keys

VoxSync requires a Bearer token for all API requests. Generate your key via the /get-api-key/ dashboard, where you can view your active credentials and usage metrics.

Generating API Keys via Dashboard

Generating API Keys via Dashboard

Access the dashboard at /get-api-key/ to create your account using Google or email. The interface displays your single active API key, current balance, and a ready-to-use cURL example for immediate testing.

  • Supports Google OAuth or email/password sign-up
  • One active key per account
  • Real-time balance and usage visibility

Bearer Token Authorization Header

Bearer Token Authorization Header

Include your key in the HTTP header as Authorization: Bearer tts-.... This token authenticates your requests to the https://api.66zz8.info/v1 endpoint. Ensure the key is transmitted securely over HTTPS.

Key Rotation and Invalidating Old Keys

You can issue a new key at any time from the dashboard. The previous key becomes invalid immediately upon generation, ensuring tight security control without downtime if you update your configuration correctly.

Speech Synthesis Endpoint

Sound wave illustration for: Speech Synthesis Endpoint

The core functionality of the API is the POST endpoint for audio generation. Send a JSON payload to https://api.66zz8.info/v1/audio/speech containing your text and voice selection. The service returns the synthesized audio file directly in the response body, allowing seamless integration into chatbot pipelines or voice assistant applications without external storage dependencies.

Ensure your integration handles the binary audio data appropriately based on the requested format. This endpoint is stateless, meaning each request is processed independently, supporting the high-throughput needs of product teams deploying synthetic voices for user interaction.

POST /v1/audio/speech Structure

Send a standard JSON body to the endpoint. The structure mirrors the OpenAI speech API, ensuring compatibility with official OpenAI SDKs by simply adjusting the base_url. The request must include authentication headers and specific voice parameters to generate the correct audio output.

The endpoint processes text up to 4096 characters per request. For longer dialogues, split the input text and join the resulting audio files. This approach maintains audio continuity while respecting per-request character limits.

  • Base URL: https://api.66zz8.info/v1
  • Method: POST
  • Content-Type: application/json

Required Fields: Model, Input, Voice

Specify the model as either tts-1 or tts-1-hd. Both use the same engine and pricing, so choose based on your preference. The input field contains the text string to synthesize, limited to 4096 characters. The voice field must select one of the eight available presets, such as aria for a warm narrator tone or atlas for neutral news delivery.

Selecting the correct voice is critical for user experience. Use GET /v1/voices to review available options and their characteristics. Each voice is distinct, allowing product teams to match the synthetic voice to the specific context of their application, whether it is a friendly conversational bot or a formal instructional assistant.

  • model: 'tts-1' or 'tts-1-hd'
  • input: string (max 4096 chars)
  • voice: preset ID (e.g., 'nova')

Optional Parameters: Speed, Language, Format

Adjust the speed parameter between 0.25 and 4.0 to control the playback rate, optimizing for natural conversation pacing. Set the language to an ISO code (e.g., 'en', 'de', 'ja') to ensure correct pronunciation, especially for non-English Latin script text. If omitted, the system guesses the language, defaulting to English for Latin scripts.

['Choose the response_format from mp3, wav, opus, flac, or pcm. MP3 is efficient for web delivery, while WAV and FLAC offer lossless quality for testing. OPUS provides high compression with good quality. PCM is raw audio, useful for immediate playback in voice assistants without decoding overhead.']

bullets

Voice and Model Selection

Sound wave illustration for: Voice and Model Selection

Selecting the appropriate voice and model is critical for maintaining natural user interaction in voice assistants and chatbots. Our eight presets are designed for specific tonal qualities, ensuring the synthetic voice aligns with your product's personality without requiring extensive tuning.

Available Voices: Aria, Nova, Luna, Sage, etc.

Choose from eight licensed presets based on recordings from LibriTTS-R and LibriVox. Each voice offers distinct characteristics, such as Aria's warm narration or Felix's energetic promo style. All voices support 23 languages, though setting the language parameter is recommended for non-English Latin scripts to ensure accurate pronunciation.

  • 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)

Models: tts-1 vs tts-1-hd

Both tts-1 and tts-1-hd utilize the same underlying engine and incur identical pricing. Both tts-1 and tts-1-hd utilize the same underlying engine and incur identical pricing.

Listing Voices with GET /v1/voices

Use the GET /v1/voices endpoint to retrieve the full list of available voices, supported languages, and formats. This allows dynamic integration into your chatbot configuration, enabling real-time voice selection based on user preference or context.

Request Parameters and Limits

Sound wave illustration for: Request Parameters and Limits

The API accepts text inputs up to 4,096 characters per request. For longer content, split the text into chunks and concatenate the resulting audio files. This ensures consistent synthesis quality and predictable latency.

Input Text Limit: 4096 Characters

Each API call processes a maximum of 4,096 characters. If your script exceeds this, divide the input and join the outputs. This approach maintains audio continuity while respecting the endpoint constraints.

Speed Range: 0.25 to 4.0

Adjust speech tempo using the speed parameter, which accepts values from 0.25 to 4.0. The default is 1.0. Slower speeds improve clarity for complex instructions, while faster rates suit quick notifications.

Rate Limit: 60 Requests Per Minute

Accounts are limited to 60 requests per minute per key. New accounts without top-ups start with a 10 requests per minute limit. Exceeding these thresholds triggers HTTP 429 errors.

Response Formats and Encoding

Sound wave illustration for: Response Formats and Encoding

The synthesis endpoint returns raw audio data in the specified format, eliminating the need for client-side encoding. Supported formats include MP3, WAV, OPUS, FLAC, and PCM, allowing teams to optimize bandwidth and compatibility for voice assistants and chatbots.

Supported Formats: MP3, WAV, OPUS, FLAC, PCM

Select the response_format parameter in your request to receive audio in your preferred encoding. MP3 and OPUS are efficient for network transmission, while WAV and FLAC provide lossless quality for local processing. PCM offers uncompressed raw data for immediate playback integration.

Binary Audio Data in Response

The API returns the audio file directly as the response body. Ensure your HTTP client handles binary data correctly, as the response is not wrapped in JSON metadata.

Handling Large Responses with Chunking

For texts exceeding 4096 characters, clients must split the input into chunks, synthesize each part, and join the resulting audio files. The API does not stream partial audio; each request returns a complete file.

Response Formats and Encoding

Error Handling and Status Codes

Sound wave illustration for: Error Handling and Status Codes

This API returns standard HTTP status codes to indicate request outcomes. A 200 OK response delivers the audio binary, while 4xx errors indicate client-side issues such as authentication failures or malformed parameters.

Common HTTP Error Codes

Use 401 Unauthorized when the Bearer token is missing or invalid. A 400 Bad Request indicates invalid JSON structure or unsupported parameters. The 429 Too Many Requests signal is reserved for rate limit breaches, distinguishing them from general server errors.

  • 401: Invalid or expired API key
  • 400: Malformed JSON or invalid parameter
  • 429: Rate limit exceeded

Handling Rate Limit Exceeded Errors

New accounts start with a limit of 10 requests per minute. After the first top-up, this increases to 60 requests per minute. Exceeding these limits triggers a 429 status code. Implement exponential backoff to retry requests automatically without overwhelming the queue.

Debugging Failed Synthesis Requests

If synthesis fails, the charge is returned in full. Check the input text length (max 4096 characters) and ensure the voice supports the specified language. Review the HTTP status code and response body for specific error messages to resolve integration issues quickly.

Code Examples: cURL and Python

Sound wave illustration for: Code Examples: cURL and Python

This section demonstrates how to integrate VoxSync’s TTS API using common tools. By leveraging the standard OpenAI-compatible endpoint structure, developers can quickly generate audio from text without learning a new proprietary format. The following examples cover basic command-line usage, Python SDK integration, and browser-based JavaScript fetch requests.

Each code snippet assumes a valid API key and a selected voice preset. Ensure you handle the response data appropriately, as the API returns raw audio bytes that must be saved or played directly by your application.

Basic cURL Command for Synthesis

Use cURL to send a POST request to the speech endpoint. Replace YOUR_API_KEY with your actual token and specify the desired voice and input text.

The command sends the JSON payload and saves the resulting audio file to disk. This method is ideal for quick testing or scripting within CI/CD pipelines.

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

Python Example Using OpenAI SDK

Install the OpenAI Python library and configure the base URL to point to the VoxSync API. This approach reuses existing SDK patterns, simplifying integration for teams already familiar with OpenAI’s client structure.

The code snippet initializes the client, creates a speech request, and saves the binary response to a local file. This method is robust for backend services generating audio on demand.

  • import openai
  • client = openai.OpenAI(base_url="https://api.66zz8.info/v1", api_key="YOUR_API_KEY")
  • speech = client.audio.speech.create(
  • model="tts-1", voice="nova", input="Hello world"
  • )
  • speech.write_to_file("output.mp3")

JavaScript Fetch API Example

For frontend applications, use the native Fetch API to send the synthesis request. This allows direct integration into web apps without requiring a backend proxy for simple use cases.

The example sends the request and handles the binary response stream. Ensure you manage the API key securely, as exposing it in client-side code may lead to unauthorized usage.

  • fetch('https://api.66zz8.info/v1/audio/speech', {
  • method: 'POST',
  • ` headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },`
  • body: JSON.stringify({ model: 'tts-1', voice: 'nova', input: 'Hello world' })
  • })
  • .then(response => response.blob().then(blob => { ... }))

Rate Limits and Queueing

Sound wave illustration for: Rate Limits and Queueing

The API enforces strict rate limits to maintain stability for voice assistant deployments. New keys start with a 10 requests per minute limit until a top-up is processed. This ensures fair usage during initial testing phases.

Pre-Top-Up Limit: 10 Requests Per Minute

Accounts created without a top-up are capped at 10 requests per minute. This limit applies immediately upon key generation. It is suitable for basic integration tests but may throttle higher-volume chatbot workflows until credit is added.

Standard Limit: 60 Requests Per Minute

Once a USDT top-up is confirmed, the limit increases to 60 requests per minute. This allows for more robust voice assistant interactions. The limit is tracked per API key.

Queue Behavior During High Traffic

Requests are processed sequentially. Under load, requests may wait in a queue rather than failing immediately. This ensures all valid requests are eventually processed, though latency may increase during peak usage periods. Failed requests are refunded automatically.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Understanding processing speeds helps product teams set appropriate user expectations and design interface states accordingly.

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 corpus (OpenSLR 141)
  3. LibriVox public-domain audiobooks
  4. FFmpeg documentation
  5. ISO 639 language codes
  6. MDN: Web Speech API
  7. IETF RFC 7845: Ogg Opus
  8. openai-python on GitHub
  9. Tether (USDT)
  10. LibriTTS-R paper (arXiv 2305.18802)
  11. TRON developer hub: TRC-20
  12. Creative Commons Attribution 4.0

More on this site