Cloud Text-to-Speech API Reference for Developers

By ReadAloud Dev editorial team · Updated 2026-11-18

Welcome to the API reference for indie developers building accessible medical guides and educational tools. This page documents how to turn text into natural-sounding audio using our cloud TTS API. You will find concrete examples for authentication, request structures, and error handling tailored to integrating speech synthesis into your applications without managing infrastructure.

We cover essential details like rate limits, text length constraints, and supported formats. Whether you are creating patient guides or audiobooks, this documentation helps you generate audio efficiently with just a few lines of code. Use the provided curl examples and SDK instructions to start synthesizing speech immediately.

Cloud Text-to-Speech API Reference for Developers

Frequently asked questions

How do I get an API key?

Sign up on /get-api-key/ using Google or email plus password. Google sign-ins receive a $0.50 trial credit valid for 7 days. Email-based accounts start without trial credit. Your unique API key is displayed on the dashboard alongside your balance and usage statistics.

What is the curl example for?

The curl example demonstrates the standard request structure for the POST /v1/audio/speech endpoint. It shows how to send your text, select a voice, and specify parameters like model and response format. This serves as a quick reference for integrating the API into your application.

How do I use the OpenAI SDK?

Use the official OpenAI SDK by changing the base_url to https://api.play3u3u.com/v1. Pass your API key as the Bearer token. The request shape matches the OpenAI speech endpoint exactly, allowing you to generate audio files with minimal code adjustments in your existing projects.

What formats are supported?

Supported response formats include mp3, wav, opus, flac, and pcm. You specify the desired format in the request body. These options cover most common use cases for medical guides and educational content, ensuring compatibility with various audio players and processing pipelines.

What are common errors?

Common errors include exceeding the 4096 character limit per request or hitting rate limits. Invalid API keys result in authentication errors. Failed synthesis returns a full refund for the characters processed. Check the response status codes for specific details on request failures.

What are the rate limits?

The limit is 60 requests per minute per key. Before your first top-up, the limit is 10 requests per minute. Requests are processed sequentially, so under load, your request may wait in a queue. Monitor your usage to avoid temporary throttling.

What is the text length limit?

Each request supports up to 4096 characters. Spaces and punctuation count toward this limit. For longer texts, split the input into chunks of 4096 characters or less and join the resulting audio files. This ensures consistent synthesis quality and manageable processing times.

How does authentication work?

Authentication uses a Bearer token in the Authorization header. Include your unique API key, prefixed with 'Bearer ', in every request. Each account has one active key at a time. If you issue a new key, the old one stops immediately.

How do I handle failed requests?

Failed requests are free. If synthesis fails, the charge is returned in full. You do not need to manually refund the amount. Simply retry the request or adjust parameters like voice or format. Check the error response for specific failure reasons.

Can I use my own SDK?

We do not provide an official SDK. Use the OpenAI SDK or plain HTTP requests. The API endpoint matches the OpenAI speech format, so any tool supporting that standard works. No custom mobile SDK or WordPress plugin is available.

What is the base_url?

The API base URL is https://api.play3u3u.com/v1. Use this when configuring your HTTP client or SDK. All endpoints, including /v1/audio/speech and /v1/voices, are relative to this base URL. Ensure your requests use HTTPS for secure communication.

How do I split long texts?

Split text into parts of up to 4096 characters. Send each part as a separate POST request to /v1/audio/speech. Receive the individual audio files and join them programmatically. This approach handles longer documents efficiently while staying within character limits.

What happens when I issue a new key?

When you issue a new API key, the old one stops working immediately. Only one key is active per account. This ensures security if a key is compromised. Your balance and usage history remain associated with your account regardless of key changes.

Is there a demo available?

Sign up with Google to receive a $0.50 trial credit, valid for 7 days. This allows you to generate about 50,000 characters of audio. Use this credit to test voices, formats, and speeds directly via the API or dashboard examples.

