API Documentation for Generate Voice Over from Text

By DubSync editorial team · Updated 2026-11-18

This guide helps freelance localization agencies and solo dubbers generate consistent voice-overs from text using the DubSync TTS API. You will find clear examples for sending scripts and receiving audio files, along with details on pricing, rate limits, and error handling. Everything is designed to fit into your existing workflow without requiring complex studio bookings or heavy infrastructure.

We use standard OpenAI-compatible endpoints, so you can switch quickly if you already have existing code. The documentation covers authentication, voice selection, and supported formats like MP3 and WAV. No custom SDKs are needed—just send a JSON request and get an audio file back, ready for your dubbing projects.

API Documentation for Generate Voice Over from Text

Frequently asked questions

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

Navigate to /get-api-key/ and sign in using Google or email with a password. Google sign-ins receive a $0.50 free trial valid for seven days, while email accounts start without trial credit. The dashboard displays your active key, balance, and usage statistics immediately after authentication.

What is the base URL for the OpenAI SDK integration?

Use https://api.56x.info/v1 as your base URL. Configure your SDK client to point to this address, then provide your API key via the Authorization header. This allows you to use the standard speech endpoint structure without modifying the request body format.

Can I use the official OpenAI SDK with this API?

Yes, the request shape matches the OpenAI speech endpoint exactly. You can use the official OpenAI SDKs by simply changing the base_url to https://api.56x.info/v1 and supplying your site-specific key. This enables seamless integration with existing codebases without rewriting HTTP logic.

What happens if the API key is compromised?

You can issue a new key at any time from your dashboard. When you generate a new key, the old one stops working immediately. This ensures that unauthorized access is cut off instantly, protecting your balance and usage history from further unauthorized requests.

How do I handle rate limit errors in my script?

The limit is 60 requests per minute per key (10 before the first top-up). Implement exponential backoff logic in your script to retry after receiving a rate limit error. Since requests are processed sequentially, queuing delays may also occur during high load periods.

Is the API compatible with Python and Node.js?

Yes, since it follows the standard OpenAI endpoint structure, any language supporting HTTP requests works. The official OpenAI SDKs for Python and Node.js are compatible when configured with the correct base_url. You can also use plain HTTP libraries if you prefer not to use the SDK.

Can I send text in multiple languages in one request?

Each request processes a single text input up to 4096 characters. While voices can speak any of the 23 supported languages, you must specify the language code if the script is not clearly identifiable (e.g., non-English Latin text defaults to English). For mixed-language texts, split them into separate requests to ensure accurate generation.

How do I specify the output format in the request?

Include the response_format field in your JSON body with values: mp3, wav, opus, flac, or pcm. This field is optional, but specifying it ensures you receive the audio file in your preferred codec. The API returns the audio data directly in the response body.

What is the maximum input length for a single request?

The maximum input length is 4096 characters per request. Spaces and punctuation count toward this limit. For longer texts, split your content into chunks of 4096 characters, generate audio for each, and join the resulting files to create the final continuous audio track.

Do I need to install extra libraries to use the API?

No extra proprietary libraries are required. You can use the official OpenAI SDKs or standard HTTP clients like requests in Python or axios in Node.js. Since the endpoint structure is standard, any tool capable of sending JSON POST requests can interact with the API.

How do I test the API before integrating it?

Use the ready curl example provided on the /get-api-key/ dashboard page. You can also make direct POST requests to the endpoint with a small text input. Check the response for the audio file and verify the status code to ensure successful synthesis before full integration.

Is the API documentation updated regularly?

The documentation reflects the current API behavior and endpoint structure. Since the interface matches the OpenAI standard, updates are primarily driven by changes in the underlying engine or endpoint definitions. (Note: The API interface is stable; updates are rare). Check the /docs/ page for the latest field descriptions and usage examples.

Can I use the API key on multiple machines?

Yes, a single API key can be used across multiple machines or environments simultaneously. There is no limit on concurrent usage locations. However, all requests from that key count toward the global rate limit of 60 requests per minute for that specific key.

How do I revoke an old API key?

Generate a new API key from your dashboard. The moment the new key is created, the old one becomes invalid immediately. You do not need to manually revoke it; issuing a new key automatically deactivates the previous one, securing your account instantly.

First request

curl

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

Access the DubSync API by signing up on the /get-api-key/ page using Google or an email account. Your unique API key appears immediately on the dashboard, ready to be used in your requests. This key identifies your account and tracks your character usage against your balance.

