Cloud TTS API Integration Guide for Indie Developers

By Saylytics editorial team · Updated 2026-11-19

This guide shows indie developers how to integrate our cloud text-to-speech API using the official OpenAI SDK. You will learn to configure your client, generate audio from text, and manage your API key securely. The instructions cover the full workflow, from your first curl request to handling rate limits and errors in production.

We focus on clear, step-by-step instructions for no-code users and developers who need reliable speech synthesis without complex infrastructure. You get concrete examples, exact endpoint details, and practical tips for choosing voices and formats. By the end, you will have a working integration ready for your next project.

Cloud TTS API Integration Guide for Indie Developers

Frequently asked questions

How do I get my API key?

Sign up on the /get-api-key/ page using Google or email plus password. Your account page displays your active API key, current balance, and a ready curl example. You can issue a new key at any time, which immediately invalidates the old one. Each site account is independent.

Does the API support streaming responses?

No, the API does not support streaming, WebSocket, or real-time partial audio. You send a POST request and receive the complete audio file in the response. Requests are processed sequentially, so longer texts may queue under load before returning the final file.

Can I use the OpenAI SDK for Python?

Yes, the official OpenAI SDKs work perfectly. Change the base_url to https://api.32wi.info/v1 and use your site-specific key. The request shape matches the OpenAI speech endpoint exactly, allowing you to use standard Python libraries without writing custom HTTP clients.

What is the maximum input length?

Each request accepts up to 4096 characters of text. For longer texts, split your input into parts of this size and join the resulting audio files. Spaces and punctuation count toward the character limit, which affects billing at $0.01 per 1,000 characters.

How do I handle rate limit errors?

The limit is 60 requests per minute per key (10 before the first top-up). If you exceed this, requests may queue or fail. Implement exponential backoff in your code to retry failed requests. Failed requests are free, so you do not lose credits.

Is there a webhook for completion?

No, there is no webhook for completion. The API returns the audio file directly in the HTTP response. You must wait for the response to complete before processing the audio. There are no background notifications for request status or completion events.

Can I send multiple voices in one request?

No, each request supports only one voice preset. You must make separate requests for different voices or concatenate audio files in your application logic. The eight available voices are aria, nova, luna, sage, felix, milo, atlas, and orion.

Does the API support async processing?

No, the API does not support async processing. Requests are processed one after another in a queue. Under load, a request may wait before synthesis begins. You receive the final audio file only after the entire process completes.

How do I check my usage stats?

Visit the /get-api-key/ page to view your balance, trial status, characters left, and usage history. The dashboard shows detailed statistics for your account. You can also monitor request metadata like time and status kept for billing purposes.

Can I use the API in a browser?

Yes, you can call the API directly from a browser using JavaScript or plain HTTP. Ensure you protect your API key if exposing it client-side. The endpoint accepts standard JSON bodies and returns audio files, making it suitable for web apps.

Is the API key secure?

The API key authenticates your requests via the Authorization header. One active key exists per account, and you can issue a new key anytime to invalidate the old one instantly. This ensures quick revocation if the key is compromised.

What happens if I exceed the limit?

If you exceed 60 requests per minute, requests may queue or return an error. Failed requests are free, so your balance is not affected. You can wait for the rate limit window to reset.

Can I mix languages in one request?

No, each request handles one language specified by the voice or language field. You can set the language explicitly using an ISO code. If not set, it guesses from the script, defaulting to English for Latin text. Split texts for different languages.

Do I need to install additional libraries?

No, you do not need additional libraries beyond the standard OpenAI SDK or plain HTTP client. The API uses standard JSON requests and returns audio files. You can use any language that supports HTTP requests without installing proprietary SDKs or plugins.

First request

curl

curl https://api.32wi.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.32wi.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.32wi.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 Setup

Sound wave illustration for: Authentication Setup

Access the /get-api-key/ page on 32wi.info to create your account via Google or email. The dashboard displays your unique API key, current balance, and a ready-to-use curl example for immediate testing.

Use the key in the Authorization header as a Bearer token. Each account maintains one active key; generating a new one immediately invalidates the previous key, ensuring clear access control without complex credential management.

Generate API key from dashboard

Generate API key from dashboard

Sign up on the /get-api-key/ page using Google or email/password. The interface shows your key, balance, trial status, and usage stats instantly.

  • Google or email sign-up
  • One active key per account
  • Dashboard shows key and balance

Bearer token format

Bearer token format

Include the header: Authorization: Bearer tts-... . The key identifies your account for billing and rate limiting.

Key rotation process

Issue a new key from the dashboard at any time. The old key stops working immediately, so update your integration promptly to avoid service interruption.

First Request with Curl

Sound wave illustration for: First Request with Curl

Send a POST request to https://api.32wi.info/v1/audio/speech with your Bearer token. This endpoint returns the generated audio file directly.

