Hindi Text-to-Speech API: Integration Guide

By Ace66 Editorial Team · Updated 2026-11-19

This guide details the integration of the ToonSpeak Hindi Text-to-Speech API, designed for freelance voice-over professionals producing animated content. It provides the technical specifications required to synthesize Hindi dialogue and narration efficiently using deterministic speech generation.

You will find the precise endpoint structures, authentication methods, and rate limit constraints necessary for high-volume production workflows. The documentation covers all available voices, response formats, and error handling procedures to ensure reliable audio delivery for your cartoon projects.

Hindi Text-to-Speech API: Integration Guide

Frequently asked questions

How do I authenticate my API requests?

Include your API key in the request header as Authorization: Bearer tts-.... Each account maintains one active key. If you generate a new key, the previous one becomes invalid immediately. Ensure your key is valid before sending requests to the endpoint.

Can I use the OpenAI Python SDK with this API?

Yes. The request shape matches the OpenAI speech endpoint. Configure the SDK by changing the base_url to https://api.ace66.info/v1 and using your site’s key. This allows direct compatibility with official OpenAI SDKs without requiring custom client implementations.

What is the base URL for the API?

The API base URL is https://api.ace66.info/v1. Use this for all requests, including the speech endpoint POST /v1/audio/speech and the voices endpoint GET /v1/voices. Ensure your SDK or HTTP client is configured to use this exact base path.

How do I specify the Hindi language in the request?

Set the language field to the ISO code for Hindi in your JSON body. Although the API guesses language from script, explicitly setting it ensures accurate synthesis. Hindi is supported alongside 22 other languages.

What are the valid values for the speed parameter?

The speed parameter accepts values between 0.25 and 4.0. This allows precise control over speech rate for your animated content. Adjusting speed helps match character pacing without altering the voice preset or the underlying audio synthesis engine quality.

Does the API support SSML?

No, the API does not support SSML. It accepts plain text input up to 4096 characters. For precise control, adjust the speed parameter or select different voice presets. Phoneme dictionaries and custom pronunciation lexicons are also not available.

How do I handle rate limit errors?

The limit is 60 requests per minute per key (10 before the first top-up). If exceeded, requests queue or fail. Implement exponential backoff in your client. Monitor usage via the dashboard to stay within limits and avoid synthesis delays during high volume.

What happens if the API returns an error during synthesis?

If synthesis fails, the charge is returned in full. Failed requests incur no cost. You can retry the request or split longer texts into smaller chunks. Check the response status code to determine if the error is transient or permanent.

First request

curl

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

ToonSpeak requires a Bearer token for API authentication. Include the header Authorization: Bearer tts-<key> in every request. One active key is issued per account.

Bearer token usage

Bearer token usage

Pass the token via the standard HTTP Authorization header. The key is valid for all endpoints, including POST /v1/audio/speech and GET /v1/voices.

Key management

Key management

Each account holds a single active key. You can generate a new key at any time via the dashboard. The previous key becomes invalid immediately upon issuance of the new one.

  • Generate keys via the /get-api-key/ dashboard.
  • Only one key is active at a time.
  • Old keys stop working instantly.

Revoking old keys

Revocation is automatic. Issuing a new key instantly revokes the old one. No manual deactivation step is required.

Speech Endpoint

Sound wave illustration for: Speech Endpoint

The speech synthesis endpoint accepts POST requests to generate audio from text input. The endpoint URL is https://api.ace66.info/v1/audio/speech. The request body must be formatted as JSON, adhering to the standard structure compatible with the OpenAI SDKs by configuring the base URL appropriately.

POST request structure

Send a JSON payload containing the model identifier, input text, voice selection, and audio format preferences. The endpoint processes the request synchronously, returning the binary audio data directly in the response body. Each request must include a valid Bearer token in the Authorization header.

Required fields

The model field specifies the engine version, either tts-1 or tts-1-hd. The input field contains the text to synthesize, limited to 4,096 characters per request. The voice field must select one of the eight available presets. The response_format field defines the output audio type.

  • model: "tts-1" or "tts-1-hd"
  • input: text string (max 4096 characters)
  • voice: one of the 8 preset voices
  • response_format: mp3, wav, opus, flac, or pcm

Optional parameters

The speed parameter adjusts the playback rate between 0.25 and 4.0. The language parameter accepts an ISO code to specify the language, overriding automatic script detection. If the language is not set, the system guesses from the script, defaulting to English for Latin text.

  • speed: 0.25–4.0 (default 1.0)
  • language: ISO 639-1 code (optional)

Model Selection

Sound wave illustration for: Model Selection

The API provides two model identifiers, tts-1 and tts-1-hd, which utilize the identical synthesis engine. Both models process input text through the same underlying algorithm, ensuring consistent voice characteristics and timing across requests.

Selecting either identifier yields the same audio quality and processing speed. The distinction lies solely in the model label used in the request body, allowing for future engine upgrades without changing client code.

tts-1 model

The tts-1 identifier represents the standard model configuration. It processes character input at a rate of approximately 25 characters per second for long texts. Short phrases may take a few seconds to generate due to queue processing.

This model is suitable for standard animation dialogue where deterministic output timing is prioritized over nuanced audio fidelity differences.

  • Identifier: tts-1
  • Standard synthesis engine
  • Real-time generation speed

tts-1-hd model

The tts-1-hd identifier uses the exact same engine and pricing tier as the standard model. It is intended for clients who prefer explicit high-definition labeling in their request payloads.

There is no audible difference between outputs generated with tts-1 and tts-1-hd. Both produce audio files with the same inaudible synthetic watermark.

  • Identifier: tts-1-hd
  • Same engine as tts-1
  • No quality difference

Price and quality parity

