Frequently asked questions
What is the first step to integrate the API?
Sign up on /get-api-key/ using Google or email. Then update your SDK’s base_url to https://api.h251.info/v1. The API accepts standard JSON bodies identical to the OpenAI speech endpoint, allowing immediate integration with existing codebases without learning a new protocol.
How do I generate an API key?
Create an account on /get-api-key/ via Google or email/password. The dashboard displays your active Bearer key immediately. You can issue a new key at any time; the previous one stops instantly, ensuring secure access management for your dubbing pipeline.
Can I use Python to call the API?
Yes. The API follows the OpenAI request shape, so the official OpenAI Python SDK works by setting base_url to https://api.h251.info/v1. Alternatively, use any HTTP library to send POST requests with your Bearer token and JSON payload.
How do I handle large scripts in the API?
Split your script into parts of up to 4096 characters. Send each part as a separate POST request to /v1/audio/speech. Then join the resulting audio files sequentially. This ensures reliable generation and avoids character limit errors for long dubbing scripts.
What audio format is best for video dubbing?
Choose mp3, wav, opus, or flac based on your pipeline’s requirements. MP3 offers small file sizes, while WAV and FLAC provide lossless quality. PCM is available for raw processing. Select the format that best fits your video editing software’s import capabilities.
How do I set the language for Arabic text?
Include the 'language' field set to 'ar' in your JSON body. Although the API guesses language from the script, Arabic uses the Arabic script, so explicit setting prevents detection errors. This ensures accurate pronunciation for your localized content.
What if the API returns an error?
Failed requests are free, with the charge returned in full. Check your input format and character limits. If issues persist, contact support via email. The API processes requests sequentially, so high load may cause delays, but errors do not incur costs.
How do I know if a request was successful?
A successful POST request returns the audio file directly in the response body. If an error occurs, the API returns an error object with details. Check the HTTP status code and response structure to confirm synthesis completion and audio delivery.
Can I automate the voice-over process?
Yes. Use the standard JSON API with your Bearer token. Scripts can loop through text segments, split them at 4096 characters, and join the outputs. The API supports automation via HTTP requests, fitting seamlessly into existing CI/CD or batch processing workflows.
How do I track my API usage?
The /get-api-key/ dashboard displays your balance, characters left, and usage history. Request metadata, including time and status, is kept for billing. Monitor your TRC-20 top-ups and character consumption directly from the account page to manage your dubbing project budget.
Is the API suitable for real-time applications?
No. The API does not support streaming or WebSocket connections. Requests are processed sequentially, and typical speed is roughly real-time for long texts. Short phrases take a few seconds. It is designed for batch processing, not live, low-latency dubbing.
How do I join multiple audio files?
Split your text into chunks under 4096 characters. Send each chunk as a separate request. The API returns individual audio files. Use your preferred audio library or tool to concatenate these files sequentially to reconstruct the full dubbing script.
What is the character limit per request?
Each request accepts up to 4096 characters in the 'input' field. Spaces and punctuation count toward this limit. For longer scripts, split the text into multiple requests and join the resulting audio files to ensure reliable synthesis and accurate timing.
Can I use the API for commercial projects?
Yes. The API is a standard cloud service available to all accounts. Generated audio carries an inaudible synthetic watermark. Input text is not used for training. You can use the output in commercial dubbing workflows without additional licensing fees beyond usage costs.
Understanding the API Endpoint
To integrate AI voice-over into your dubbing pipeline, start by sending a POST request to https://api.h251.info/v1/audio/speech. This endpoint accepts your script and configuration, returning the synthesized audio file directly. It follows the same request shape as the OpenAI speech endpoint, allowing you to use standard HTTP clients or the official OpenAI SDK by simply adjusting the base URL.
" JSON body structure for inputs
The request body requires specific fields to generate the correct audio. You must provide the input text (up to 4096 characters), the model ("tts-1" or "tts-1-hd"), and the voice preset. Optional parameters include response_format (mp3, wav, opus, flac, pcm), speed (0.25–4.0), and language (ISO code). This structure ensures precise control over the output for your video assets."
Authentication Setup
Authentication is managed through the /get-api-key/ page, where you generate a single active API key per account. This key serves as your credential for all API requests, ensuring secure access to the TTS engine.
Generate key via /get-api-key/ page
Visit the /get-api-key/ section of the dashboard to create your key. You can sign in with Google or use an email and password. The dashboard displays your key, balance, and usage statistics immediately after creation.
Include Bearer token in header
Include your key in the Authorization: Bearer tts-... header for every request. This standard authentication method ensures that your requests are recognized and billed correctly to your account balance.
Ensure the key is kept secure in your environment variables or configuration files to prevent unauthorized usage of your credit.
Manage key rotation and security
You can issue a new key at any time via the dashboard. When a new key is generated, the old one stops working immediately, providing instant security if a key is compromised.
Since there is only one active key per account, rotate it during maintenance windows to minimize any potential downtime for your dubbing pipeline.
- Rotate keys instantly via the dashboard
- Old keys stop working immediately upon rotation
- Keep keys in secure environment variables
Selecting the Right Voice
Your dubbing pipeline requires consistent vocal identities. DubSync AI provides eight presets derived from licensed LibriTTS-R recordings and public-domain LibriVox readings. Each voice carries a distinct character, ensuring your localized content maintains a specific tone across languages.
Selecting the right voice depends on your script’s nature. Whether you need a neutral news anchor or an energetic promo read, the eight options cover common industry needs without requiring custom cloning.
Choose from 8 licensed presets
The API offers four female and four male voices, each with a defined role. Aria provides a warm, clear narrator style suitable for documentaries. Nova offers a bright, upbeat tone ideal for advertisements. Luna delivers a soft, storytelling voice, while Sage is calm and instructional.
On the male side, Felix brings energy to promos, Milo sounds friendly and conversational, Atlas remains neutral for news, and Orion offers a deep, documentary-style depth. All voices are based on licensed recordings, ensuring legal clarity for commercial use.
- 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
Match voice tone to content type
Align the voice with the script’s emotional weight. Use Atlas for factual, dry text where neutrality is key. Choose Orion for narrative-driven content requiring depth. Select Nova for high-energy marketing materials where brightness drives engagement.
Remember that any voice can speak any of the 23 supported languages. This flexibility allows you to maintain a consistent brand voice across different localized versions of your video content without switching voice presets.
Test voices with sample scripts
Use the free trial credit to test voices with your actual scripts. Send short texts via the POST /v1/audio/speech endpoint to evaluate pacing and clarity. Check the generated audio for natural flow and appropriate tone before scaling to full production.
Verify that the chosen voice matches the expected output in different languages. Since voices are multi-lingual, ensure the accent and intonation remain consistent across your target markets to maintain professional quality.
Handling Language Settings
Language handling determines whether your dubbing output sounds native or artificial. The API supports 23 languages, allowing you to specify the target language for any of the eight voices. Explicitly setting the language code ensures consistent pronunciation and intonation, which is critical for maintaining the emotional tone of your localized content.
Set ISO language code explicitly
For non-English Latin-script text, always include the language field in your request. Without it, the system defaults to English, which can result in unnatural accents or mispronounced words. Specifying the ISO code guarantees that the voice model applies the correct phonetic rules for the target language.
- 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.
- Any of the 8 voices can speak any of these 23 languages.
Rely on auto-detection for English
If your input text is in English, you can omit the language parameter. Latin-script text defaults to English, reducing the complexity of your API calls for English-centric workflows.
Avoid detection errors in mixed scripts
When processing text containing mixed scripts or languages, explicit language setting prevents detection errors. This is particularly important for localized content where specific linguistic nuances must be preserved without manual intervention.
Processing Long Scripts
Since each API request accepts a maximum of 4096 characters, long scripts must be divided into smaller segments before submission. This constraint applies to the final character count, including spaces and punctuation, ensuring that no single payload exceeds the limit. Splitting logic should preserve sentence boundaries where possible to maintain natural pauses between generated audio parts.
Split text into 4096 character chunks
Divide your script into segments of up to 4096 characters. This limit is strict; exceeding it will cause the request to fail. Ensure your splitting algorithm handles punctuation correctly so that audio files do not end mid-sentence, which helps maintain coherence when the parts are later combined.
- Count all characters, including spaces and punctuation.
- Preserve sentence boundaries to avoid abrupt cuts.
- Handle edge cases like trailing spaces or special characters.
Generate audio for each part
Submit each chunk to the POST /v1/audio/speech endpoint. Since requests are processed sequentially, longer texts may experience queue delays, especially under load. Each successful request returns an audio file corresponding to that specific segment. Failed requests are free, so you can safely retry without incurring extra charges.
- Send requests one by one or in controlled batches.
- Monitor for HTTP errors to identify failed segments.
- Retries for failures do not incur additional costs.
Join audio files client-side or via script
Once all segments are generated, concatenate the audio files in the correct order. This can be done using a simple script or a dedicated audio processing library. The resulting file will play continuously, mimicking a single long recording. Ensure the output format matches your pipeline’s requirements, such as MP3 or WAV.
- Use libraries like FFmpeg or LAME for concatenation.
- Maintain the original order of segments.
- Verify the final file plays without gaps or errors.
Choosing Audio Formats
Selecting the correct audio format ensures your generated voice-overs integrate smoothly into your dubbing pipeline. The API supports MP3, WAV, OPUS, FLAC, and PCM via the response_format parameter, allowing you to balance file size, quality, and editability based on specific project needs.
Each format serves a distinct purpose in the workflow. While some formats are ideal for final distribution, others provide the lossless quality necessary for post-production adjustments. Choosing the right one minimizes unnecessary processing steps and storage costs.
MP3 for web compatibility
MP3 is the standard for web-based video delivery due to its broad compatibility and small file size. It is suitable for final renders where minimal quality loss is acceptable. Use this format when delivering directly to platforms like YouTube or social media.
This format reduces bandwidth usage without significant audible degradation, making it efficient for large-scale dubbing projects where storage and transfer speeds matter.
- Supports variable bitrates for optimal quality-size balance
- Universally supported by all major video players and editors
WAV for high-fidelity editing
WAV provides lossless audio quality, preserving every detail of the synthesized speech. It is ideal for the editing phase, allowing sound engineers to apply effects, adjust timing, or mix tracks without generational loss.
Use WAV when the voice-over requires further post-production work, such as noise reduction or equalization, before finalizing the dubbed video.
- Uncompressed, lossless audio data
- Ideal for professional audio editing workflows
OPUS for efficient streaming
OPUS offers high-quality audio at lower bitrates compared to MP3 and WAV. It is well-suited for scenarios where bandwidth efficiency is critical without sacrificing intelligibility.
While the API returns the file directly, OPUS can be beneficial if you are integrating the audio into a streaming pipeline or need to minimize data transfer costs for large volumes of content.
- High compression efficiency with good quality
Managing Rate Limits
Rate limits are set at 60 requests per minute per key, with a stricter 10 requests per minute limit before your first top-up. Monitoring your usage via the dashboard helps prevent unexpected throttling during high-volume dubbing batches.
Implementing robust retry logic is essential. Since requests are processed sequentially, queues may form under load. Configure your client to handle rate limit errors gracefully, backing off exponentially to avoid overwhelming the API during peak usage periods.
Monitor requests per minute
Track your consumption in real-time through the dashboard. This visibility allows you to adjust batch sizes before hitting the 60 requests/minute cap, ensuring consistent throughput for your localization pipeline.
Note that the pre-top-up limit of 10 requests per minute is significantly lower, so plan your initial testing phase accordingly to avoid bottlenecks during early integration.
Implement retry logic for failures
Configure exponential backoff in your integration script. When the API returns a rate limit error, wait briefly before retrying. This prevents thrashing and allows queued requests to process naturally.
Distinguish between transient queue delays and hard limits. Successful retries should be logged to distinguish between normal processing time and actual throttling events.
Scale with multiple API keys if needed
If your volume exceeds 60 requests per minute, generate additional API keys from the dashboard. Each key operates independently, effectively multiplying your throughput capacity.
Rotate keys or distribute load across multiple keys to maintain steady audio generation speeds. Since each key has its own limit, this strategy bypasses the single-key bottleneck without requiring infrastructure changes.

