How to Integrate Hindi Text to Speech API for Video Apps

By TikTTS Editorial Team · Updated 2026-11-19

This guide explains how to integrate the TikTTS Hindi text-to-speech API into your video production workflow. You will learn how to generate audio files for TikTok, Reels, and Shorts using standard HTTP requests or the OpenAI SDK. The documentation covers authentication, request structures, and response formats, ensuring you can automate voice generation for short-form content creators.

We focus on practical details relevant to scaling your output: character pricing, rate limits, and language handling for Hindi and other supported languages. By the end, you will know how to manage your API key, handle errors, and process long texts efficiently. This is a straightforward reference for developers building reliable TTS pipelines without unnecessary complexity.

How to Integrate Hindi Text to Speech API for Video Apps

Frequently asked questions

What is the base URL for the Hindi TTS API?

The base URL is https://api.r3r3.info/v1. You can use official OpenAI SDKs by changing the base_url to this endpoint. The speech endpoint is POST https://api.r3r3.info/v1/audio/speech. This allows you to send text and receive an audio file using standard JSON requests compatible with existing TTS workflows.

Do I need to install a specific SDK for Hindi voices?

No specific SDK is required. You can use the official OpenAI SDKs by setting the base_url to https://api.r3r3.info/v1. Alternatively, you can use plain HTTP requests. There is no official SDK from us, nor a mobile SDK or WordPress plugin, so standard HTTP libraries work perfectly.

How do I set the language to Hindi in the request?

Include the language field in your JSON body with the ISO code for Hindi. If you do not set it, the system guesses the language from the script, defaulting to English for Latin text. Explicitly setting the language ensures accurate Hindi synthesis, especially if your input text uses non-Latin scripts.

What happens if I send text longer than 4096 characters?

Each request supports up to 4096 characters. For longer texts, you must split the input into parts of this limit. After generating audio for each part, you join the resulting audio files. This ensures reliable synthesis without exceeding the character constraint per single API call.

Can I use the same API key for multiple projects?

Yes, one active key is issued per account. You can use this single key across multiple projects or applications. If needed, you can issue a new key at any time, which immediately invalidates the old one. This allows you to rotate keys for security without managing multiple credentials simultaneously.

How do I authenticate my API requests?

Include your API key in the Authorization header as a Bearer token. The format is Authorization: Bearer tts-... followed by your key. Ensure you use the key associated with your account. Each account has one active key, so verify you are using the current valid key for requests.

Is the API compatible with Python and JavaScript?

Yes, it is compatible with both. Since the request shape matches the OpenAI speech endpoint, you can use the official OpenAI SDKs for Python and JavaScript. Simply update the base_url to https://api.r3r3.info/v1. This allows seamless integration into existing Python or JavaScript applications without custom client libraries.

What is the default voice if I don't specify one?

The API does not have a single default voice; you must provide a voice from the eight presets. The voices are aria, nova, luna, sage, felix, milo, atlas, or orion. You should explicitly set the voice field in your request to ensure consistent Hindi synthesis results.

How do I handle audio file downloads in code?

The API returns the audio file directly in the response body. You can write this binary data to a file or process it in memory. Supported formats include mp3, wav, opus, flac, and pcm. Choose the response_format in your request to determine the file type returned by the endpoint.

What are the supported audio formats for Hindi?

The API supports mp3, wav, opus, flac, and pcm. You specify the desired format using the response_format field in your request. These formats are available regardless of the language, including Hindi. Choose the format that best suits your storage and playback requirements for the generated audio clips.

Can I control the speed of the Hindi voice via API?

Yes, you can control speed using the speed field in your request. The value must be between 0.25 and 4.0. This allows you to adjust the generation speed of the Hindi voice to fit your video pacing. The default speed is typically 1.0, but you can customize it per request.

How do I check available voices programmatically?

Send a GET request to /v1/voices. This endpoint returns information about available voices, languages, formats, and price. You can use this to dynamically select from the eight presets (aria, nova, luna, sage, felix, milo, atlas, orion) for your Hindi text-to-speech integration without hardcoding voice names.

What is the maximum speed setting available?

The maximum speed setting is 4.0. You can set the speed value anywhere between 0.25 and 4.0 in your request. This allows you to significantly accelerate the Hindi voice synthesis if needed for short clips or specific pacing requirements in your TikTok or Reels content.

Do I need to provide the input text in Hindi script?

No, you can use Latin script, but you should set the language field to Hindi. If you use Latin text without setting the language, it defaults to English. Providing text in Hindi script is supported, but explicitly setting the language ensures correct pronunciation regardless of the script used.

First request

curl

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

Getting Your API Key

Sound wave illustration for: Getting Your API Key

Access the /get-api-key/ page to start. You can register using a Google account or standard email and password. Google sign-ups include a $0.50 trial valid for 7 days, while email accounts start with zero balance.