API Key generation

API Key generation

Keys are generated upon sign-up. Google sign-ups receive a $0.50 free trial credit, while email accounts start with zero balance. You can view your active key and usage stats directly on the dashboard.

Bearer token usage

Bearer token usage

Include your key in the request header as Authorization: Bearer tts-.... Ensure no extra spaces are added. The key authorizes your requests and deducts characters from your balance at a rate of $0.01 per 1,000 characters.

Key rotation policy

You can issue a new key at any time from the dashboard. The old key stops working immediately, ensuring secure access management for your localization projects without interrupting ongoing integrations.

Endpoints Overview

Sound wave illustration for: Endpoints Overview

To turn your localized scripts into audio, you primarily interact with the speech generation endpoint. This single POST endpoint accepts your text, voice preference, and formatting options, returning the synthesized audio file directly in the response.

Speech generation endpoint

Send text via POST to https://api.56x.info/v1/audio/speech. The API accepts JSON bodies with up to 4096 characters per request. For longer scripts, split your text into chunks and join the resulting audio files. The endpoint returns standard audio formats like MP3, WAV, FLAC, OPUS, or PCM.

Voices listing endpoint

Use GET /v1/voices to retrieve the full list of available voices, languages, and formats. This endpoint helps you verify which presets are active and check the supported languages before generating audio. It confirms the eight available voice presets suitable for dubbing workflows.

Models endpoint

Query GET /v1/models to see the available TTS models. Currently, the API offers "tts-1" and "tts-1-hd", which share the same engine and pricing. This endpoint confirms that model selection does not affect the cost, only the output quality preference.

Request Parameters

Sound wave illustration for: Request Parameters

Configure your TTS requests with specific parameters to control audio generation. The API accepts standard JSON bodies, allowing you to define the engine, text content, voice style, and output format in a single call.

Each parameter directly influences the resulting audio file’s characteristics, from the synthetic voice used to the audio codec. Proper configuration ensures the generated speech matches your localization script’s tone and technical requirements.

Model selection

Choose between "tts-1" and "tts-1-hd" for your synthesis engine. Both models use the same underlying engine and incur identical pricing, so you can switch between them without cost implications.

Input text format

Provide your script in the input field as a standard UTF-8 string. The API supports up to 4096 characters per request. For longer scripts, split the text into chunks and join the resulting audio files.

  • Maximum length: 4096 characters per request
  • Spaces and punctuation count toward the character limit
  • Text is not used for training after generation

Voice preset selection

Select from eight voice presets to match your script’s mood. Each voice is designed for specific tones, such as warm narration or energetic promos. You can also optionally specify a language ISO code for accurate pronunciation.

  • 8 distinct voice presets available
  • Optional language parameter for non-English Latin text
  • Voices are based on licensed recordings

Response Formats

Sound wave illustration for: Response Formats

The API returns audio files in the format specified by the response_format parameter. Each response contains the binary audio data, allowing you to integrate the output directly into your localization pipeline without intermediate conversion steps.

MP3 output

MP3 is the default format, offering a good balance between file size and quality. It is ideal for web playback and most standard dubbing workflows where bandwidth efficiency matters.

WAV output

WAV provides uncompressed, high-fidelity audio suitable for professional post-production. Use this format when you need lossless quality for mixing, editing, or archiving voice-overs in your dubbing projects.

Other supported formats

You can also request Opus, FLAC, or PCM. Opus offers efficient compression, FLAC provides lossless compression, and PCM gives raw uncompressed data for immediate processing.

  • Opus: efficient compression
  • FLAC: lossless compression
  • PCM: raw audio data

Rate Limits

Sound wave illustration for: Rate Limits

Your API key allows 60 requests per minute, which is plenty for converting scripts into audio files during a typical freelance workflow. Each request processes text sequentially, so longer documents may queue slightly behind others during peak usage.

Requests per minute

Standard accounts can send up to 60 requests per minute. This limit resets every 60 seconds, allowing you to batch-process multiple segments of a dubbing script without interruption.

Initial limit before top-up

New accounts start with a lower limit of 10 requests per minute. This ensures stable service while you test the API before adding funds. The limit increases to 60 rpm automatically after your first top-up.

Handling 429 errors

If you exceed the limit, the API returns a 429 status code. Implement a simple retry logic with exponential backoff in your script. This prevents overwhelming the queue during heavy generation periods.

  • Check for HTTP 429 status codes.
  • Wait briefly and retry the request.
  • Respect the Retry-After header if provided.
