TTS API Documentation for IoT Developers Using OpenAI SDK

By PPT Gaming Voices editorial team · Updated 2026-11-19

This guide helps indie developers integrate PPT Gaming Voices into smart home interfaces and IoT projects. You will learn to generate synthetic audio using the standard OpenAI SDK, adjusting only the base URL to point to our API. We cover authentication, request parameters, and response handling so you can focus on defining your device’s personality.

We provide concrete examples for cURL and Python, explaining how to handle the 4096-character limit by splitting texts and joining audio files. You will also see how to manage rate limits and select from eight curated voices that speak 23 languages. This documentation assumes you are building voice-enabled hardware or software that requires reliable, character-counted TTS synthesis.

TTS API Documentation for IoT Developers Using OpenAI SDK

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 this site. The dashboard displays your active API key, current balance, and usage statistics immediately after registration, allowing you to start generating audio right away.

What is the base URL for the OpenAI SDK?

Configure your OpenAI SDK client to use https://api.pptgaming.info/v1 as the base URL. This endpoint mirrors the OpenAI speech structure, ensuring compatibility. You must also set your Authorization header with your Bearer token to authenticate your requests successfully.

Can I use the official OpenAI SDKs?

Yes, the official OpenAI SDKs work perfectly. You only need to change the base URL to https://api.pptgaming.info/v1 and provide your PPT Gaming Voices key. This allows you to use familiar code structures without learning a new library or integration method.

What fields are required in the request body?

Your JSON body must include 'model' (tts-1 or tts-1-hd), 'input' (your text), and 'voice' (one of eight presets). While 'response_format' and 'speed' are optional, they allow customization. The 'language' field is also optional but recommended for non-English Latin text.

How do I specify the Spanish language?

Include the 'language' field set to 'es' in your request JSON. Although the API guesses language from script, setting this explicitly ensures accurate synthesis. Any voice can speak any of our 23 supported languages, including Spanish, without additional configuration.

What audio formats are supported?

We support mp3, wav, opus, flac, and pcm formats. Specify your preferred format using the 'response_format' field in your request. These options allow you to choose between compressed files for bandwidth efficiency or lossless formats for high-quality IoT playback.

What happens if I exceed the rate limit?

You are limited to 60 requests per minute per key. If you exceed this, requests may queue or fail. New accounts start with 10 requests per minute until you top up. Failed requests are free, but they still consume your request quota.

How do I handle long texts in IoT apps?

Split your text into chunks of up to 4096 characters. Send each chunk as a separate request and join the resulting audio files in your application. This ensures compliance with the single-request character limit while delivering complete audio content to your device.

Is the response format JSON or binary?

The response contains the binary audio file directly, not JSON. You receive the audio data in the format you requested (e.g., mp3 or wav). Your IoT device should handle this binary stream or save it directly to a file for playback.

Can I change my API key?

Yes, you can issue a new API key at any time from your dashboard. When you generate a new key, the old one stops working immediately. This ensures security if your key is compromised or if you want to rotate credentials regularly.

What is the maximum text length?

Each request supports up to 4096 characters. Spaces and punctuation count toward this limit. For longer content, split your text into multiple requests and concatenate the audio outputs in your application logic to create a continuous listening experience for your users.

Do I need to install a specific SDK?

No, you do not need a specific SDK. You can use the official OpenAI SDK by changing the base URL, or use plain HTTP requests. We do not provide our own official SDK. This flexibility allows you to integrate the TTS API into your existing IoT infrastructure without extra dependencies.

How do I detect errors in the response?

Check the HTTP status code and the response body for error details. If synthesis fails, you receive no charge. Monitor your dashboard for usage statistics and status logs to track successful generations and identify any issues with your requests or account balance.

Is the API synchronous or asynchronous?

The API is synchronous. You send a request and wait for the audio file to be generated and returned. Processing happens sequentially, so under load, requests may queue. Expect roughly real-time generation speed, with short phrases taking a few seconds.

First request

curl

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

Sound wave illustration for: Authentication

Access the PPT Gaming Voices API by generating a key on the /get-api-key/ dashboard. Each account holds one active key; issuing a new one immediately invalidates the old one. This ensures secure, single-point access for your IoT development workflows.

