Text to Voice API Documentation for Developers

By ReadAloud editorial team · Updated 2026-11-18

This documentation helps indie developers building accessible reading tools for users with dyslexia and visual impairments integrate the ReadAloud API into their web and mobile apps. You will find clear examples for authentication, generating speech from text, and handling errors. Everything is designed to fit seamlessly into your existing workflow without requiring complex infrastructure.

We provide a reliable, affordable TTS engine that respects user data. The API accepts standard JSON bodies and works with official OpenAI SDKs by simply changing the base URL. Start with a free trial, manage your keys via the dashboard, and generate audio files (short phrases take a few seconds; longer texts take roughly real time).

Text to Voice API Documentation for Developers

Frequently asked questions

Which SDKs are compatible with this API?

The API accepts standard HTTP requests and works with any SDK that can send JSON POST requests. Since the request shape matches the OpenAI speech endpoint, the official OpenAI SDKs are fully compatible by simply updating the base URL configuration.

Can I use the official OpenAI SDK?

Yes, the official OpenAI SDKs work perfectly. You only need to change the base URL to https://api.play59c.com/v1 and use your ReadAloud API key. The request structure for generating audio is identical to the OpenAI speech endpoint.

How do I set the base URL correctly?

Set your base URL to https://api.play59c.com/v1. This ensures your requests reach the correct endpoint for audio synthesis. All standard OpenAI SDKs will route their requests to this address when configured, allowing seamless integration with your existing code.

What is the default audio format?

The API does not enforce a single default format in the documentation, but mp3 is commonly used. You can specify your preferred format in the request body using the response_format field, choosing from mp3, wav, opus, flac, or pcm.

Can I change the voice mid-stream?

No, you cannot change the voice mid-stream because the API does not support streaming. Each request generates a complete audio file from start to finish. To use a different voice, you must send a separate API request.

Is streaming supported for partial audio?

No, streaming is not supported. The API returns the complete audio file once synthesis finishes. There is no WebSocket endpoint or real-time partial audio delivery. You receive the full file via the standard HTTP response after processing.

What happens if I exceed the rate limit?

You are limited to 60 requests per minute per key. If you exceed this, subsequent requests may queue or fail. New accounts start with a 10 requests per minute limit until the first top-up is processed and credited to your account.

Are failed requests counted against the limit?

Failed requests are free. They count toward your rate limit. The limit applies to the number of requests sent, regardless of whether synthesis succeeds or fails.

Can I use multiple API keys at once?

Yes, you can use multiple API keys simultaneously. Each key has its own rate limit of 60 requests per minute. This allows you to distribute load across keys, though each account is issued one active key at a time.

How do I revoke an old API key?

To revoke an old key, issue a new API key from your account dashboard. The new key becomes active immediately, and the old key stops working at once. You can generate a new key anytime through the /get-api-key/ page.

Is there a WebSocket endpoint available?

No, there is no WebSocket endpoint. The API uses standard HTTP POST requests for audio generation. You send text and receive a complete audio file response. There is no real-time streaming or partial audio delivery available via WebSocket.

Do I need to send the language code?

It is optional but recommended for non-English Latin-script text. If omitted, the system guesses the language, defaulting to English for Latin script. For accurate synthesis in languages like Greek, Hebrew, or Hindi, explicitly set the language ISO code.

What happens if the text is too long?

Each request supports up to 4096 characters. If your text exceeds this, split it into parts and send multiple requests. You can then join the resulting audio files to create a complete long-form audio track for your users.

Can I mix different voices in one file?

No, each API request generates audio with a single voice. To mix voices, you must send separate requests for each segment using different voice presets. You will then need to combine the resulting audio files in your own application.

First request

curl

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

Authentication and API keys

Sound wave illustration for: Authentication and API keys

Access your unique API key from the dashboard at /get-api-key/. It is the only active credential for your account, allowing seamless integration into your accessibility tools. You can view your key alongside your current balance and usage statistics in one place.

Use the key to authenticate every request by including it in the Authorization header. This simple step ensures that your text-to-speech requests are securely processed and billed correctly against your account.