First request

curl

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

Get Your API Key

Sound wave illustration for: Get Your API Key

Sign up on https://play3u3u.com/get-api-key/ using Google or email to get started. Indie developers can access their API key from the dashboard, where you will also see your balance, character usage, and a ready-to-use curl example.

Sign up on the site

Sign up on the site

Create an account at /get-api-key/ using Google or email plus password. Google sign-ins receive a $0.50 free trial valid for 7 days, giving you about 50,000 characters to test your patient guide audio. Email accounts start without trial credit but offer immediate access to the dashboard.

Access your key from the dashboard

Access your key from the dashboard

Once registered, your dashboard displays your active API key alongside real-time usage metrics. You can view your current balance, remaining characters, and usage. A ready curl example helps you make your first API call.

  • View key and balance simultaneously
  • Check character usage history
  • Copy ready curl examples

One active key per account

Each account maintains a single active API key for all requests. If you need to rotate credentials for security, issuing a new key instantly invalidates the previous one. This ensures you always have clear control over your API access without managing multiple active tokens.

First Request with Curl

Sound wave illustration for: First Request with Curl

Send a simple POST request to generate audio. The API accepts text input and returns an audio file directly in the response body, allowing you to integrate speech synthesis into your medical guides or educational tools with minimal code.

This example demonstrates the most basic usage, covering the required fields and default settings. You can adjust parameters like voice or format in subsequent requests to fit your specific application needs.

Basic curl example provided

Use this command to test the endpoint. Replace YOUR_API_KEY with your key from the dashboard and YOUR_TEXT with your content. The request body is a standard JSON object.

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

JSON body structure explained

The request body requires model, input, voice, and response_format. The model field accepts "tts-1" or "tts-1-hd", both using the same engine. The input field contains your text, up to 4096 characters. The voice field selects from 8 presets like "nova" or "atlas". The response_format specifies the output type, such as "mp3" or "wav".

Response format details

On success, the API returns the audio file directly in the response body with the content type matching your selected format. If the synthesis fails, the request is free, and you receive an error JSON object explaining the issue. Always check the HTTP status code to confirm success.

Using with OpenAI SDK

Sound wave illustration for: Using with OpenAI SDK

The API mirrors the OpenAI speech endpoint, allowing you to reuse official SDKs with a simple configuration change. This compatibility lets indie developers integrate TTS into medical and educational apps without learning a new interface.

Change base_url to our endpoint

Update your SDK configuration to point to https://api.play3u3u.com/v1. This directs all requests to our cloud infrastructure while maintaining standard OpenAI-compatible behavior.

Use official OpenAI SDKs

You can utilize any official OpenAI SDK for your preferred language. The request shape matches exactly, so you only need to adjust the base URL and provide your specific tts-... API key.

Same request shape as OpenAI

Send your text, voice selection, and format preferences using the standard JSON structure. This ensures seamless integration for building accessible patient guides and learning tools without custom parsing logic.

Supported Formats

Sound wave illustration for: Supported Formats

The API supports five audio formats for maximum compatibility: mp3, wav, opus, flac, and pcm. Select the format that best fits your patient guide or educational tool’s delivery requirements.

You specify the desired format using the response_format field in your JSON request body. The system returns the synthesized audio file directly in the HTTP response, ready for immediate playback or storage.

mp3, wav, opus, flac, pcm

Choose from mp3, wav, opus, flac, or pcm based on your application needs. MP3 offers small file sizes for web delivery, while WAV and FLAC provide lossless quality. PCM is ideal for raw audio processing.

  • mp3: compressed, web-friendly
  • wav: uncompressed
  • opus: efficient compression
  • flac: lossless
  • pcm: raw audio data

Choose format in request

Include the response_format parameter in your POST request to /v1/audio/speech. The value must be one of the supported strings: 'mp3', 'wav', 'opus', 'flac', or 'pcm'. Explicit specification is recommended.

