API Documentation for Text-to-Speech Integration

By VoxFlow editorial team · Updated 2026-11-18

This page shows you how to integrate our text-to-speech API into your indie games and content tools. You will learn the exact request structure, available voices, and pricing details needed to generate natural-sounding audio files for your applications.

We designed the endpoint to match the OpenAI speech API shape, so you can reuse existing SDKs or simple HTTP calls. Whether you are building a mobile app or a web tool, you get clear instructions for authentication, parameters, and error handling to start generating audio quickly.

API Documentation for Text-to-Speech Integration

Frequently asked questions

How do I authenticate with the API?

Send your API key in the Authorization: Bearer tts-... header with every request. You receive one active key per account, which you can view on your dashboard. If you issue a new key, the old one stops immediately.

What is the base URL for the API?

The API base URL is https://api.pgzeed168casino.com/v1. Use this prefix for all endpoints, including the speech generation endpoint at /audio/speech and the voices list at /voices.

Can I use the OpenAI SDK?

Yes. The request shape matches the OpenAI speech endpoint. You can use official OpenAI SDKs by changing the base_url to https://api.pgzeed168casino.com/v1 and providing your VoxFlow API key.

How do I specify the voice?

Include the voice field in your JSON body with one of eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. These voices support all 23 available languages.

What is the maximum text length?

Each request supports up to 4096 characters of text. For longer content, split your text into parts of this size, generate audio for each, and join the resulting files.

How do I handle rate limits?

You are limited to 60 requests per minute per key (10 per minute before your first top-up). Requests are processed one after another, so under load a request may wait in a queue.

What happens on a failed request?

Failed requests are free. If synthesis fails, the charge is returned in full to your account balance, ensuring you only pay for successfully generated audio files.

How do I rotate my API key?

You can issue a new API key at any time from your account dashboard. When the new key is generated, the old one stops working immediately.

Does the API support streaming?

No. The API does not support streaming, WebSocket connections, or real-time partial audio. You receive the complete audio file in the response after processing.

Can I use custom SSML?

No. The API does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. You send plain text, and the engine handles the synthesis based on the specified voice and language.

How do I select a language?

Pass the optional language field with an ISO code. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Set it explicitly for non-English Latin text.

What is the response format?

Specify the response_format field with one of: mp3, wav, opus, flac, or pcm. The API returns the audio file directly in the response body.

Is there a sandbox environment?

No. There is no separate sandbox environment. You use the same production API endpoint with your test key. Your free trial credit allows you to test functionality without extra cost.

How do I get my API key?

Sign up on the /get-api-key/ page using Google or email. Your dashboard displays your active API key, balance, and usage statistics immediately after registration.

First request

curl

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

Access the API using a Bearer token. This key authenticates your requests and tracks usage against your account balance. You can find your unique key on the /get-api-key/ dashboard after signing up.

The token must be sent with every API call to ensure proper identification and billing. Keep this key secure, as anyone with it can use your credits.

Bearer token key

Bearer token key

Generate your key via the dashboard. It starts with 'tts-'. One active key per account ensures clear audit trails for billing and usage monitoring.

The key grants access to all endpoints. If you suspect a leak, you can issue a new key immediately, which invalidates the old one.

  • Starts with 'tts-'
  • One active key per account
  • Issued via /get-api-key/

Authorization header

Authorization header

Include the header in every request: Authorization: Bearer tts-your-key-here. The API uses this to verify permissions and associate charges with your account.

Ensure no extra spaces or line breaks in the header value to avoid 401 Unauthorized errors.

Key rotation policy

You can rotate your key at any time from the dashboard. The old key stops working immediately upon issuing a new one, ensuring no overlap or confusion.

There is no waiting period for rotation. This is useful if you share keys across environments or suspect unauthorized use.

Endpoints

Sound wave illustration for: Endpoints

The API exposes three core endpoints. Use POST /v1/audio/speech to convert text into audio files. Access GET /v1/voices to list available presets, languages, and formats. Use GET /v1/models to verify current model availability.

POST /v1/audio/speech

Send a JSON payload with your text and voice selection. The endpoint returns an audio file in your chosen format. Specify the model, input text, voice, and response format. You can also adjust speed or set a language code.

  • Endpoint: POST https://api.pgzeed168casino.com/v1/audio/speech
  • Body: JSON with model, input, voice, response_format

GET /v1/voices

Retrieve a list of all available voices, supported languages, and audio formats. This helps you configure your integration correctly before sending speech requests. Use this endpoint to discover which voices match your content style.

GET /v1/models

Check the current status of the tts-1 and tts-1-hd models. This ensures your integration uses the correct model identifiers. The models share the same engine and price but offer different quality tiers.

Request Parameters

Sound wave illustration for: Request Parameters

Configure the synthesis request with three core parameters: model, input text, and voice. The API accepts standard JSON bodies, allowing you to specify the audio engine, the content to be spoken, and the persona delivering it.

Selecting the right parameters ensures the output matches your project’s tone and technical constraints, from character limits to voice personality.

Model selection

Choose between "tts-1" and "tts-1-hd". Both use the same engine and price, so pick based on your quality preference without worrying about cost differences.

Input text field

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

If the language field is omitted, the system guesses the language from the script. Latin text defaults to English; set the ISO code explicitly for other languages.

Voice preset selection

Select from eight preset voices, each with a distinct character. Female options include Aria (warm narrator), Nova (upbeat), Luna (storytelling), and Sage (instructional). Male options include Felix (energetic), Milo (conversational), Atlas (news), and Orion (documentary).