Get your API key from dashboard

Get your API key from dashboard

Sign in via Google or email to retrieve your key instantly. The dashboard displays your key, balance, and trial status clearly, so you can start testing immediately without waiting for approval or setup.

  • Available on /get-api-key/ after login
  • Visible alongside balance and usage stats

Bearer token in Authorization header

Bearer token in Authorization header

Include your key as a Bearer token in every POST request. For example: Authorization: Bearer tts-.... This standard method works with any HTTP client or SDK, making integration straightforward for indie developers building reading aids.

  • Format: Bearer tts-...
  • Required for all API calls

Revoke and issue new keys instantly

If you suspect a leak or just want a fresh start, generate a new key from the dashboard. The old key stops working immediately, ensuring your audio generation remains secure without downtime or complex verification steps.

  • One active key per account
  • Old keys stop immediately

First request with cURL

Sound wave illustration for: First request with cURL

Send a POST request to the speech endpoint with your text payload. The API returns the audio file directly in the response body, allowing you to save it or play it in your app.

Basic JSON body structure

Construct a JSON object containing the text input and voice selection. You can specify the response format and speed, but the core structure remains simple and consistent with standard TTS integrations.

  • Use POST https://api.play59c.com/v1/audio/speech
  • Include model, input, and voice fields
  • Add optional response_format and speed parameters

Required model and voice fields

The model field accepts either "tts-1" or "tts-1-hd", both using the same engine and pricing. You must also select one of the eight available voices, such as "aria" for a warm narrator or "milo" for a friendly tone.

  • model: "tts-1" or "tts-1-hd"
  • voice: e.g., "aria", "nova", "milo"

Sending text and receiving audio

Pass your text string in the input field, ensuring it stays within the 4096 character limit. The API processes the request and returns the audio file, which you can then store or play in your application.

  • Limit input text to 4096 characters
  • Receive audio directly in the response
  • Support for mp3, wav, opus, flac, pcm

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

Leverage your existing OpenAI SDK knowledge to integrate ReadAloud API with minimal friction. By simply updating the configuration, you can route requests to our engine while maintaining the familiar developer experience you already know.

Set base_url to our endpoint

Update your SDK configuration to point to our API base URL: https://api.play59c.com/v1. This single change directs all subsequent requests to our infrastructure without altering your code structure.

Same request shape as OpenAI

The request body uses the identical JSON structure as the OpenAI speech endpoint. You send a POST request with model, input, voice, and optional response_format fields, receiving an audio file directly in response.

Official SDK compatibility

Since the request shape matches exactly, the official OpenAI SDKs work seamlessly. You do not need a custom client or wrapper; just swap the base URL and use your ReadAloud API key for authentication.

Supported audio formats

Sound wave illustration for: Supported audio formats

ReadAloud API supports MP3, WAV, FLAC, and Opus formats to suit different app requirements. MP3 is the default choice for web and mobile applications due to its broad compatibility and efficient file size. WAV provides uncompressed audio for scenarios where maximum fidelity is required, such as professional narration tools.

MP3 for web and mobile

Use mp3 as your response_format for optimal balance between quality and bandwidth. This format works seamlessly with standard HTML5 audio players and mobile native libraries, making it ideal for accessibility apps reading text to users with visual impairments.

WAV for high quality needs

Select wav when you need lossless audio without compression artifacts. This format is suitable for archival purposes or when downstream processing requires raw PCM data, though it results in larger file sizes compared to MP3 or Opus.

FLAC and Opus for compression

FLAC offers lossless compression for smaller file sizes while retaining all audio data. Opus provides efficient compression for bandwidth-constrained environments, which is useful for mobile apps on limited data plans.

Handling voice parameters

Sound wave illustration for: Handling voice parameters

Choose from eight distinct voice presets to match your app’s tone. Female voices like Aria or Nova offer warm narration, while male options like Felix or Atlas provide clear, energetic delivery for different accessibility needs.

Selecting from 8 presets