Rate Limits

Error Handling

Sound wave illustration for: Error Handling

Handling API responses efficiently is crucial for maintaining smooth voice-over workflows. Our system returns standard HTTP status codes to indicate success or failure, allowing you to build robust error handling into your localization pipeline without unnecessary complexity.

Common error codes

We use standard HTTP status codes to communicate request states. A 200 OK response indicates successful synthesis. Common errors include 400 Bad Request for invalid parameters, 401 Unauthorized for missing or incorrect API keys, and 429 Too Many Requests when you exceed your rate limit.

  • 400: Invalid JSON or missing required fields
  • 401: Invalid or expired API key
  • 429: Rate limit exceeded (60 req/min)

Retry logic

For transient network issues, implement exponential backoff. If you receive a 429 error, wait briefly before retrying. Since requests are processed sequentially, brief delays often resolve queueing issues. Avoid rapid-fire retries to prevent additional rate limit penalties.

  • Wait 1–2 seconds before the first retry
  • Double wait time after each subsequent failure
  • Max 3 retries before alerting the user

Billing error refunds

Billing refunds If synthesis fails, the charge is returned in full to your balance. This ensures you only pay for successfully generated audio files. Check your dashboard to verify credited amounts appear within minutes.

SDK Integration

Sound wave illustration for: SDK Integration

The API mirrors the OpenAI speech endpoint structure, meaning you can reuse existing OpenAI SDKs with minimal adjustments. This allows freelance dubbers to integrate voice-over generation directly into their localization pipelines without learning a new library.

You only need to update the base URL to point to our endpoint and swap the API key. This approach keeps your code clean and leverages the robustness of established client libraries.

OpenAI SDK setup

Install the official OpenAI Python or Node.js package. Ensure your API key is set to your DubSync key prefixed with tts-.

Base URL configuration

Configure the client to use https://api.56x.info/v1 as the base URL. This directs all requests to our TTS engine while maintaining standard request shapes.

The official SDKs work seamlessly because our endpoint accepts identical JSON bodies.

Code examples

Here is a quick Python snippet to generate audio. Replace YOUR_API_KEY with your key from /get-api-key/.

```python import openai client = openai.OpenAI(api_key="tts-...", base_url="https://api.56x.info/v1") response = client.audio.speech.create(model="tts-1", voice="nova", input="Hello world", response_format="mp3") response.write_to_file("output.mp3") ```

This example uses the nova voice. Adjust the voice parameter to match your script's tone, from warm narrators to energetic promo styles.

  • Use tts-1-hd for higher quality if needed.
  • Set response_format to wav or opus for specific workflow needs.
  • Pass speed between 0.25 and 4.0 to match script pacing.

Voice Selection

Sound wave illustration for: Voice Selection

Choose from eight distinct voice presets, each engineered for specific localization workflows. All voices support 23 languages, allowing you to generate consistent audio for scripts in English, Spanish, German, Japanese, and more without switching models.

Select a voice based on the tone required for your project. Whether you need a warm narrator for audiobooks or a neutral announcer for news, the preset names help you quickly identify the right fit for your script.

Available presets

The API offers eight distinct voice presets designed for various content types. You can use these voices across all supported languages, ensuring consistent character voices throughout a localized project. Each voice is based on licensed recordings from LibriTTS-R and LibriVox.

  • 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

Gender options

Voices are categorized by gender to help you match your casting needs. Four female voices (aria, nova, luna, sage) and four male voices (felix, milo, atlas, orion) provide a balanced range of options for dialogue-heavy dubbing work.

Tone descriptions

Each preset carries a specific tonal quality. For example, use atlas for neutral news reads or orion for deep documentary styles. Tone descriptions are included in the /v1/voices endpoint response to help you preview the character before generating audio. (Note: Previewing requires generating audio, as no separate preview endpoint exists).

Listen to the 8 voices

Each sample below was generated by this API from the same sentence.

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. Tether (USDT)
  4. Creative Commons Attribution 4.0
  5. W3C WAI: making audio and video accessible
  6. OpenAI API reference: create speech
  7. FFmpeg documentation
  8. TRON developer hub: TRC-20
  9. Python documentation
  10. openai-node on GitHub
  11. Node.js documentation
  12. LibriVox public-domain audiobooks

More on this site