Testing and Validation
Testing ensures your dubbing pipeline integrates seamlessly before scaling production volume. The free trial credit provides a low-risk environment to validate API connectivity and voice selection against your specific content requirements.
Use free trial credit for testing
Sign up with Google to receive $0.50 in trial credit, sufficient for approximately 50,000 characters. This allows you to execute initial synthesis requests without financial commitment, verifying that the API key and endpoint configuration function correctly within your local or staging environment.
- Validates authentication and endpoint connectivity
- Tests voice selection against content tone
- Zero cost for initial integration checks
Verify audio quality and timing
Generate short phrases and longer segments to assess latency. Expect real-time generation speeds of roughly 25 characters per second for extended texts, with short phrases taking a few seconds. Ensure the audio aligns with your video timeline by checking synchronization accuracy.
- Monitor generation latency for short vs. long texts
- Verify synchronization with video tracks
- Assess clarity across different voice presets
Check watermark presence for synthetic ID
Each generated audio file contains an inaudible watermark marking it as synthetic speech. Verify this feature if your distribution platform requires clear identification of AI-generated voiceovers. This helps maintain transparency and compliance with emerging media labeling standards.
- ['Confirms synthetic origin of audio files', 'Supports media transparency requirements']
Billing and Usage Tracking
Track character consumption to understand cost efficiency, as pricing is $0.01 per 1,000 characters, including spaces and punctuation. Failed requests are free, ensuring you only pay for successful synthesis.
Monitor your balance and top-ups directly in the dashboard. Accounts start with a $0.50 free trial credit valid for 7 days, and balances do not expire. Top-ups via USDT on TRON are credited automatically within minutes.
Track character consumption
Each request counts characters from your input text, up to 4096 per call. This predictable metric helps you estimate costs before generating audio for long dubbing scripts.
Monitor balance and top-ups
Use the dashboard to view your current balance and transaction history. Top-ups via USDT (TRC-20) are processed automatically, with a minimum deposit of $5.
Use dashboard for usage insights
The dashboard provides clear insights into your API usage, showing character counts and request status. This data helps you optimize your pipeline without manual calculation.
Error Handling in Production
Production environments require robust error handling to ensure dubbing pipelines remain stable. The API returns standard HTTP status codes to indicate success or failure, allowing your integration to distinguish between client errors and server-side issues.
Handle HTTP 4xx and 5xx errors
Client errors (4xx) typically indicate issues with your request, such as an invalid API key, exceeding character limits, or unsupported parameters. Server errors (5xx) suggest temporary instability on the API side. Identifying these codes allows your system to respond appropriately rather than failing silently.
- 401/403: Invalid or expired authentication keys.
- 429: Rate limit exceeded (60 requests/minute).
- 500/502/503: Temporary server processing delays.
Retry failed requests safely
Implement exponential backoff for 5xx errors to handle transient load spikes. For 429 Too Many Requests, respect the retry-after header or wait before retrying. Failed synthesis requests are free, so retrying a failed request does not incur additional cost, ensuring you do not lose audio generation opportunities.
Log errors for debugging
Log the request payload, status code, and error message for every failed request. This data helps identify patterns, such as specific voices failing under high load or text encoding issues. Use these logs to refine your chunking logic or voice selection before full pipeline deployment.
Deployment Strategies
Deploying DubSync AI into your dubbing pipeline requires minimal infrastructure changes. Since the API follows the standard OpenAI request shape, you can route existing voice-over generation calls directly to https://api.h251.info/v1 by updating the base URL in your preferred HTTP client or SDK. This ensures your current video editing workflows remain intact while leveraging programmatic audio generation.
Integrate with existing video pipelines
Connect the TTS endpoint to your media processing queue. Pass the localized script text via a POST request to /v1/audio/speech, specifying the desired voice and response_format. The API returns the audio file directly, which you can then mux into your video container using tools like FFmpeg without manual file handling.
- Update base URL to https://api.h251.info/v1
- Send JSON body with model, input, voice, and format
- Receive binary audio data for direct muxing
Automate voice-over generation
Script the entire process to handle volume efficiently. For long scripts exceeding 4096 characters, split the text into chunks, generate audio for each part sequentially, and join the resulting files. This approach ensures consistent character limits and allows you to batch-process hundreds of videos overnight using your existing CI/CD or task scheduler.
- Split text into 4096-character segments
- Generate audio for each segment
- Join audio files client-side or via script
Monitor performance metrics
Track generation speed and resource usage via your dashboard. Since requests are processed sequentially, monitor queue times during peak loads. Use the usage logs to verify character counts against your TRC-20 top-ups, ensuring you have sufficient balance before launching large-scale dubbing campaigns.
- Monitor request queue times
- Track character consumption per script
- Verify TRC-20 balance before bulk runs
Support and Resources
Beyond the technical integration, support is available via email to help your dubbing pipeline. We provide direct access to our comprehensive documentation, which includes ready-to-use curl examples and SDK configurations tailored for localization workflows. These resources help you verify endpoint behavior and troubleshoot common formatting issues without guessing.
Access documentation and examples
Our docs detail every parameter, from voice selection to audio format options. You can copy-paste working examples for MP3, WAV, or OPUS outputs to accelerate your initial integration tests.
Contact support via email
For specific pipeline questions or billing inquiries, reach out via email. We do not offer phone support or live chat, so please include your API key and request details for faster resolution.
Check FAQs for common issues
Common topics like rate limits, character counting, and voice language settings are covered in our FAQ section. This helps you resolve standard operational questions before escalating to direct support.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. This allows you to test multiple voices without immediate financial commitment, ensuring the selected tone matches your creative vision before scaling up.
23 languages
Any voice speaks any of these languages.
Sources and further reading
- Wikipedia
- LibriTTS-R corpus (OpenSLR 141)
- openai-python on GitHub
- FFmpeg documentation
- Creative Commons Attribution 4.0
- W3C WAI: making audio and video accessible
- TRON developer hub: TRC-20
- ISO 639 language codes
- curl documentation
- Node.js documentation
- LibriTTS-R paper (arXiv 2305.18802)
- LibriVox public-domain audiobooks
