API Documentation: Generate Audio from Text

By Vozaria editorial team · Updated 2026-11-18

This documentation helps language educators and podcasters integrate our text-to-speech API into their content workflows without technical guesswork. You will find clear instructions on generating audio files, selecting from eight distinct voice presets, and managing your API key. We cover everything from basic authentication to handling rate limits, ensuring you can start sending text and receiving audio quickly.

The guide is designed for content creators who value simplicity and transparency. We explain how to configure the OpenAI SDK for our endpoint, choose the right audio format, and understand our character-based pricing. Every step is grounded in the actual capabilities of the Vozaria platform, so you know exactly what to expect when generating speech for your audience.

API Documentation: Generate Audio from Text

Frequently asked questions

How do I get my API key?

Sign up on our /get-api-key/ page using Google or an email and password. Once registered, your dashboard displays your unique API key, current balance, and usage statistics. You can issue a new key at any time, which immediately invalidates the previous one.

What is the maximum length of input text?

Each API request supports a maximum of 4096 characters for the input text field. This limit applies to every individual POST request you send to the speech endpoint. If your content exceeds this, you must split it into smaller chunks before sending.

Can I stream the audio response?

No, streaming is not supported. The API returns the complete audio file in the response body after generation finishes. You cannot receive partial audio chunks in real-time. You must wait for the full synthesis to complete before receiving the data.

How do I set the speed of the voice?

Include a speed parameter in your JSON request body, with values ranging from 0.25 to 4.0. This adjusts the playback speed of the generated voice. The default speed is 1.0. Adjust this value to make the speech faster or slower as needed.

Is SSML supported in the request?

No, SSML is not supported. The API accepts plain text input only. You cannot use SSML tags to control pronunciation, pauses, or emphasis. If you need specific timing or pronunciation, you must manage those aspects in your text or post-processing.

What happens if I exceed the rate limit?

The standard limit is 60 requests per minute per key. If you exceed this, requests may queue or fail. Before your first top-up, the limit is stricter at 10 requests per minute. Failed requests do not incur charges, but successful ones do.

Can I use the API in a browser-based app?

Yes, you can use the API in a browser-based app by sending HTTP requests directly. Since it follows the OpenAI endpoint shape, you can use standard fetch or the OpenAI SDK by adjusting the base URL. Ensure you protect your API key in client-side apps.

How do I handle long texts over 4096 characters?

Split your long text into parts, each containing up to 4096 characters. Send each part as a separate POST request to the API. Then, join the resulting audio files together in your application to create a single continuous audio track for your users.

Does the API support background generation?

The API is synchronous; it returns the audio file once generation is complete. It does not support background job queues or webhooks for completion. Requests are processed sequentially, so under load, your request may wait in a queue before generating audio.

What is the latency for generating audio?

Typical speed is roughly real-time, averaging about 25 characters of text per second of generation. Short phrases may take a few seconds. Under heavy load, requests may queue, increasing latency. Long texts will take longer proportional to their character count.

Can I change the voice after the request is sent?

No, the voice is determined at the time of the request. You specify the voice parameter (e.g., aria, nova) in the JSON body. Once the request is processed, the audio is generated using that specific voice preset. You cannot change it retroactively.

Is the API available in all regions?

The API is a cloud service accessible globally via HTTP. All 23 supported languages are available regardless of your geographic region.

How do I test the API without spending money?

Sign up with Google to receive a free trial credit of $0.50, valid for 7 days. This allows about 50,000 characters of generation. If you create an account with email and password, you start without this trial credit. Failed requests are also free.

What is the difference between tts-1 and tts-1-hd?

Both models use the same engine and have the same price. The tts-1-hd model uses the same engine as tts-1. There is no difference in cost or character limits. Choose tts-1-hd if you prefer the higher quality output.

First request

curl

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

Sound wave illustration for: Authentication

Secure your audio generation by authenticating every request with a Bearer token. This single API key validates your identity and tracks your character usage against your balance.

Bearer Token Usage

Bearer Token Usage

Include your key in the HTTP header as Authorization: Bearer tts-.... The API rejects requests without this header or with an invalid token.

Generating Your Key

Generating Your Key

Keys are created when you sign up via /get-api-key/. You can issue a new key at any time; the previous one stops immediately.

Key Security

Keep your key private. Each account holds one active key. Rotate it freely if compromised, as the old key becomes invalid instantly.

Speech Generation Endpoint

Sound wave illustration for: Speech Generation Endpoint

Generate speech by sending a POST request to https://api.playba6.com/v1/audio/speech. The API returns the audio file directly in the response body.

POST /v1/audio/speech