API Key Setup

API Key Setup

Sign up via Google or email to receive your key. Use this key to authenticate all requests. Note that failed synthesis requests are free, but successful ones consume your balance at $0.01 per 1,000 characters.

  • Keys are issued per site account.
  • New keys instantly revoke old ones.
  • Start with a $0.50 free trial (7 days) when signing in with Google.

Bearer Token Header

Bearer Token Header

Include your key in the Authorization header for every request. The format is Bearer tts-your_key_here. This standard header works with the OpenAI SDK by pointing base_url to https://api.pptgaming.info/v1.

  • Format: Authorization: Bearer tts-...
  • Works with official OpenAI SDKs.
  • No additional authentication layers required.

Endpoints

Sound wave illustration for: Endpoints

Interact with the TTS engine through two primary endpoints. The speech generation endpoint accepts your text and configuration to produce audio, while the voices endpoint provides a static list of available presets and formats.

Speech Generation

Send a POST request to /v1/audio/speech with a JSON body containing the text, voice model, and output format. The API processes the request and returns the audio file directly in the response.

  • Endpoint: POST https://api.pptgaming.info/v1/audio/speech
  • Accepts JSON body with model, input, voice, and response_format

List Voices

Retrieve the complete catalog of available voices, supported languages, and audio formats. This endpoint helps you select the right preset for your smart home interface before generating audio.

  • Endpoint: GET https://api.pptgaming.info/v1/voices
  • Returns available voices, languages, formats, and pricing details

Request Parameters

Sound wave illustration for: Request Parameters

Configure the synthesis engine and select the specific voice characteristics that best fit your smart home device's personality. Precise parameter tuning ensures the audio output aligns with your IoT project's tone, whether it requires a calm instructional guide or an energetic notification sound.

The API supports two model variants with identical pricing, allowing you to choose based on your quality preferences without worrying about variable costs. Each request processes up to 4096 characters, ensuring consistent output for standard voice prompts and short commands.

Model Selection

You can choose between tts-1 for standard quality or tts-1-hd for higher fidelity. Both models use the same underlying engine and incur the same rate of $0.01 per 1,000 characters, giving you flexibility to experiment with audio clarity for different device types without unexpected cost changes.

Selecting tts-1-hd may offer slightly richer audio detail, which can be beneficial for longer informational prompts in smart home dashboards. The choice does not affect the character limit or the processing speed, which remains roughly real-time.

  • tts-1: Standard quality, same price as HD.
  • tts-1-hd: Higher fidelity audio, same price.
  • Both models support all 8 voices and 23 languages.

Voice and Language

Choose from 8 distinct voice presets, ranging from aria (warm narrator) to atlas (neutral news). Each voice is designed to convey a specific personality trait, helping you define your device's character. For example, nova offers a bright, upbeat tone suitable for friendly reminders, while sage provides a calm, instructional voice for step-by-step guides.

You can optionally specify a language using an ISO code (e.g., en, de, ja). If omitted, the system guesses the language from the text script, defaulting to English for Latin script. Explicitly setting the language ensures accurate pronunciation, especially for mixed-language content or non-English Latin text.

  • 8 presets: aria, nova, luna, sage, felix, milo, atlas, orion.
  • Supports 23 languages including English, German, Japanese, and Hindi.
  • Set language parameter for precise control; otherwise, it is auto-detected.

image]:

Response Formats

Sound wave illustration for: Response Formats

Upon successful synthesis, the API returns the audio file directly in the response body, matching the response_format you specified (mp3, wav, opus, flac, or pcm). This immediate binary payload allows your IoT device or backend service to cache the audio locally. Note that the API does not support streaming audio as it is generated; the full file is returned upon completion.

Audio Output

The response contains the raw audio data, enabling seamless integration into your smart home workflows. Audio is returned after synthesis completes. Short phrases typically take a few seconds to generate, while longer texts take roughly real-time (about 25 characters per second). Requests are processed sequentially, so latency may increase under load.

  • Supported formats: mp3, wav, opus, flac, pcm
  • Audio is returned directly in the response body
  • Inaudible synthetic watermark embedded in all files

Error Handling

