API Documentation and Quickstart Guide for Developers

By DubbingSync editorial team · Updated 2026-11-18

This guide covers the core integration points for DubbingSync’s text-to-speech API, designed specifically for localization freelancers and small dubbing studios. You will find clear instructions on authenticating requests, selecting voices, and generating audio files in various formats. The documentation focuses on practical workflows, helping you automate multilingual audio production without enterprise overhead.

We provide a straightforward API that handles character counting, format conversion, and multi-language generation so you can focus on timing and nuance. Whether you are using the official OpenAI SDK or plain HTTP, you will get concrete code examples and parameter details. This page is your reference for reliable, programmatic access to synthetic voices.

API Documentation and Quickstart Guide for Developers

Frequently asked questions

How do I set the base_url?

Set the base_url to https://api.tk6bet.com/v1. This allows you to use the official OpenAI SDKs by simply pointing them to this endpoint. Your API key remains the same, ensuring a seamless transition for existing workflows.

Can I use the OpenAI Python SDK?

Yes, the API uses the same request shape as the OpenAI speech endpoint. You can use the official OpenAI Python SDK by changing the base_url to https://api.tk6bet.com/v1 and providing your site-specific key. This enables immediate compatibility with your existing codebase.

What is the maximum character limit?

Each request supports up to 4096 characters in the input field. For longer texts, you should split your content into parts of this size and join the resulting audio files. This ensures consistent processing and avoids exceeding the single-request limit while maintaining the integrity of your generated speech.

Does the API support streaming audio?

No, the API does not support streaming, WebSocket connections, or real-time partial audio. It returns the complete audio file in the response after synthesis is finished. This synchronous approach simplifies integration for batch processing workflows.

How do I handle rate limits?

You are limited to 60 requests per minute per key. If you have not topped up, the limit is 10 requests per minute. Requests are processed sequentially, so under load, you may experience queue delays. Monitor your usage via the dashboard to avoid hitting these limits during high-volume generation.

What languages can I specify?

You can specify any of the 23 supported languages using their ISO code. If omitted, the system guesses the language, defaulting to English for Latin script. Supported languages include Arabic, Chinese, English, French, German, Japanese, Spanish, and others. Ensure you set the language parameter for non-English Latin text to ensure accuracy.

Is the endpoint HTTPS?

Yes, the API endpoint is https://api.tk6bet.com/v1. All requests are secured over HTTPS, ensuring that your text data and API keys are transmitted securely. This standard encryption protects your input text and audio responses during transmission between your application and our servers, maintaining data integrity.

Do I need to install extra packages?

No, you do not need to install any proprietary packages. You can use the official OpenAI SDK or plain HTTP requests. Since the endpoint format matches OpenAI’s speech endpoint, standard libraries like requests or the OpenAI Python client work directly. This reduces dependency overhead and simplifies your development environment.

How do I split long texts?

Split your text into chunks of up to 4096 characters. Generate audio for each chunk individually and then join the resulting audio files. This approach respects the single-request character limit. You can handle the splitting logic in your application code before sending the POST requests to the speech endpoint.

What audio format is best for dubbing?

You can choose from mp3, wav, opus, flac, or pcm. MP3 is often preferred for its balance of quality and file size, while WAV offers uncompressed quality. FLAC provides lossless compression. All formats are fully supported by the API.

Can I generate multiple voices at once?

No, each request generates audio for a single voice. To use multiple voices, you must send separate requests for each voice preset. You can parallelize these requests to improve throughput. The API processes requests sequentially under load, so managing multiple concurrent requests requires careful rate limit handling in your client.

How do I know if a request failed?

Check the HTTP status code and response body for error details. Failed requests are free, and the charge is returned in full if synthesis fails. You can also monitor your usage and status via the dashboard. Implement retry logic in your code to handle transient errors gracefully during high-volume generation.

Is there a developer console?

Yes, the /get-api-key/ page serves as your developer console. It displays your API key, balance, trial status, characters left, and usage statistics. It also provides a ready-to-use cURL example for quick testing. This dashboard gives you all the essential metrics needed to manage your account and monitor API consumption effectively.

Do I need a credit card to use the API?

No, we do not accept credit cards, PayPal, or subscriptions. Payments are made via USDT on the TRON network (TRC-20). You can start with a free trial credit of $0.50 if you sign in with Google. Top-ups are credited automatically within minutes, with no monthly fees.