All voices support all 23 listed languages, so you can use the same voice preset across different regional projects.

Response Formats

Sound wave illustration for: Response Formats

You choose the output format via the response_format parameter. MP3 is the default and recommended choice for most applications, offering a good balance between file size and quality. It works seamlessly with standard audio players and web browsers.

MP3 output

MP3 is the default and recommended choice for most applications, offering a good balance between file size and quality. It works seamlessly with standard audio players and web browsers.

WAV output

Choose WAV for uncompressed, high-quality audio. This format is ideal if you need to process the audio further without re-encoding artifacts. It results in larger files compared to MP3.

OPUS, FLAC, PCM options

Use OPUS for efficient compression or low-bandwidth scenarios. FLAC provides lossless compression for archival purposes. PCM returns raw, uncompressed audio data, which is useful for specific hardware integrations that require raw byte streams.

Rate Limits

Sound wave illustration for: Rate Limits

VoxFlow enforces a standard rate limit of 60 requests per minute for all active API keys. This limit applies to every key in your account, ensuring fair usage across the network. If you generate short phrases, you can hit this cap quickly, so keep your request sizes reasonable.

60 requests per minute

Once your account is active, you can send up to 60 synthesis requests each minute. This is sufficient for most batch processing tasks, such as generating audio for a short game dialogue tree or a series of app notifications.

10 requests before top-up

New accounts start with a lower limit of 10 requests per minute until you add your first top-up. This allows you to test the API without immediate pressure. After your first USDT transfer, the limit increases to the full 60 requests per minute.

Per-key limit

The rate limit is tied to your API key, not just your account. If you rotate your key, the new key inherits the same limits. Failed requests are free, but the rate limit applies to requests sent.

  • Rate limits reset every 60 seconds.
  • Failed requests are free and do not count against the limit.
  • You can issue a new key anytime, which stops the old one immediately.
Rate Limits

Error Handling

Sound wave illustration for: Error Handling

Errors return standard HTTP codes with a JSON body explaining the issue. Failed synthesis requests are free, ensuring your balance isn't charged for wasted characters.

400 Bad Request

Occurs when input exceeds 4096 characters, uses an invalid voice, or has a malformed JSON body. Check your payload structure and character count before retrying.

401 Unauthorized

Returned if the Authorization: Bearer header is missing or contains an invalid key. Ensure you are using the active key from your dashboard.

429 Too Many Requests

Hits when you exceed 60 requests per minute. New accounts start with a 10 requests per minute limit until the first top-up is processed.

SDK Usage

Sound wave illustration for: SDK Usage

VoxFlow uses the same request shape as OpenAI’s speech endpoint, so you can reuse your existing OpenAI SDKs without rewriting your logic. This compatibility lets indie developers integrate text-to-speech quickly into games and apps with minimal code changes.

To connect, simply change the SDK’s base_url to https://api.pgzeed168casino.com/v1 and provide your VoxFlow API key. This approach works with any language supported by the official OpenAI client libraries, keeping your infrastructure simple and consistent.

OpenAI SDK compatibility

The API mirrors the OpenAI speech structure exactly. This means you can use the official OpenAI SDKs for Python, Node.js, or Go without building a custom client from scratch.

  • Compatible with official OpenAI client libraries
  • Same JSON request structure
  • No custom SDK required

Base URL configuration

Point your SDK’s base URL to https://api.pgzeed168casino.com/v1. Use your unique tts-... bearer token in the Authorization header. This single change routes all requests to our TTS engine.

  • Base URL: https://api.pgzeed168casino.com/v1
  • Auth: Bearer tts-<your-key>
  • Works with standard HTTP clients

Code examples

Here is a basic Python example using the OpenAI SDK. Replace <your-api-key> with your key from the dashboard. The code sends text and receives an MP3 audio file directly.

You can adjust parameters like voice (e.g., 'nova') or response_format (e.g., 'wav') within the same SDK call. This flexibility allows you to generate content optimized for different game engines or web players.

  • Python: openai.audio.create()
  • Node.js: openai.audio.create()
  • Pass 'voice' and 'input' fields

Curl Example

Sound wave illustration for: Curl Example

The simplest way to verify your integration is sending a raw HTTP request. This method requires no external libraries and works directly in your terminal or CI/CD pipeline.

Basic request structure

Send a POST request to the speech endpoint. Include your API key in the Authorization header and specify the desired output format via the request body.

  • Endpoint: https://api.pgzeed168casino.com/v1/audio/speech
  • Method: POST
  • Header: Authorization: Bearer tts-your-key-here

JSON body format

The request body uses standard JSON fields. Ensure your input text does not exceed 4096 characters. The system accepts model variants like 'tts-1' or 'tts-1-hd'.

Response handling

On success, the API returns the audio file directly in the response body. Handle binary data appropriately in your application to save the generated speech file.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. You send text and receive an audio file, keeping the workflow simple.

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. Python documentation
  3. LibriTTS-R paper (arXiv 2305.18802)
  4. MDN: Web Speech API
  5. IETF RFC 7845: Ogg Opus
  6. openai-python on GitHub
  7. Creative Commons Attribution 4.0
  8. LibriTTS-R corpus (OpenSLR 141)
  9. curl documentation
  10. Node.js documentation
  11. Tether (USDT)
  12. FFmpeg documentation

More on this site