Documentation for the Indie Text-to-Speech API

By Narrative Lab editorial team · Updated 2026-11-18

This documentation provides a complete reference for the Narrative Lab text-to-speech API, designed specifically for indie developers and accessibility creators. You will find clear instructions for integrating our engine into games, assistive tools, and digital scripts without complex dependencies. The guide covers authentication, request structures, and response handling to help you generate speech.

We focus on reliability and simplicity, offering eight licensable voices and support for 23 languages. Whether you are building a dyslexia-friendly reader or an interactive narrative, you can start immediately with a free trial or scale using simple top-ups. All examples use standard HTTP and the OpenAI SDK, ensuring you can adapt our API to your existing workflow with minimal friction.

Documentation for the Indie Text-to-Speech API

Frequently asked questions

How do I get an API key?

Sign up on the /get-api-key/ page using Google or an email and password. Your account page displays your active API key, balance, and usage statistics. Each account holds one active key; issuing a new one immediately invalidates the previous one.

Is the API compatible with the OpenAI SDK?

Yes. The endpoint matches the OpenAI speech request shape. You can use official OpenAI SDKs by changing the base_url to https://api.pp999play.com/v1 and providing your site-specific API key in the Authorization header.

What is the base URL for the API?

The API base URL is https://api.pp999play.com/v1. You send POST requests to https://api.pp999play.com/v1/audio/speech. Other endpoints like /v1/voices and /v1/models are also available at this base path.

How do I specify a voice in the request?

Include the voice parameter in your JSON body with one of eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. You can view all available voices and their details via the GET /v1/voices endpoint.

Can I change the speed of the speech?

Yes. Include a speed parameter in your request body with a value between 0.25 and 4.0. This allows you to adjust the playback rate of the generated audio to fit your specific content pacing needs.

What happens if I exceed the rate limit?

The limit is 60 requests per minute per key (10 per minute before the first top-up). Exceeding this may cause requests to wait in a queue or fail. Failed requests are free, so you are not charged for them.

Do I need to install a specific SDK?

No. There is no official SDK for this API. You can use the OpenAI SDK by adjusting the base URL, or simply use plain HTTP requests. Any standard HTTP client library works for sending requests and receiving audio.

How long does a request take to process?

Typical speed is roughly real time, about 25 characters of text per second of generation. Short phrases take a few seconds. Under load, requests are processed sequentially and may wait in a queue before synthesis begins.

What formats are supported for output?

You can specify the response_format as mp3, wav, opus, flac, or pcm in your request body. The API returns the audio file directly in the response according to the format you selected during the synthesis request.

How do I handle errors in the response?

If synthesis fails, the request returns an error status and no charge is applied. You should check the HTTP status code and response body for details. Failed requests are free, so you can retry without cost.

Can I use the API for long texts?

Yes, but each request supports up to 4096 characters. For longer texts, split your input into parts of this size, generate audio for each, and join the resulting audio files. This ensures reliable processing for all content lengths.

How do I rotate my API key?

You can issue a new API key at any time from your account page. When a new key is generated, the old one stops working immediately. This allows you to securely rotate credentials without service interruption.

Is the API documentation open source?

The provided documentation is specific to Narrative Lab and hosted at /docs/. It is not stated to be open source. You can access the full quickstart and endpoint details directly on this page for integration guidance.

Do I need to handle audio decoding myself?

No. The API returns the audio file directly in the response body. You receive the raw audio data in your chosen format (mp3, wav, etc.), which you can save directly to a file.

First request

curl

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

Narrative Lab provides a single active API key per account, issued via the /get-api-key/ dashboard. This key authenticates all requests to the API base URL.

Obtain Your API Key

Obtain Your API Key

Create an account on the /get-api-key/ page using Google or email. Your unique key appears immediately in the dashboard, alongside your balance and usage statistics.

Bearer Token Usage

Bearer Token Usage

Include your key in the HTTP header as Authorization: Bearer tts-... for every request. This standard method ensures secure access to the speech endpoint.

Key Rotation

Issue a new key via the dashboard at any time. The previous key stops working immediately, ensuring no concurrent usage from unsecured devices.

Quickstart with cURL

Sound wave illustration for: Quickstart with cURL

Send a simple POST request to the speech endpoint with your key and text. The API returns a single audio file, ready for integration into your game or accessibility tool without complex setup.

Basic Request Example

Use the following cURL command to generate speech. Replace YOUR_API_KEY with your key from /get-api-key/.

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

Sending Text Input

The input field accepts plain text up to 4096 characters. Spaces and punctuation count toward the limit. For longer scripts, split the text into chunks and join the resulting audio files later.

Receiving Audio File

The response is the raw audio file directly, saved here as output.mp3. No parsing is required. Supported formats include mp3, wav, opus, flac, and pcm via the response_format parameter.

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

Leverage the official OpenAI SDKs by simply redirecting the base URL to our API endpoint. This allows indie developers to use familiar client libraries without rewriting integration logic, ensuring compatibility with existing codebases built for standard speech endpoints.

Set Base URL

Configure the SDK client to point to https://api.pp999play.com/v1. This single change directs all standard speech requests to our infrastructure while maintaining the exact request shape of the OpenAI API.

Import Standard SDK

Import the standard OpenAI Python or Node.js library as usual. No custom wrappers or proprietary drivers are required, allowing you to stick with the well-documented, stable SDKs you already trust.

Call Speech Endpoint