Sign Up Process

Sign Up Process

Accounts are tied to this specific site. Choose your preferred authentication method to create your unique credential set immediately.

Key Generation Steps

Key Generation Steps

Once registered, the dashboard displays your active API key. Use this key in the Authorization header for all requests. The key format begins with 'tts-'.

  • Keys are generated instantly upon account creation.
  • Only one key is active per account at a time.

Managing Active Keys

You can issue a new key at any time from the dashboard. The old key stops working immediately when the new one is activated.

This allows you to rotate keys securely without downtime. Use the new key for your integrations right away.

First API Request

Sound wave illustration for: First API Request

Send your first Hindi text-to-speech request using a simple HTTP POST to the speech endpoint. The API accepts JSON bodies and returns audio files directly, making it easy to integrate into your video creation pipeline for TikTok or Reels.

You can test the integration immediately using a curl command or the OpenAI SDK. This section covers the exact JSON structure and required parameters to generate audio from your Hindi script.

Curl Example Code

Use this curl command to generate a short Hindi clip. Replace YOUR_API_KEY with your token from the dashboard.

```bash curl -X POST https://api.r3r3.info/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "नमस्ते, यह एक टेस्ट है", "voice": "nova", "language": "hi", "response_format": "mp3"}' \ -o output.mp3 ```

JSON Body Structure

The request body is a standard JSON object containing the text, voice selection, and output format. Ensure all fields are present to avoid errors.

```json { "model": "tts-1", "input": "Hindi text here", "voice": "nova", "language": "hi", "response_format": "mp3", "speed": 1.0 } ```

Required Fields Explained

  • model: Use 'tts-1' or 'tts-1-hd' for the same engine.
  • input: Your Hindi text, max 4096 characters.
  • voice: Select from presets like 'nova' or 'aria'.
  • response_format: Choose 'mp3', 'wav', 'opus', 'flac', or 'pcm'.
  • language: Set to 'hi' for Hindi; otherwise, it may default to English.

OpenAI SDK Compatibility

Sound wave illustration for: OpenAI SDK Compatibility

The API mirrors the OpenAI speech endpoint structure, allowing you to use official OpenAI SDKs by simply adjusting the base URL to https://api.r3r3.info/v1. This compatibility means you can reuse existing client libraries for TikTok and Reels workflows without rewriting core logic.

Authentication remains identical, using a Bearer token in the header. This standard approach simplifies integration for developers already familiar with OpenAI’s pattern, ensuring a smooth transition for video app backend services.

Base URL Configuration

Set your SDK client’s base URL to https://api.r3r3.info/v1. This directs requests to the correct TTS endpoint while maintaining the standard OpenAI request shape.

Ensure your API key is passed as Authorization: Bearer <key>. This key is specific to the r3r3.info account and works seamlessly with the configured base URL.

SDK Initialization

Initialize the OpenAI client with the new base URL and your tts-... key. The SDK handles authentication headers automatically when configured correctly.

Use standard Python or Node.js OpenAI packages. No custom wrapper is needed, as the request JSON structure matches the official specification exactly.

Request Method Differences

The POST /v1/audio/speech endpoint accepts model, input, voice, and response_format fields, identical to OpenAI’s speech endpoint.

Speed and language parameters are supported directly in the JSON body. The SDK sends these fields as part of the standard request payload, requiring no special handling.

Available Endpoints

Sound wave illustration for: Available Endpoints

The API exposes three primary endpoints for integration. The primary speech endpoint handles generation, while the metadata endpoints provide details on available voices and models without consuming credits.

These endpoints allow developers to build robust pipelines for TikTok and Reels creators who need to programmatically select the optimal voice and language for their Hindi content.

POST /v1/audio/speech

This endpoint accepts text and parameters to generate audio. Send a JSON body with model, input, voice, and response_format to receive an audio file.

Use the OpenAI SDK by setting the base URL to https://api.r3r3.info/v1. The request shape matches standard TTS integrations.

  • Endpoint: POST /v1/audio/speech
  • Auth: Bearer tts-... key
  • Max input: 4096 characters

GET /v1/voices

Returns a list of all available voices, their associated languages, and supported audio formats. Use this to let users select from the 8 presets before generating speech.

Verify that the chosen voice supports Hindi before making the speech request.

  • Returns voice metadata
  • Lists supported languages
  • Shows format options

GET /v1/models

Lists the available models, currently tts-1 and tts-1-hd. Both use the same engine and pricing structure.

Select the model that best fits your latency and quality requirements for short video clips.

  • tts-1
  • tts-1-hd

Response Formats

Sound wave illustration for: Response Formats

The API returns audio data directly in the response body, allowing immediate playback or storage. You select the desired format via the response_format parameter, which determines both the file extension and encoding method used for the generated speech.

MP3 Audio Output