First request

curl

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

Secure access to the TTS engine is managed via a single API key linked to your account. Include this key in the Authorization header of every request using the Bearer scheme. This standard approach ensures compatibility with common HTTP libraries and the OpenAI SDK.

Use Bearer token in header

Use Bearer token in header

Pass your key as Authorization: Bearer <your-key>. This header authenticates your requests to the API endpoint. Ensure the key is sent with every call to generate speech or retrieve voice lists.

One active key per account

One active key per account

Each account maintains exactly one active API key at any time. This simplifies management for freelancers and small studios who do not need complex permission hierarchies. Use the dashboard to view your current key and usage statistics.

Revoke old keys instantly

Issue a new key through your account dashboard to immediately invalidate the previous one. The old key stops working at once, providing instant security if you suspect exposure. This is useful when rotating keys between different localization projects.

Endpoint Overview

Sound wave illustration for: Endpoint Overview

The DubbingSync API centers on a single core endpoint for audio synthesis. You send text via POST to receive a generated audio file, while GET requests provide metadata about available voices and models. This structure keeps the integration simple and predictable for localization workflows.

POST for speech generation

Send your localized script text to the speech endpoint to receive an audio file. The system handles the conversion, respecting character limits and format requirements. Failed requests incur no charge, ensuring you only pay for successful synthesis.

  • Endpoint: POST /v1/audio/speech
  • Returns audio file in requested format
  • Failed requests are free

GET for voices and voices and models

Use GET /v1/voices to retrieve the list of 8 voice presets, supported languages, and available audio formats. Use GET /v1/models to confirm the current engine versions. These endpoints help you dynamically select the right voice for your dubbing project without hardcoding values.

  • GET /v1/voices: Lists presets, languages, formats
  • GET /v1/models: Returns engine details
  • No need to hardcode voice IDs

Standard JSON request body

The API uses a standard JSON body for requests, similar to the OpenAI format. You define the model, input text, voice, and response format. This consistency allows you to use existing HTTP clients or the official OpenAI SDK with a simple base_url change.

  • JSON body with model, input, voice, format
  • Compatible with standard HTTP libraries
  • Easy to integrate into existing scripts

Request Parameters

Sound wave illustration for: Request Parameters

Configure the synthesis engine and payload to generate audio. Select either tts-1 or tts-1-hd for identical engine performance and pricing. Provide your source text in the input field, ensuring it does not exceed 4096 characters per request. For longer scripts, split the text into chunks and join the resulting audio files.

Model selection: tts-1 or tts-1-hd

Both models use the same underlying engine and carry the same price of $10 per million characters. There is no performance difference between them, so choose based on your preference for the output file format or specific encoding requirements.

Input text up to 4096 chars

Pass your dialogue or narration as a UTF-8 string in the input field. Spaces, punctuation, and special characters count toward the limit. If your script exceeds this length, segment it logically and concatenate the audio responses to maintain timing accuracy.

  • Max 4096 characters per request
  • Spaces and punctuation count as characters
  • Split long texts and join audio files

Voice preset and language code

Assign one of eight voice presets like aria or atlas to match your content style. While the system guesses language from the script, explicitly setting the language ISO code ensures accuracy for Latin-script texts that are not English, such as Dutch or Portuguese.

  • 8 voice presets available
  • Any voice speaks any supported language
  • Set language for non-English Latin text

Audio Formats

Sound wave illustration for: Audio Formats

Selecting the right audio format is crucial for localization workflows. Our API supports five distinct formats, allowing you to optimize for file size, playback compatibility, or editing fidelity depending on your specific dubbing pipeline requirements.

MP3 for web compatibility

MP3 is the standard choice for web-based video players and most consumer devices. It offers a good balance between audio quality and file size, making it ideal for final delivery in web-based dubbing projects where bandwidth matters.

WAV for high quality

WAV provides uncompressed, lossless audio data. This format is preferred when you need pristine quality for professional audio editing or when the final output device requires uncompressed PCM data. It ensures no generational loss during post-production.

Opus, FLAC, PCM options