Invoke the audio.speech.create method using your API key. Pass your text, selected voice, and desired format. The SDK handles the JSON serialization and returns the audio binary directly to your application.

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts two model identifiers, "tts-1" and "tts-1-hd", which utilize the identical underlying engine and pricing structure. Both support the same eight voice presets and language options, allowing you to switch between them without altering your request logic or voice configuration.

Model Selection

Choose "tts-1" for standard generation or "tts-1-hd" for slightly higher fidelity audio. Since the engine is identical, your character consumption remains consistent regardless of the model chosen, simplifying cost predictions for your indie game or accessibility tool.

Voice Presets

Select from eight licensed presets tailored for narrative clarity. Options include "aria" for warm narration, "atlas" for neutral news delivery, or "orion" for deep documentary tones. Each voice supports all 23 supported languages, ensuring consistent character across your project.

  • Female: aria, nova, luna, sage
  • Male: felix, milo, atlas, orion

Speed Control

Adjust playback speed between 0.25x and 4.0x using the speed parameter. This allows you to optimize audio duration for UI feedback loops or slow down narration for users with cognitive disabilities, ensuring the speech remains intelligible and natural.

Response Formats

Sound wave illustration for: Response Formats

The API returns audio files in standard formats, allowing indie developers to integrate speech directly into games or accessibility tools without conversion overhead. Choose the format that best fits your application’s performance and storage requirements.

MP3 Output

MP3 is the default and most efficient format for web delivery and mobile apps. It offers a good balance between file size and quality, making it ideal for storing generated audio in your project assets.

  • Default response format
  • Small file size
  • Universal compatibility

WAV and FLAC Options

Select WAV for uncompressed, lossless audio perfect for high-fidelity game soundtracks or professional editing workflows. FLAC provides lossless compression, reducing storage needs while preserving exact audio quality for archival purposes.

  • WAV: Uncompressed, high quality
  • FLAC: Lossless compression
  • Ideal for editing

PCM Raw Audio

PCM returns raw 16-bit signed integer samples. Use this format if you need precise control over audio processing, such as applying custom filters or mixing with other sound effects in your engine.

  • Raw 16-bit data
  • No header overhead
  • Custom processing ready
Response Formats

Rate Limits and Quotas

Sound wave illustration for: Rate Limits and Quotas

Understanding rate limits ensures your game or accessibility tool runs smoothly without unexpected interruptions. The API enforces a standard limit of 60 requests per minute per API key, allowing for steady audio generation during development and deployment.

60 Requests per Minute

Each account is allocated a maximum of 60 requests per minute. This limit applies to all endpoints and ensures fair usage across the network. Exceeding this threshold may cause requests to wait in a queue or fail.

  • Limit: 60 requests/minute per key.
  • Applies to all API calls.
  • Reset occurs every 60 seconds.

Initial Limit for New Keys

When you first create an API key, the limit is reduced to 10 requests per minute. This lower threshold helps prevent spam during initial testing. Once you perform your first top-up, the limit increases to the standard 60 requests per minute.

  • New keys: 10 requests/minute.
  • Top-up required to increase limit.
  • Limit increases automatically after payment.

Handling Queues

Requests are processed sequentially. If you send multiple requests in quick succession, they may wait in a queue. Longer texts take more time to generate, so consider splitting large inputs to avoid delays. Use exponential backoff in your integration to handle temporary rate limit errors gracefully.

  • Requests are processed in order.
  • Longer texts may take longer.
  • Use backoff for retries.

Error Handling

Sound wave illustration for: Error Handling

The API returns standard HTTP status codes to indicate request outcomes. Understanding these codes helps you implement robust retry logic and handle edge cases in your game or accessibility tool workflows.

Common Error Codes

Use 400 for invalid parameters, 401 for authentication failures, 429 for rate limits, and 500 for server errors.

Failed Request Refunds

If synthesis fails, the charge is returned in full. You are only billed for successful audio generation.

Debugging Tips

Check your API key format and ensure the text input does not exceed 4096 characters. Verify the voice ID exists in the /v1/voices endpoint.

  • Verify input text length
  • Check voice ID validity
  • Confirm authentication header format

Advanced Usage

Sound wave illustration for: Advanced Usage

For scripts exceeding 4096 characters, split the input text into chunks of that size before sending individual requests. This ensures each synthesis completes successfully within the API's constraints without truncation or silent failures.

Long Text Splitting

Divide your script into segments no longer than 4096 characters. Each segment triggers a separate synthesis job, allowing you to manage memory and request limits effectively during batch generation for longer game dialogues or audiobooks.

Language Specification

Set the language field with an ISO code to ensure accurate pronunciation, especially for Latin-script text that isn't English. While the API guesses language from the script, explicit specification prevents misinterpretation for non-English content.

  • Supported: Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Turkish.
  • Omit for English Latin text; set explicitly for other supported languages.

Audio Joining

After receiving the audio files for each chunk, concatenate them in order to reconstruct the full narrative. Since requests process sequentially, ensure your integration handles the output streams reliably before final assembly.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. This reliability is critical for assistive tools where predictability matters more than novelty.

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. OpenAI API reference: create speech
  3. Tether (USDT)
  4. MDN: Web Speech API
  5. openai-python on GitHub
  6. LibriVox public-domain audiobooks
  7. LibriTTS-R paper (arXiv 2305.18802)
  8. IETF RFC 7845: Ogg Opus
  9. W3C WAI: making audio and video accessible
  10. ISO 639 language codes
  11. TRON developer hub: TRC-20
  12. curl documentation

More on this site