Both models charge $10 per 1 million characters. The character count includes spaces and punctuation. Failed requests are refunded in full regardless of the model used.

Quality parity is maintained because the underlying voice synthesis logic is identical. Freelancers can switch between identifiers without altering their audio post-production workflow or budgeting expectations.

  • $0.01 per 1,000 characters
  • Identical pricing tier
  • Same synthesis engine

Voice Parameters

Sound wave illustration for: Voice Parameters

To ensure consistent character voices across animated scenes, the API provides eight deterministic presets. These voices are engineered for dialogue clarity and narrative flow, allowing freelance voice-over professionals to assign specific tonal characteristics to different characters without additional configuration.

8 available voices

Select from four female and four male presets. Options include Aria for warm narration, Nova for upbeat dialogue, Luna for storytelling, and Sage for instructional content. Male options include Felix for energetic promos, Milo for conversational tones, Atlas for neutral news-style delivery, and Orion for deep documentary narration.

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

Speed range 0.25–4.0

Adjust speech rate between 0.25 and 4.0 to match animation timing. Lower speeds aid synchronization for detailed lip-sync work, while higher speeds compress narration for quick dialogue exchanges. The default rate is 1.0.

Language code specification

Hindi is supported. Explicitly set the language parameter to hi to ensure accurate pronunciation, as the system defaults to English for Latin script text. The same eight voices can produce Hindi audio with native phonetic accuracy.

Response Formats

Sound wave illustration for: Response Formats

ToonSpeak delivers synthesized audio in five distinct container formats, allowing freelance voice-over professionals to select the optimal balance between file size and fidelity for their animation pipelines. Each request explicitly defines the output structure via the response_format parameter, ensuring deterministic behavior for batch processing character dialogue.

MP3 output

MP3 is the default format, providing efficient compression suitable for web embedding and standard review workflows.

WAV output

WAV delivers uncompressed PCM audio, preserving the full signal integrity required for professional post-production. This format is ideal when further audio processing or mixing is planned within the animation studio's pipeline.

Opus, FLAC, PCM options

Opus offers high-quality compression for storage-constrained environments. FLAC provides lossless compression for archival purposes, while raw PCM delivers unencoded audio data for specialized hardware integration.

  • Opus: efficient streaming
  • FLAC: lossless archival
  • PCM: raw data
Response Formats

Rate Limits

Sound wave illustration for: Rate Limits

Rate limits are enforced per API key to ensure stable service during high-volume generation. The system allows 60 requests per minute for accounts with a balance, providing sufficient throughput for most freelance animation workflows.

60 requests per minute

Standard accounts can process up to 60 synthesis requests within a rolling one-minute window. This limit applies to the active key and is reset continuously as the window slides, allowing for burst processing of dialogue lines.

10 requests before top-up

New accounts or those without recent top-ups are restricted to 10 requests per minute. This lower limit applies to accounts before the first top-up.

Queue processing behavior

Requests are processed sequentially within the allocated window. Under heavy load, additional requests may enter a queue, causing slight delays in audio generation. This ensures deterministic output without dropping requests, though real-time partial audio streaming is not available.

Error Handling

Sound wave illustration for: Error Handling

API responses include standard HTTP status codes to indicate request outcomes. Clients must parse these codes to determine whether synthesis succeeded or failed, enabling robust error handling in automated animation pipelines.

4xx client errors

Client errors typically indicate invalid input parameters or authentication issues. Common causes include missing required fields, exceeding the 4096-character input limit, or using an invalid voice identifier. Verify your request structure against the specification before retrying.

  • 400 Bad Request: Invalid JSON or missing fields
  • 401 Unauthorized: Invalid or expired Bearer token
  • 429 Too Many Requests: Exceeded rate limits (60 req/min)

5xx server errors

Server errors indicate temporary issues with the synthesis engine or infrastructure. These are transient and do not incur charges. Implement exponential backoff in your integration to handle retries efficiently during high-load periods.

  • 500 Internal Server Error: Unexpected processing failure
  • 503 Service Unavailable: Temporary overload or maintenance

Refund on failure

Failed requests are free. If synthesis fails, the charge is returned in full. Your balance reflects this adjustment automatically, ensuring you only pay for successful audio generation.

Curl Example

Sound wave illustration for: Curl Example

The following example demonstrates a standard synthesis request for Hindi dialogue using the aria voice. This command sends a JSON payload containing the text, model selection, and voice identifier to the API endpoint.

Headers must include the Bearer token for authentication. The response body contains the binary audio data, which can be redirected to a local file for immediate use in your animation pipeline.

Basic request command

Use curl to POST your text to the speech endpoint. Replace YOUR_API_KEY with your actual key and input_text with your Hindi dialogue string. The payload specifies the tts-1 model and aria voice for clear narration.

  • Method: POST
  • Endpoint: https://api.ace66.info/v1/audio/speech
  • Content-Type: application/json

Headers configuration

Include the Authorization header with your Bearer token. Ensure the Content-Type is set to application/json to prevent parsing errors. The token authenticates the request against your account balance.

  • Authorization: Bearer tts-...

Response parsing

On success, the API returns raw audio binary data. Save this output directly to a file using the -o flag. If the request fails, the response will contain a JSON error object with a status code and message.

  • Status 200: Audio binary data
  • Status 400-499: Client error JSON
  • Status 500-599: Server error JSON

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Failed requests are refunded in full, so you only pay for successfully generated audio.

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. IETF RFC 7845: Ogg Opus
  4. LibriTTS-R paper (arXiv 2305.18802)
  5. curl documentation
  6. Node.js documentation
  7. Tether (USDT)
  8. OpenAI API reference: create speech
  9. openai-python on GitHub
  10. ISO 639 language codes
  11. LibriVox public-domain audiobooks
  12. FFmpeg documentation

More on this site