The request body must be valid JSON containing the model, input text, and voice selection.

Basic curl command example

Use curl to test your key immediately. Replace YOUR_API_KEY with your actual key from the dashboard.

  • curl -X POST https://api.32wi.info/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Hello world", "voice": "nova"}'

JSON body structure

Include the model (tts-1 or tts-1-hd), input (up to 4096 characters), and voice (e.g., aria, nova).

Add response_format for output type and speed for playback rate. The language field is optional but recommended for non-English text.

Response handling

On success, the API returns the audio binary data directly in the response body.

Save this output to a file matching your chosen format, such as .mp3 or .wav. Failed requests return an error JSON and are free.

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

The official OpenAI SDKs work seamlessly with our API by simply adjusting the base URL. This allows you to reuse existing client code without rewriting your integration logic. You only need to point the client to our endpoint instead of OpenAI’s servers.

This approach minimizes setup time for indie developers who already use these libraries. It ensures compatibility with standard request shapes while keeping your codebase clean and maintainable.

Changing base_url parameter

Update your SDK client configuration to use https://api.32wi.info/v1 as the base URL. This directs all API calls to our infrastructure while preserving the standard request structure.

Ensure your API key is correctly passed in the Authorization header. The SDK will handle the rest of the communication protocol automatically.

  • Set base_url to https://api.32wi.info/v1
  • Keep standard OpenAI SDK methods intact

Using official SDKs

Any official OpenAI SDK (Python, Node.js, etc.) works without modification to the request body. You send text and receive audio files using the same parameter structure.

This compatibility means you can switch providers or test alternatives without significant refactoring. Your existing logic for handling responses remains valid.

Client configuration

Configure the client with your API key and the new base URL. Initialize the client instance before making any speech requests.

Example setup includes setting the model to tts-1 or tts-1-hd and specifying the desired voice. No additional SDK-specific packages are required.

Available Voices

Sound wave illustration for: Available Voices

The API provides eight preset voices, all capable of speaking any of the 23 supported languages. Each voice is derived from licensed recordings in the LibriTTS-R dataset (CC BY 4.0) or public-domain readings from LibriVox. Every generated audio file includes an inaudible watermark identifying it as synthetic speech.

You can choose from four female and four male presets, ranging from warm narrators to deep documentary styles. All voices support the same language set, though English is the default for Latin-script text unless you specify another language.

8 preset voices listed

Select one of the eight available presets for your synthesis requests.

Female voices: aria, nova, luna, sage.

Male voices: felix, milo, atlas, orion.

Gender and tone descriptions

Each voice offers a distinct tonal character suitable for different content types.

Aria provides a warm, clear narration. Nova is bright and upbeat. Luna offers a soft, storytelling tone. Sage delivers calm, instructional clarity. Felix is energetic, ideal for promos. Milo is friendly and conversational. Atlas remains neutral for news. Orion provides a deep, documentary style.

Voice selection parameters

Pass the voice name as a string in the voice field of your JSON request body. The API does not require SSML or phoneme dictionaries for basic selection.

All voices support all 23 languages. If you do not set the language parameter, the system guesses it from the script, defaulting to English for Latin text. For non-English Latin text, explicitly set the language code.

Supported Formats

Sound wave illustration for: Supported Formats

The API returns audio in five standard formats: MP3, WAV, OPUS, FLAC, and PCM. Select the format that best matches your project’s playback requirements and bandwidth constraints. Each format offers a different balance between file size, quality, and compatibility.

All formats are supported by the official OpenAI SDKs and standard HTTP clients. You specify your preference using the response_format parameter in the request body. The choice affects the resulting file size but not the generation quality or speed.

MP3, WAV, OPUS, FLAC, PCM

MP3 provides universal compatibility with smaller file sizes. WAV and FLAC offer lossless quality, ideal for archival or high-fidelity needs. OPUS delivers efficient compression for web streaming. PCM provides raw, uncompressed audio data for maximum compatibility with specialized hardware or processing pipelines.

  • MP3: Universal compatibility, small size
  • WAV: Lossless, standard quality
  • OPUS: Efficient web compression
  • FLAC: Lossless, archival quality
  • PCM: Raw, uncompressed data

Choosing the right format

Select MP3 for general web use where bandwidth matters. Choose WAV or FLAC if you need perfect audio fidelity for professional applications. Use OPUS for efficient streaming in web apps. Pick PCM if your downstream processing requires raw audio data without any compression overhead.

  • Use MP3 for web apps
  • Choose WAV/FLAC for high fidelity
  • Select OPUS for efficient streaming
  • Pick PCM for raw data needs

File size implications

MP3 and OPUS produce significantly smaller files than WAV or FLAC. This reduces storage costs and bandwidth usage for end-users. PCM files are the largest, as they contain raw audio data. Consider your user base’s network conditions when selecting the format.