MP3 is the default and most widely supported format for web and mobile applications. It offers a good balance between file size and audio quality, making it ideal for TikTok, Reels, and Shorts content where quick loading is essential.

  • Default format for most integrations
  • Small file size for fast uploads
  • Universal compatibility with video editors

WAV and FLAC Options

WAV provides uncompressed audio, ensuring no quality loss during editing. FLAC offers lossless compression, reducing file size while preserving all original audio data. These formats are suitable for professional post-production workflows where maximum fidelity is required.

  • WAV: uncompressed, high quality
  • FLAC: lossless compression, smaller size
  • Ideal for professional editing

Opus and PCM Support

Opus is a highly efficient format for streaming and low-bandwidth scenarios. PCM provides raw, uncompressed audio data, useful for specific technical applications that require direct sample access. Choose these formats based on your specific delivery or processing needs.

  • Opus: efficient for streaming
  • PCM: raw uncompressed data
  • Flexible for various use cases
Response Formats

Rate Limits and Quotas

Sound wave illustration for: Rate Limits and Quotas

Understanding rate limits is critical for maintaining steady audio generation during bulk processing. This API enforces strict quotas to ensure consistent performance for high-volume video creators.

Requests are processed sequentially. If you exceed your limit, new requests wait in a queue rather than failing immediately, which helps preserve your balance for successful generations.

60 Requests Per Minute

Each API key allows up to 60 requests per minute once your account is active. This limit applies per key, so using multiple keys can increase throughput if needed.

Requests are counted individually. If you send a batch of 10 short phrases, they consume 10 of your 60 requests per minute quota.

  • Limit: 60 requests/minute per active key
  • Applies to all successful and failed requests

Initial Limit for New Accounts

New accounts start with a reduced limit of 10 requests per minute. This lower threshold helps prevent abuse during the free trial or initial usage phase.

Once you add funds via USDT (TRC-20), your limit automatically increases to the standard 60 requests per minute.

  • New accounts: 10 requests/minute
  • Top-up triggers increase to 60 requests/minute

Queue Behavior Under Load

Requests are processed one after another. Under heavy load, your request may wait in a queue before synthesis begins.

This sequential processing ensures fair resource allocation but may increase latency for large batches during peak times.

  • Sequential processing
  • Queues may cause slight delays

Error Handling

Sound wave illustration for: Error Handling

Understanding error responses ensures your video generation pipeline remains robust. This section outlines how to handle common HTTP statuses, implement effective retry logic, and resolve billing-related issues that may halt content production.

Common HTTP Status Codes

A 401 Unauthorized error occurs if the Authorization header is missing or incorrect. Verify your tts-... key is valid and active. A 400 Bad Request indicates invalid JSON or missing required fields like input or voice. Check your request payload structure against the specification.

  • 401: Missing or invalid API key
  • 400: Invalid request body or parameters
  • 500: Internal server error (rare)

Retry Logic Recommendations

Implement exponential backoff for 429 Too Many Requests errors, which occur when you exceed the 60 requests per minute limit. Short texts may take a few seconds to generate; queue behavior under load means immediate retries might fail. Retry on 500 errors with a delay of 1-2 seconds.

  • Use exponential backoff for rate limits
  • Retry on 500 server errors
  • Avoid immediate retry for 429 errors

Billing Error Responses

A 402 Payment Required error occurs if your account balance is insufficient for the request. Failed synthesis requests are free, so no charge is applied if the audio generation fails. Ensure your TRON network top-ups are processed, as they are credited automatically within minutes.

  • 402: Insufficient balance
  • Failed requests are free
  • Check TRON transaction status

Long Text Processing

Sound wave illustration for: Long Text Processing

Handling texts exceeding 4,096 characters requires splitting the input into valid chunks. Each segment is submitted as a separate request to the API, ensuring compliance with the character limit per call.

Character Splitting Logic

Divide the source text into segments of up to 4,096 characters. Spaces and punctuation count toward this limit. Process each segment independently to maintain accuracy and avoid truncation errors during synthesis.

Audio Joining Method

Receive the audio file for each chunk sequentially. Concatenate the resulting audio files in the exact order of the original text segments. This creates a single continuous audio track ready for video editing.

Memory Management Tips

For long videos, process chunks in parallel where your infrastructure allows. This reduces total generation time significantly. Ensure your system can handle multiple concurrent API requests within the 60 requests per minute limit.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Milos friendly, conversational tone works well for relatable reviews, making the content feel like advice from a friend rather than a sales pitch.

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. curl documentation
  3. Node.js documentation
  4. LibriVox public-domain audiobooks
  5. MDN: Web Speech API
  6. Python documentation
  7. IETF RFC 7845: Ogg Opus
  8. ISO 639 language codes
  9. LibriTTS-R corpus (OpenSLR 141)
  10. openai-python on GitHub
  11. W3C WAI: making audio and video accessible
  12. FFmpeg documentation

More on this site