Audio file returned in response

Upon successful synthesis, the API returns the audio file directly in the response body. The generated audio is returned in the response and not stored. You can save this file locally or stream it directly to your users for accessible content delivery.

Error Handling

Sound wave illustration for: Error Handling

When building patient guides or educational audio, reliable error handling ensures your workflow stays smooth. Our API returns clear status codes so you can debug synthesis issues quickly without wasting credits or confusing your users.

Common error codes explained

You may encounter standard HTTP errors like 400 (bad request) if the text exceeds 4096 characters or the voice is invalid, or 401 (unauthorized) if the Bearer token is missing or expired. A 429 error indicates you have hit the rate limit (60 requests per minute, or 10 before the first top-up).

  • 400: Invalid input or missing fields.
  • 401: Invalid or missing API key.
  • 429: Rate limit exceeded (60 req/min).

Failed requests are free

If synthesis fails due to a server error or invalid input, the charge is returned in full. You only pay for successfully generated audio files, so you can experiment with different voices and formats for your medical texts without financial risk.

Check response status

Always inspect the HTTP status code and the response body. For 200 OK, you receive the audio file. For errors, the JSON body contains a message describing the issue, helping you adjust your code.

Error Handling

Rate Limits

Sound wave illustration for: Rate Limits

The API enforces a limit of 60 requests per minute per key. This ensures stable performance for indie developers integrating audio generation into patient guides or educational tools without overwhelming the service.

60 requests per minute per key

Each API key allows up to 60 synthesis requests within a one-minute window. This limit applies uniformly across all requests sent with that specific key, helping you manage batch jobs efficiently.

10 per minute before first top-up

New accounts with trial credit are limited to 10 requests per minute. This lower threshold helps manage initial load. Once you top up via USDT (TRC-20), the limit increases to the standard 60 requests per minute.

Queue processing under load

Text Length Limits

Sound wave illustration for: Text Length Limits

The API accepts input text of up to 4,096 characters per request. This limit applies to every individual call, including spaces and punctuation. For patient guides or educational modules exceeding this length, you must split the content into smaller chunks before sending them to the endpoint.

Up to 4096 characters per request

Each TTS request processes a single block of text. If your medical explanation or lesson plan exceeds 4,096 characters, the API will reject the input. Ensure your client-side logic truncates or segments the text accordingly before forming the JSON payload.

Split longer texts into parts

To handle longer documents, divide your source text into segments of 4,096 characters or less. Send each segment as a separate POST request. This approach ensures consistent audio quality and prevents timeout issues during synthesis, keeping your patient guide generation smooth.

Join audio files for long texts

After receiving the audio files for each segment, concatenate them in your application to create a single continuous audio file. This allows you to deliver complete audiobooks or lengthy educational modules without losing context between sections.

Authentication

Sound wave illustration for: Authentication

Secure your API usage with a simple Bearer token strategy. Include your unique key in the Authorization header of every request to authenticate your account and track usage against your balance.

Bearer token in Authorization header

Pass your key as a standard Bearer token. This ensures only authorized requests generate audio files and deduct from your character limit.

Format: Bearer tts-...

The header value must start with Bearer followed by your specific key string. Example: Authorization: Bearer tts-abc123def456.

New key invalidates old key

Your account holds only one active key at a time. Issuing a new key immediately stops the previous one, ensuring tight control over access for your medical text integrations.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Selecting the right voice is the first step in creating patient guides that feel professional and reassuring.

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. Creative Commons Attribution 4.0
  3. MDN: Web Speech API
  4. IETF RFC 7845: Ogg Opus
  5. FFmpeg documentation
  6. openai-node on GitHub
  7. Tether (USDT)
  8. W3C WAI: making audio and video accessible
  9. ISO 639 language codes
  10. openai-python on GitHub
  11. Python documentation
  12. Node.js documentation

More on this site