If synthesis fails, the API returns a standard error JSON object without charging your balance. You can rely on HTTP status codes and error messages to retry failed requests safely, knowing that no characters were consumed during the failure state.

  • Failed requests are free and fully refunded
  • Standard JSON error response format
  • No character deduction on synthesis failure

Rate Limits

Sound wave illustration for: Rate Limits

The API enforces a strict rate limit of 60 requests per minute per API key. For new accounts before the first top-up, this limit is reduced to 10 requests per minute. This constraint ensures stable generation performance for your IoT devices and smart home interfaces.

Requests Per Minute

Each active API key is allowed a maximum of 60 requests within any 60-second window. If you exceed this threshold, subsequent requests will receive a 429 Too Many Requests error. Remember that failed requests do not count against your character balance, but they do consume request quota.

Queue Behavior

Requests are processed sequentially in a single-threaded queue. This means that under load, your synthesis requests may wait in line before processing begins. Longer texts or high-definition models may hold the queue, potentially increasing latency for subsequent requests. Plan your device's request timing accordingly to avoid timeouts.

Rate Limits

SDK Integration

Sound wave illustration for: SDK Integration

SDK integration is straightforward because the API mirrors the OpenAI speech endpoint structure. You can use the official OpenAI SDKs by simply redirecting the base_url to https://api.pptgaming.info/v1 and providing your Bearer token. This allows you to leverage familiar libraries without learning a new client package.

OpenAI SDK Usage

The OpenAI Python SDK handles the request shape perfectly. Initialize the client with your key and the custom base URL, then call audio.speech.create() with your text, model, and voice parameters. This approach works for both tts-1 and tts-1-hd models, keeping your code clean and standard.

  • Use standard OpenAI SDKs (Python, Node.js, etc.)
  • Pass model, input, voice, and response_format
  • No custom client library required

Base URL Change

To route requests to PPT Gaming Voices, set the base_url parameter in your SDK client to https://api.pptgaming.info/v1. Ensure your Authorization header includes the Bearer tts-... key. This single configuration change directs all speech synthesis calls to our infrastructure while maintaining the standard request format.

Text Splitting

Sound wave illustration for: Text Splitting

When generating audio for smart home interfaces, input text is limited to 4,096 characters per request. If your script or notification exceeds this length, you must split the text into smaller chunks before sending them to the API.

4096 Character Limit

Each POST call accepts a maximum of 4,096 characters for the input field. Spaces and punctuation count toward this limit. Ensure your application logic handles this boundary to avoid truncation or errors during synthesis.

Joining Audio Files

After splitting your text, send each segment as a separate request. Receive the individual audio files, then concatenate them in your IoT device or backend service to create a single, continuous audio stream for playback.

  • Split text into ≤4,096 character segments
  • Send each segment via POST /v1/audio/speech
  • Concatenate returned audio files sequentially to create a single audio file for playback.

Examples

Sound wave illustration for: Examples

Use these examples to integrate PPT Gaming Voices into your smart home interface. The cURL command demonstrates a basic request, while the Python script shows how to handle audio files in code.

cURL Command

Send a POST request to generate speech. Replace YOUR_API_KEY with your token from /get-api-key/.

  • POST https://api.pptgaming.info/v1/audio/speech
  • Body: {"model": "tts-1", "voice": "nova", "input": "Welcome to the smart home.", "response_format": "mp3"}

Python Script

Use the OpenAI SDK with the custom base URL. Download the audio file locally for playback on your IoT device.

  • import openai
  • client = openai.OpenAI(base_url='https://api.pptgaming.info/v1', api_key='YOUR_API_KEY')
  • response = client.audio.speech.create(model='tts-1', voice='nova', input='Hello, welcome home.')
  • response.stream_to_file('output.mp3')

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Even with noise-canceling features, the voice itself should remain distinct.

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. curl documentation
  3. Creative Commons Attribution 4.0
  4. LibriTTS-R corpus (OpenSLR 141)
  5. Python documentation
  6. ISO 639 language codes
  7. TRON developer hub: TRC-20
  8. LibriVox public-domain audiobooks
  9. OpenAI API reference: create speech
  10. LibriTTS-R paper (arXiv 2305.18802)
  11. Tether (USDT)
  12. MDN: Web Speech API

More on this site