Cloud Text-to-Speech API: Generate Audio with 8 Voices

By IoT Voice Lab editorial team · Updated 2026-11-18

Welcome to the IoT Voice Lab documentation. This guide helps smart home creators and IoT developers integrate reliable text-to-speech into their devices and workflows. We simplify the switch from legacy services like Amazon Polly to a modern, cost-effective API that fits your budget. You will find concrete examples, clear pricing, and step-by-step instructions to generate audio files programmatically.

Here, you will learn how to generate speech using our 8 preset voices across 23 languages. We cover everything from getting your API key to making your first cURL request or using the OpenAI SDK. Whether you are building a voice assistant or an automated notification system, this page provides the specific technical details you need to get started quickly and efficiently.

Cloud Text-to-Speech API: Generate Audio with 8 Voices

Frequently asked questions

How do I get an API key?

Sign up on our /get-api-key/ page using Google or an email and password. Your account is specific to playa111.com. Once registered, you receive a unique Bearer key starting with 'tts-'. This key authenticates your requests to the API endpoint.

Can I use the OpenAI SDK with this API?

Yes. Our API uses the same request shape as the OpenAI speech endpoint. You can use official OpenAI SDKs by simply changing the base_url to https://api.playa111.com/v1 and providing your site-specific key. No custom SDK installation is required.

What is the base URL for the API?

The base URL is https://api.playa111.com/v1. You will use this URL for all API interactions, including sending speech synthesis requests and retrieving available voices. Ensure your SDK or HTTP client points to this exact address for proper routing.

What audio formats are supported?

We support mp3, wav, opus, flac, and pcm formats. You can specify your preferred format in the response_format field of your request. This allows you to choose the best balance between file size and quality for your IoT device.

How many characters can I send per request?

Each request supports up to 4096 characters of input text. Spaces and punctuation count toward this limit. For longer texts, you must split the content into chunks of 4096 characters or less and process them individually.

What are the rate limits?

You are limited to 60 requests per minute per key. New accounts without a top-up start with a lower limit of 10 requests per minute. If you exceed this, requests may queue or fail until the window resets.

How do I handle errors?

If synthesis fails, the charge is returned in full. You can monitor request status and character usage in your account dashboard. Failed requests do not consume your credit, ensuring you only pay for successfully generated audio files.

Can I change the speech speed?

Yes, you can adjust the speed between 0.25 and 4.0. This allows you to slow down narration for clarity or speed up updates for efficiency. The speed parameter is part of the standard request body sent to the API.

Is SSML supported?

No, SSML is not supported. We provide eight voice presets without custom pronunciation lexicons or phoneme dictionaries. If you need precise control over pauses or emphasis, you must manage that logic in your application before sending the text.

Can I stream audio?

No, we do not offer streaming or WebSocket support. Audio is returned as a complete file in the response. For real-time playback, your application must download the full file first. This fits well with batch processing workflows.

How do I split long texts?

Split your text into parts of up to 4096 characters. Send each part as a separate request to the API. Then, join the resulting audio files in your application. This ensures each chunk is processed within the character limit.

Do I need to install a specific SDK?

No specific SDK is required. You can use any HTTP client or the official OpenAI SDK by adjusting the base URL. We do not provide a proprietary SDK, so standard HTTP requests work perfectly for integrating with your smart home devices.

Is there a Python SDK?

A: Yes, you can use the official OpenAI Python SDK. Simply configure it to point to https://api.playa111.com/v1. This allows you to leverage existing Python libraries for IoT development without needing to write custom HTTP parsing logic from scratch.

How do I regenerate my API key?

You can issue a new key at any time from your account dashboard. When you generate a new key, the old one stops working immediately. This ensures secure access control for your IoT projects without needing to wait for expiration.

First request

curl

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

IoT Voice Lab provides a straightforward path to cloud text-to-speech for your smart home projects. Start by creating an account on our platform to access the API infrastructure required for generating audio files from text inputs.

Sign Up

Visit the /get-api-key/ page to create your account. You can register using your Google account for immediate access or use a standard email and password combination. Google sign-ups include a $0.50 free trial credit valid for 7 days, while email accounts start with zero balance.

Generate Key

Once registered, your dashboard displays your unique API key starting with tts-. This single key authenticates all your requests to the https://api.playa111.com/v1 endpoint. You can generate a new key at any time; the previous key stops working immediately.

Key Management

Your dashboard also shows your current balance, trial status, and character usage. Since we use USDT (TRC-20) for top-ups, your balance does not expire. Keep your key secure, as it is the only credential needed to generate audio files.

  • One active key per account
  • New keys deactivate old ones instantly
  • Balance never expires
  • View usage in real-time

Make Your First Request

Sound wave illustration for: Make Your First Request

To generate speech, send a POST request to the API endpoint with your audio parameters. The service processes standard JSON payloads, accepting up to 4,096 characters per request. You must include your API key in the Authorization header to authenticate the call.

cURL Example

Use this command to generate audio immediately. Replace YOUR_API_KEY with your key from the dashboard and adjust the voice or text as needed.