Send your text payload to this endpoint. The service processes requests sequentially, so longer texts may queue briefly. You receive a single audio file containing the synthesized speech.

JSON Body Structure

The request body is a standard JSON object. It includes the model choice, the text input, the desired voice, and optional parameters for format and speed. The official OpenAI SDKs work seamlessly by pointing to this base URL.

Required Fields

You must provide the model ("tts-1" or "tts-1-hd"), the input text (max 4096 characters), and the voice preset. These three fields are essential for the synthesis engine to generate your audio file.

Available Voices

Sound wave illustration for: Available Voices

Our eight presets cover the full spectrum of educational and podcasting needs, from clear narration to engaging storytelling. Each voice is based on licensed recordings from LibriTTS-R and public-domain audiobooks, ensuring high quality without complex training.

You can switch between voices instantly to match the tone of your lesson or episode. All voices support any of our 23 languages, making them versatile tools for language educators and global content creators.

Female Voices: Aria, Nova, Luna, Sage

Aria provides a warm, clear narrator style ideal for instructional content. Nova offers a bright, upbeat tone perfect for energetic segments. Luna delivers a soft, storytelling voice for immersive narratives. Sage is calm and instructional, great for detailed explanations.

These voices are designed to remain engaging over long texts, helping listeners retain information without fatigue. They handle complex sentence structures naturally, which is crucial for language learning materials.

  • Aria: warm, clear narrator
  • Nova: bright, upbeat
  • Luna: soft, storytelling
  • Sage: calm, instructional

Male Voices: Felix, Milo, Atlas, Orion

Felix is energetic and promo-ready, suitable for quick updates or ads. Milo is friendly and conversational, mimicking natural speech patterns. Atlas provides a neutral, news-like delivery for factual content. Orion offers a deep, documentary-style voice for serious topics.

Each male voice is tuned for clarity and distinct character, allowing you to create diverse audio experiences from a single API key. They integrate seamlessly with the same 23-language support as the female voices.

  • Felix: energetic, promo
  • Milo: friendly, conversational
  • Atlas: neutral, news
  • Orion: deep, documentary

Voice Selection Guide

Choose based on your content’s emotional tone and target audience. For language learners, clear enunciation (Aria, Atlas) reduces cognitive load. For podcasts, variety (Nova, Milo) keeps listeners engaged.

Remember that any voice can speak any of the 23 supported languages. Use the language parameter to guide the model for non-English Latin scripts, ensuring accurate pronunciation regardless of the voice chosen.

  • Match tone to content type
  • Use language parameter for non-English Latin text
  • All voices support all 23 languages
  • No cloning required for variety

Supported Formats

Sound wave illustration for: Supported Formats

Selecting the right audio format ensures your content plays smoothly across different platforms and devices. Our API supports five distinct output formats, allowing you to optimize file size, quality, or compatibility based on your specific project needs.

MP3 Output

MP3 is the standard choice for web playback and podcast distribution. It offers excellent compression with minimal loss of quality, making it ideal for embedding audio players or sharing files via email.

  • Best for web players and social media
  • Small file sizes for faster loading
  • Widely supported by all devices

WAV Output

WAV provides uncompressed, high-fidelity audio. Use this format when you need the highest quality for professional editing or archival purposes, accepting larger file sizes as a trade-off for pristine sound.

  • Lossless, uncompressed audio quality
  • Ideal for post-production editing
  • Larger file sizes than MP3

OPUS, FLAC, PCM Options

OPUS offers superior compression for voice applications. FLAC provides lossless compression for storage efficiency without quality loss, but it is not used for streaming. PCM is raw, uncompressed audio data, suitable for direct processing pipelines.

  • OPUS: Great for streaming and voice
  • FLAC: Lossless compression, smaller than WAV
  • PCM: Raw audio data for processing

Language Support

Sound wave illustration for: Language Support

Vozaria supports 23 languages, enabling educators and podcasters to reach diverse audiences without managing multiple voice engines. From Arabic to Turkish, each language is fully supported by all eight voice presets, ensuring consistent quality across your content.

23 Supported Languages

Our platform covers Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, and Turkish. Any voice can speak any of these languages fluently.

Auto-Detection Logic

If you do not specify a language, the API guesses it from the text script. Latin script text defaults to English. This works well for standard English content but may misinterpret other Latin-script languages.

Set the language parameter explicitly for non-English Latin text to ensure accurate pronunciation and intonation.

Explicit Language Setting

For languages like French, German, or Japanese, always include the ISO language code in your request. This prevents auto-detection errors and ensures the correct accent is applied by the chosen voice.

Unsupported languages include Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, and Bengali. If your content uses these, consider pre-translating to a supported language.

  • Set language for non-English Latin text
  • Use ISO codes for precise control
  • Check supported list before generating