Larger files take longer to download but offer better quality. Smaller files load faster but may sacrifice audio fidelity. Balance file size with your quality requirements. Test different formats with your specific use case to find the optimal balance.

  • MP3: Smallest size, good quality
  • OPUS: Small size, efficient
  • WAV: Large size, lossless
  • FLAC: Large size, lossless
  • PCM: Largest size, raw data
Supported Formats

Rate Limits

Sound wave illustration for: Rate Limits

The API enforces a hard limit of 60 requests per minute per key. Since requests are processed sequentially, under load your synthesis may queue, causing latency. This is standard for our infrastructure; longer texts generate in roughly real time, but short phrases may take a few seconds.

Before your first top-up, the limit is stricter: 10 requests per minute. Once you add credit via USDT on the TRON network, the full 60 requests per minute quota applies. This ensures fair usage while keeping costs predictable for indie projects.

60 requests per minute limit

Each API key allows up to 60 synthesis requests every 60 seconds. If you exceed this, subsequent requests will wait in a queue until capacity frees up. This sequential processing means concurrent requests may experience slight delays during peak times.

  • Limit is per key, not per account.
  • Failed requests are not charged.
  • No burst allowance; steady state applies.

10 requests before first top-up

New accounts start with a lower quota of 10 requests per minute. This prevents abuse before payment is verified. Once you top up with at least $5 in USDT on the TRON network, your quota increases to the full 60 requests per minute.

  • Applies until first successful top-up.
  • Credit is automatic within minutes.
  • Minimum top-up is $5.

Handling queue delays

If your request waits in the queue, simply retry after a few seconds. Failed requests are free, so a timeout does not cost credit. For long texts, split input into 4096-character chunks to reduce individual request size and improve throughput.

  • Retry after 2-5 seconds.
  • Split text into 4096-char parts.
  • Check status code for failures.

Error Handling

Sound wave illustration for: Error Handling

When requests fail, you are not charged. Failed requests are free, so you can retry without worrying about costs. However, understanding why a request fails helps you debug quickly and keep your workflow smooth.

This guide covers common HTTP errors, how to handle rate limits gracefully, and steps to troubleshoot issues before contacting support.

Common error codes

HTTP 400 Bad Request: Check your JSON body for invalid fields, missing input, or unsupported parameters. Ensure your text is under 4096 characters.

HTTP 401 Unauthorized: Your API key is missing, expired, or incorrect. Verify the Authorization: Bearer header format.

HTTP 429 Too Many Requests: You have exceeded the rate limit. See the Rate Limits section for details.

  • 400: Invalid JSON or missing required fields
  • 401: Invalid or missing API key
  • 429: Rate limit exceeded

Retry logic recommendations

Implement exponential backoff for 429 errors. Start with a short delay (e.g., 1 second) and double it for each retry.

Retry up to 3 times for transient errors like 500 or 503. Avoid infinite loops.

Since requests are processed sequentially, queue delays may occur. Do not assume immediate failure on high load.

Debugging failed requests

Check the response body for detailed error messages from the API.

Verify your text length does not exceed 4096 characters per request.

Ensure your API key is active and has sufficient balance.

  • Check JSON structure
  • Verify text length
  • Check API key status
  • Review response body for details

Endpoint Reference

Sound wave illustration for: Endpoint Reference

Refer to the specific endpoint definitions below for integration details. All requests require the Bearer token in the Authorization header.

Use GET /v1/voices to list available audio presets and GET /v1/models to verify supported engine versions before sending synthesis requests.

POST /v1/audio/speech

Send a JSON body with the text, voice, and format. The endpoint returns the audio file directly or an error object if synthesis fails. Text is limited to 4096 characters per request.

  • model: "tts-1" or "tts-1-hd"
  • input: string (max 4096 chars)
  • voice: one of 8 presets
  • response_format: mp3, wav, opus, flac, pcm

GET /v1/voices

Returns a list of available voices, their associated languages, and supported output formats. Use this to dynamically populate your UI dropdowns without hardcoding voice names.

  • Voice ID
  • Available Languages
  • Supported Formats

GET /v1/models

Lists the current model versions available for synthesis. This helps ensure your client is compatible with the latest engine updates without manual version checks.

  • Model ID
  • Engine Type

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Since there are no monthly subscriptions or seats, your billing is purely transactional.

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. OpenAI API reference: create speech
  3. ISO 639 language codes
  4. LibriTTS-R corpus (OpenSLR 141)
  5. openai-python on GitHub
  6. Node.js documentation
  7. MDN: Web Speech API
  8. FFmpeg documentation
  9. IETF RFC 7845: Ogg Opus
  10. TRON developer hub: TRC-20
  11. curl documentation
  12. Tether (USDT)

More on this site