JSON Body

The request body requires three fields: model, input, and voice. Supported models are tts-1 and tts-1-hd, both using the same engine. Text is limited to 4,096 characters; longer inputs must be split by your application.

  • model: "tts-1" or "tts-1-hd"
  • input: Your text string (max 4096 chars)
  • voice: One of 8 presets (e.g., "aria", "nova")
  • response_format: mp3, wav, opus, flac, or pcm
  • speed: 0.25 to 4.0 (optional)
  • language: ISO code (optional)

Response Format

A successful request returns an HTTP 200 status with the audio file in the body. If synthesis fails, you receive an error JSON object, and the request is free. Failed requests do not charge your balance.

Make Your First Request

Use the OpenAI SDK

Sound wave illustration for: Use the OpenAI SDK

The OpenAI SDK is the recommended way to integrate our API because we use the exact same request shape. You only need to change the base URL to https://api.playa111.com/v1 and provide your Bearer token. This allows you to use familiar code structures without learning a new client library.

This compatibility means your existing IoT scripts or smart home automation flows can switch from legacy services like Amazon Polly with minimal code changes. The official OpenAI SDKs work seamlessly, letting you focus on voice selection rather than HTTP boilerplate.

Base URL Change

Point your SDK client to https://api.playa111.com/v1 instead of the default OpenAI endpoint. This single configuration change routes all requests to our infrastructure while maintaining the standard JSON body format.

SDK Compatibility

We support the official OpenAI Python and JavaScript SDKs. Since our endpoint mimics the speech creation endpoint, you can use the same methods like client.audio.speech.create() without modification to the payload structure.

Code Example

```python import os from openai import OpenAI client = OpenAI( base_url="https://api.playa111.com/v1", api_key=os.getenv("TTS_API_KEY") ) speech = client.audio.speech.create( model="tts-1", voice="aria", input="Hello from IoT Voice Lab" ) speech.stream_to_file("output.mp3") ```

This snippet demonstrates a simple call using the tts-1 model with the aria voice. Ensure your TTS_API_KEY environment variable contains your generated key. The library handles the file writing automatically.

  • Uses standard audio.speech.create method
  • Supports both tts-1 and tts-1-hd models
  • No custom library installation required
  • Works with Python and JavaScript SDKs

Supported Audio Formats

Sound wave illustration for: Supported Audio Formats

Choose the audio format that best fits your smart home device’s playback capabilities. Our API supports five standard formats, ensuring compatibility with everything from basic IoT speakers to high-fidelity audio systems. Each format balances file size, quality, and processing overhead differently.

Selecting the right format helps optimize bandwidth and storage for your devices. Whether you need efficient compression or lossless quality for archival, our API handles the conversion seamlessly. All generated files include an inaudible synthetic watermark for identification.

MP3

MP3 is the most widely supported format across IoT hardware and smart speakers. It offers a good balance between file size and audio quality, making it ideal for devices with limited storage or bandwidth.

Use MP3 for general voice announcements, notifications, and daily updates. It ensures broad compatibility with most existing audio players in your smart home ecosystem.

  • Ideal for standard IoT speakers and mobile apps
  • Small file size reduces bandwidth usage
  • Broad hardware compatibility

WAV

WAV provides uncompressed, high-quality audio. It is perfect for devices that prioritize sound fidelity over storage space.

Use WAV for critical alerts or high-priority notifications where audio clarity is essential. It ensures the voice is heard clearly without compression artifacts.

  • Uncompressed, lossless quality
  • Higher bandwidth usage
  • Best for high-fidelity speakers

OPUS

OPUS offers excellent compression with high audio quality, making it suitable for playback over variable network conditions.

Use OPUS for devices with limited bandwidth or when streaming audio over less stable connections. It maintains clarity while minimizing data usage.

  • High efficiency for streaming
  • Good for low-bandwidth IoT devices
  • Maintains quality at low bitrates

FLAC

FLAC provides lossless compression, preserving the original audio quality while reducing file size compared to WAV.

Use FLAC for archival purposes or when you need high-quality audio without the large size of WAV. It is ideal for devices with ample storage.

Note: FLAC is not supported for real-time streaming on all hardware, so test compatibility with your specific devices.

  • Lossless compression
  • Smaller than WAV, larger than MP3
  • Suitable for archival storage

PCM

PCM is the raw, uncompressed audio format. It provides the purest audio data with no processing overhead.

Use PCM for devices that handle their own compression or require raw audio data for further processing. It is ideal for development and testing.

PCM files are larger and require more bandwidth, so use them only when necessary for your specific hardware requirements.

  • Raw, uncompressed audio
  • Largest file size
  • Ideal for development and testing

Voice Selection and Languages

Sound wave illustration for: Voice Selection and Languages

Choosing the right voice ensures your smart home devices sound natural and fit the context. Our API provides eight distinct presets, ranging from warm narrators to energetic promo voices, all capable of speaking any of our supported languages.