Language Support

Rate Limits

Sound wave illustration for: Rate Limits

Understanding rate limits ensures your TTS workflows run smoothly without unexpected interruptions. Our system processes requests sequentially, meaning longer texts may queue briefly during high traffic. Knowing these boundaries helps you plan batch exports for podcasts or language lessons efficiently.

Rate limits apply per API key, so managing your single active key is straightforward. If you exceed the limit, simple retries handle most transient issues without impacting your billing.

60 Requests per Minute

After your initial period, you can send up to 60 requests per minute. This capacity is sufficient for most content creation workflows, including generating multiple voiceovers for a single episode or creating practice materials for language learners.

Requests are processed sequentially. For long texts split into 4096-character parts, each part counts as one request. Plan your splitting logic to stay within this steady flow.

  • Limit: 60 requests/minute per key
  • Processing: Sequential, one after another
  • Impact: Short phrases may take a few seconds; long texts queue under load

Initial Limit for New Keys

New API keys start with a lower limit of 10 requests per minute. This helps maintain stability for new accounts before they establish usage patterns. You can continue generating audio within this lower threshold immediately after key creation.

This limit applies regardless of your balance. Even if you have sufficient credits, the initial rate remains capped until you add funds.

  • Initial rate: 10 requests/minute
  • Applies to new keys only
  • Unlocks after first top-up

Handling Rate Limits

If you receive a 429 Too Many Requests error, wait briefly before retrying. Implement exponential backoff in your scripts to avoid overwhelming the API during peak times. Since failed requests are free, retrying does not incur extra costs.

For consistent workflows, consider spacing out your requests manually. This ensures predictable generation times for your audio files without hitting the queue delays associated with higher volume bursts.

  • Error code: 429
  • Action: Wait and retry
  • Cost: Retries are free if they fail

Error Handling

Sound wave illustration for: Error Handling

Errors are handled with clear HTTP status codes. If synthesis fails, you receive a JSON error response explaining the issue. Importantly, failed requests are completely free, so you are never charged for audio that was not successfully generated.

Common Error Codes

Use standard HTTP codes to diagnose issues. A 400 error indicates invalid JSON or missing fields. A 401 error means your Bearer token is incorrect or expired. A 429 error signals you have exceeded the 60 requests per minute limit.

  • 400: Bad Request (invalid format or missing input)
  • 401: Unauthorized (invalid or expired API key)
  • 429: Too Many Requests (rate limit exceeded)
  • 500: Internal Server Error (try again later; failed requests are free)

Failed Request Refunds

If the API cannot generate audio due to a server error or invalid input, the request is free. No charge is applied to your balance. You can retry the same text without worrying about wasted credits.

  • Server errors trigger a full refund automatically.
  • Invalid JSON structures incur no charge.
  • Balance updates reflect only successful generations.

Debugging Tips

Check your character count first. The input must be under 4096 characters. Verify your voice ID matches one of the eight presets. Ensure your base URL is set correctly to https://api.playba6.com/v1.

  • Validate character length before sending.
  • Confirm voice IDs are from the supported list.
  • Check rate limits if requests queue up.

SDK Integration

Sound wave illustration for: SDK Integration

Vozaria’s API mirrors the OpenAI speech endpoint structure, allowing you to use the official OpenAI SDK with minimal changes. This compatibility means you can leverage existing client libraries by updating the base URL.

OpenAI SDK Compatibility

The request shape matches the OpenAI audio/speech endpoint exactly. You can use the standard OpenAI SDKs for Python, Node.js, or Go by simply updating the base URL and providing your API key.

Base URL Configuration

Point your SDK client to https://api.playba6.com/v1 instead of the default OpenAI endpoint. Ensure your Authorization header includes your tts-... bearer token. All other parameters like model, voice, and input remain identical.

Code Examples

Here is a quick Python snippet using the OpenAI library:

```python import openai client = openai.OpenAI(base_url="https://api.playba6.com/v1", api_key="tts-your-key") response = client.audio.speech.create( model="tts-1", voice="nova", input="Hello, this is a test." ) with open("output.mp3", "wb") as f: f.write(response.content) ```

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. We evaluate providers based on three core pillars that directly impact your content workflow and budget.

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. Tether (USDT)
  4. LibriTTS-R paper (arXiv 2305.18802)
  5. curl documentation
  6. openai-node on GitHub
  7. MDN: Web Speech API
  8. Creative Commons Attribution 4.0
  9. LibriVox public-domain audiobooks
  10. IETF RFC 7845: Ogg Opus
  11. LibriTTS-R corpus (OpenSLR 141)
  12. OpenAI API reference: create speech

More on this site