Opus offers efficient compression. FLAC provides lossless compression, which is useful for archiving. PCM delivers raw, uncompressed audio data, suitable for direct integration into professional digital audio workstations without further decoding.

  • Opus: Efficient compression for streaming
  • FLAC: Lossless compression for archiving
  • PCM: Raw data for DAWs

Rate Limits

Sound wave illustration for: Rate Limits

Rate limits are enforced per API key to ensure stable performance for your localization workflows. You are allowed 60 requests per minute once your account is fully active. This limit applies to all synthesis attempts, regardless of text length or format.

60 requests per minute per key

This standard limit supports steady production for small dubbing studios. If you exceed 60 requests in a minute, subsequent requests will be rejected.

10 requests before first top-up

New accounts without a top-up are limited to 10 requests per minute. This allows you to test the API with your free trial credit before committing to USDT payments.

Queued processing under load

Requests are processed sequentially. Under heavy load, your request may wait in a queue before synthesis begins. This ensures fair resource distribution but may increase latency for batch jobs.

Rate Limits

Error Handling

Sound wave illustration for: Error Handling

Handling errors efficiently is crucial for maintaining smooth dubbing workflows, especially when processing large batches of dialogue. The API provides clear, machine-readable error codes so your integration can adapt quickly without manual intervention or guesswork.

Invalid input text format

If the input text exceeds 4096 characters or contains unsupported encoding, the request returns a 400 error. Ensure your client splits long scripts into chunks before sending them to the endpoint.

  • Text length must not exceed 4096 characters per request.
  • Ensure proper UTF-8 encoding for all script inputs.
  • Invalid JSON structure in the request body triggers immediate rejection.

Insufficient balance

Requests fail with a 402 error if your account balance covers fewer than the required characters. Since pricing is $0.01 per 1,000 characters, scripts require a positive balance. Failed requests are free: if synthesis fails, the charge is returned in full.

  • Check balance via the dashboard before bulk generation.
  • Minimum top-up is $5 via USDT (TRC-20).
  • Credits do not expire, ensuring long-term usability.

Rate limit exceeded

The API allows 60 requests per minute per key. If you exceed this, you receive a 429 error. New accounts start with a 10 requests per minute limit until the first top-up is processed.

  • Standard limit: 60 requests per minute.
  • Initial limit: 10 requests per minute.
  • Implement exponential backoff for retry logic.

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

Integration is straightforward because the API mirrors the standard OpenAI speech endpoint structure. You only need to adjust the base URL in your existing client configuration to point to https://api.tk6bet.com/v1. The official OpenAI SDKs work by changing base_url to https://api.tk6bet.com/v1.

Change base_url to our endpoint

Update your SDK configuration to use https://api.tk6bet.com/v1 as the base URL. This simple change directs all requests to our processing infrastructure while maintaining standard authentication headers.

Use official OpenAI libraries

Leverage the established OpenAI Python or JavaScript libraries directly. Since we adhere to the same request and response schemas, your existing code structure remains valid, reducing integration time for your dubbing pipelines.

Same request shape as OpenAI

The JSON body accepts model, input, voice, and response_format fields exactly as defined in the OpenAI spec. This consistency means you can swap the endpoint without rewriting your data serialization logic.

Example cURL Command

Sound wave illustration for: Example cURL Command

This section provides a concrete example of generating speech via the API. It demonstrates the exact structure needed for a successful request, ensuring you can quickly verify your integration works with our endpoints.

Basic speech generation request

Send a POST request to https://api.tk6bet.com/v1/audio/speech with a JSON body. Specify the model (tts-1 or tts-1-hd), your input text (max 4096 characters), and the desired voice preset.

  • Use tts-1 for standard quality or tts-1-hd for higher fidelity.
  • Text input is limited to 4096 characters per request.
  • Include a valid voice preset like 'aria' or 'atlas'.

Headers with API key

Include your unique API key in the Authorization header as a Bearer token. This authenticates your account and ensures the request is billed correctly to your balance.

  • Header: Authorization: Bearer tts-your-api-key-here
  • Content-Type: application/json

Response with audio data

On success, the API returns the audio file in your requested format (e.g., MP3, WAV). If the synthesis fails, you receive a JSON error object with details, and no charge is applied.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Switching voices mid-project can confuse listeners and break the immersion, especially in serialized content like audiobooks or consistent brand messaging.

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

More on this site