Whether you are building a news ticker or a bedtime story app, you can select from aria, nova, luna, sage, felix, milo, atlas, or orion. Each voice is designed for clarity and consistency across different device types.

8 Preset Voices

Select from eight licensed voices based on real recordings. Female voices include aria (warm narrator), nova (upbeat), luna (soft storytelling), and sage (calm instruction). Male options include felix (energetic), milo (friendly), atlas (neutral news), and orion (deep documentary).

All voices support the full range of 23 languages, allowing you to maintain a consistent character voice across different regions or content types without needing separate voice models.

  • 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

23 Languages

Our API supports 23 languages, including English, Spanish, German, French, Japanese, Korean, Chinese, Arabic, Hindi, and Russian. Any voice can speak any of these languages, giving you flexibility in device localization.

Supported languages include: Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, and Turkish. Languages like Vietnamese, Thai, and Ukrainian are not supported.

  • Arabic
  • Chinese
  • Danish
  • Dutch
  • English
  • Finnish

Auto-Detection

If you do not specify a language, the API guesses it from the script. Latin script defaults to English, so set the language parameter for non-English Latin text like Spanish or German.

This auto-detection simplifies integration for no-code users who want quick results without managing complex language codes for every request.

Voice Selection and Languages

Rate Limits and Quotas

Sound wave illustration for: Rate Limits and Quotas

Every API key allows up to 60 requests per minute. This limit applies to your account, so plan your batch jobs accordingly.

60 Requests Per Minute

You can send 60 requests per minute. Each request counts toward this limit. If you need more, consider splitting large texts into smaller chunks.

  • Limit: 60 requests/minute per key
  • Applies to all requests
  • Resets every 60 seconds

Pre-Payment Limit

Before your first top-up, you can make 10 requests per minute. This helps you test the API without spending credits.

  • Initial limit: 10 requests/minute
  • Applies to new accounts
  • Increases after top-up

Queue Behavior

Requests are processed one after another. Under load, a request may wait in a queue. This ensures fair access for all users.

  • Sequential processing
  • Queuing under load
  • No priority tiers

Error Handling

Sound wave illustration for: Error Handling

When synthesis fails, the API returns a clear error message and the request remains free. You are not charged for failed attempts, so you can safely retry or adjust parameters without worrying about wasted credits. This ensures your IoT devices or smart home automations don’t fail silently due to minor input issues.

Understanding the specific error helps you fix the request quickly. Most failures are due to invalid characters, unsupported languages, or exceeding the 4096-character limit per request. Check your input text and ensure the voice and format are correctly specified before retrying.

Common Errors

The most frequent errors involve input validation. If your text exceeds 4096 characters, the API rejects the request. Similarly, using a voice with an incompatible language setting may cause a failure. Always verify the language parameter matches the text script, especially for non-English Latin text.

  • Input too long (>4096 chars)
  • Invalid voice ID
  • Unsupported language code
  • Missing required fields

Status Codes

The API uses standard HTTP status codes. A 400 Bad Request indicates invalid input, such as wrong character limits or missing fields. A 401 Unauthorized means your API key is invalid. A 429 Too Many Requests signals you’ve hit the rate limit of 60 requests per minute.

  • 400: Bad Request
  • 401: Unauthorized
  • 429: Rate Limit Exceeded
  • 500: Internal Server Error

Retry Logic

Implement exponential backoff for retries. Wait briefly after a 429 error before retrying. For 500 errors, retry once after a short delay. Since failed requests are free, you can afford to retry more aggressively without cost penalties. Ensure your IoT device handles transient errors gracefully by logging the error and retrying later.

  • Wait 1-2 seconds for 429
  • Retry once for 500
  • Log errors for debugging
  • No cost for failed retries
Error Handling

Advanced Settings

Sound wave illustration for: Advanced Settings

Fine-tune audio generation with speed control and handle text length constraints. The API accepts speeds from 0.25x to 4.0x, allowing you to slow down narration for clarity or accelerate prompts for quick alerts. Input text is limited to 4,096 characters per request, ensuring consistent processing times.

Speed Control

Adjust the speed parameter to match your device's audio output needs. Slower speeds improve comprehension for complex instructions, while higher speeds suit brief status updates. Values outside the 0.25–4.0 range will return an error.

Input Length

Each request supports up to 4,096 characters, including spaces and punctuation. This limit balances processing speed and cost. If your text exceeds this, split it manually before sending to avoid truncation or errors.

Text Splitting

For longer documents, split text into chunks of 4,096 characters. Generate each chunk individually and join the resulting audio files. This method maintains audio quality and allows for parallel processing under load, though requests are queued sequentially during high traffic.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Your devices connect seamlessly to create a simple, intelligent living space without any coding knowledge.

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. TRON developer hub: TRC-20
  4. LibriTTS-R paper (arXiv 2305.18802)
  5. FFmpeg documentation
  6. Python documentation
  7. ISO 639 language codes
  8. curl documentation
  9. W3C WAI: making audio and video accessible
  10. Tether (USDT)
  11. openai-python on GitHub
  12. MDN: Web Speech API

More on this site