Assign one of eight voices per request to define the listening experience. Options range from Luna’s soft storytelling to Orion’s deep documentary style, ensuring the audio fits your specific content type.

  • Aria (warm), Nova (bright), Luna (soft), Sage (calm)
  • Felix (energetic), Milo (friendly), Atlas (neutral), Orion (deep)

Adjusting speed from 0.25 to 4.0

Control pacing with the speed parameter, accepting values between 0.25 and 4.0. Slower rates can aid comprehension, while faster speeds help those who prefer quick information processing.

Setting specific language codes

Explicitly set the language using ISO codes to ensure accurate pronunciation. Without this, the API guesses the language, defaulting to English for Latin script, which may cause errors for other languages.

  • Supported: Arabic, Chinese, English, French, German, Spanish, and 18 others
  • Not supported: Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, Bengali
Handling voice parameters

Rate limits and concurrency

Sound wave illustration for: Rate limits and concurrency

Your API key allows 60 requests per minute. This limit applies to the key, not the account, so ensure your integration respects this ceiling to avoid service interruptions during peak usage.

60 requests per minute per key

Each active key is limited to 60 requests per minute. If you generate multiple audio files simultaneously, track your usage to stay within this boundary.

10 requests before first top-up

New accounts without a USDT top-up are restricted to 10 requests per minute. This ensures fair usage during the trial phase before you add funds.

Queue behavior under load

Requests are processed sequentially. Under heavy load, your request may wait in a queue, increasing latency. Long texts take longer to synthesize, so plan your concurrency accordingly.

Error handling and status codes

Sound wave illustration for: Error handling and status codes

The API returns standard HTTP status codes to indicate the result of your synthesis request. A 200 OK response means the audio file was successfully generated and is included in the response body. You can parse these responses directly in your application logic without needing complex parsing logic.

Common error responses

If the request body is malformed or missing required fields like model or voice, you will receive a 400 Bad Request error. A 401 Unauthorized error occurs if your Bearer token is invalid or expired, while a 429 Too Many Requests indicates you have hit your rate limit. Always check the response body for a detailed error message to help debug issues quickly.

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

Handling rate limit errors

You are limited to 60 requests per minute per key, or 10 per minute before your first top-up. If you exceed this limit, the API returns a 429 status code. Implement exponential backoff in your code to retry requests after a short delay, ensuring you do not overwhelm the queue during peak usage.

  • 60 requests per minute after top-up
  • 10 requests per minute initially
  • Retry with exponential backoff

Failed request refunds

If synthesis fails, the charge is returned in full. This ensures you only pay for successful audio generations, making the service reliable for critical accessibility workflows.

Voice and model endpoints

Sound wave illustration for: Voice and model endpoints

These endpoints provide the metadata you need before generating audio. Use them to discover available voices, models, and supported formats programmatically.

The /voices endpoint lists all 8 presets and their capabilities, while /models details the engine specifications. Both endpoints return JSON data.

GET /v1/voices for list

Retrieve the full list of available voices, including their names, genders, and supported languages. This is essential for building UI dropdowns for your accessibility tools.

Each voice preset is clearly labeled, allowing you to map specific tones (like 'calm' or 'energetic') to different content types in your app.

  • Returns voice ID, name, gender, and description
  • Includes supported languages for each voice
  • Returns available response formats per voice

GET /v1/models for details

Fetch details about the available TTS models. Currently, 'tts-1' and 'tts-1-hd' are supported, both using the same engine and price.

Use this endpoint to verify model availability and configuration options before making synthesis requests.

POST /v1/audio/speech for generation

The core endpoint for converting text to audio. Send a JSON body with the text, voice, and format preferences.

Returns the audio file directly in the response, ready for playback or storage in your application.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Make your game accessible for dyslexic players with clear fonts and simple instructions.

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. Node.js documentation
  3. FFmpeg documentation
  4. IETF RFC 7845: Ogg Opus
  5. curl documentation
  6. LibriTTS-R paper (arXiv 2305.18802)
  7. W3C WAI: making audio and video accessible
  8. OpenAI API reference: create speech
  9. LibriTTS-R corpus (OpenSLR 141)
  10. openai-node on GitHub
  11. Creative Commons Attribution 4.0
  12. Python documentation

More on this site