Text-to-Speech API: Quickstart Integration Guide for Developers

By VoxelPop editorial team · Updated 2026-11-19

This guide helps game developers and content creators integrate VoxelPop’s text-to-speech API for generating NPC dialogue. You will learn to send text and receive audio files using the standard OpenAI-compatible endpoint, ensuring a smooth workflow for character voice synthesis without the legal risks of unauthorized cloning.

We cover authentication, endpoint structures, and parameter tuning for voice and speed. By following these steps, you can generate audio for your projects, leveraging our infrastructure to scale character voice production.

Text-to-Speech API: Quickstart Integration Guide for Developers

Frequently asked questions

How do I generate an API key?

Sign up on /get-api-key/ using Google or email. The page displays your key, balance, and usage. Each account has one active key. You can issue a new key at any time; the old one stops immediately upon issuance.

Can I use the OpenAI SDK?

Yes. The API uses the same request shape as OpenAI’s speech endpoint. Change the SDK’s base_url to https://api.3366win.info/v1 and use your VoxelPop key. The official OpenAI SDKs work directly with this configuration.

What is the base URL?

The API base URL is https://api.3366win.info/v1. Use this for all requests, including POST /v1/audio/speech, GET /v1/voices, and GET /v1/models. Ensure your authorization header uses this domain.

How do I change the speed?

Include the speed parameter in your JSON body. Valid values range from 0.25 to 4.0. This adjusts the playback rate of the generated audio.

What formats are supported?

You can choose mp3, wav, opus, flac, or pcm via the response_format field. Select the format that best fits your game engine or content creation pipeline when sending the request to the speech endpoint.

Is SSML supported?

No, SSML is not supported. The API accepts plain text input only. You cannot use SSML tags for pronunciation or prosody control. Input text is limited to 4096 characters per request.

How do I handle errors?

If synthesis fails, the charge is returned in full. Check your request parameters and authentication. Failed requests do not consume your character balance. Review the API response for status codes indicating the specific error cause.

What is the character limit per request?

Each request supports up to 4096 characters. For longer texts, split the input into parts of this size and join the resulting audio files. Spaces and punctuation count toward the character limit.

Can I stream audio?

No, streaming is not available. The API returns the complete audio file in the response. There is no WebSocket or real-time partial audio support.

Do I need to install a specific SDK?

No specific SDK is required. You can use the official OpenAI SDK by changing the base URL, or use plain HTTP requests. There is no proprietary VoxelPop SDK or mobile SDK needed.

How do I rotate my API key?

Issue a new key from your account dashboard. The new key becomes active immediately, and the old one stops working at once. You can rotate keys as often as needed without affecting your balance.

What happens if I hit the rate limit?

The limit is 60 requests per minute per key (10 per minute before the first top-up). Requests are processed sequentially. Under load, requests may queue, taking longer to complete. Exceeding the limit may delay responses.

Is there a webhook for completion?

No, there is no webhook for completion. The API returns the audio file directly in the response. You do not need to wait for a callback. Requests are processed one after another, so queueing may occur.

Can I use custom voices?

No, custom voice cloning is not offered. You must choose from the eight preset voices: aria, nova, luna, sage, felix, milo, atlas, or orion. These are based on licensed recordings and carry a synthetic watermark.

First request

curl

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

VoxelPop uses a simple bearer token for authentication. Include your key in the Authorization: Bearer tts-... header for every request. You get one active key per account, which you can retrieve from your dashboard.

API Key Format

API Key Format

Your key starts with tts- and is issued when you sign up. Keep it secure; anyone with the key can use your balance.

Key Rotation

Key Rotation

Generate a new key at any time via the dashboard. The old key stops working immediately, ensuring no overlap or confusion.

Rate Limits

Limits are 60 requests per minute per key (10/min before first top-up). Requests queue if overloaded, so plan your NPC dialogue batches accordingly.

  • 60 RPM after top-up
  • 10 RPM initially
  • Queued processing

Endpoints

Sound wave illustration for: Endpoints

VoxelPop’s API is built on standard OpenAI-compatible endpoints, allowing you to integrate quickly using familiar tools. The primary endpoint handles audio synthesis, while secondary endpoints provide metadata about available voices and model configurations.

Speech Generation

Send a POST request to /v1/audio/speech with your text, selected voice, and desired format. The API returns the audio file directly in the response body, ready for immediate playback or storage.

  • Endpoint: POST /v1/audio/speech
  • Returns audio file in specified format

List Voices

Use GET /v1/voices to retrieve the complete list of available voice presets, their associated languages, and supported output formats. This helps you dynamically select an NPC voice for your game’s character roster.

  • Endpoint: GET /v1/voices
  • Returns voice ID, name, and language support

Model Information

Query GET /v1/models to verify the available TTS models (tts-1 and tts-1-hd). Both models use the same engine and pricing, ensuring consistent quality regardless of your choice.

  • Endpoint: GET /v1/models
  • Models: tts-1, tts-1-hd

Request Parameters

Sound wave illustration for: Request Parameters

Configure the POST /v1/audio/speech endpoint by selecting the synthesis engine, assigning a specific voice preset, and defining the output container. These three parameters determine the audio quality, character identity, and file compatibility for your NPC dialogue or content creator assets.

Model Selection

Choose between tts-1 for standard efficiency or tts-1-hd for higher fidelity. Both models share the same engine and pricing structure, allowing you to test quality without immediate cost commitment.

Voice Selection

Assign one of eight licensed presets from LibriTTS-R or LibriVox recordings. Each voice offers a distinct tonal character suitable for different game roles, from energetic promos to calm instructional narrations.

  • Aria: Warm, clear narrator
  • Felix: Energetic, promo
  • Atlas: Neutral, news

Response Format

Specify the output container format to match your integration needs. Available formats include mp3, wav, opus, flac, and pcm, ensuring compatibility with various audio pipelines and storage requirements.

Example Requests

Sound wave illustration for: Example Requests

Integrate VoxelPop’s text-to-speech API into your game engine or content pipeline with minimal code. The endpoint accepts standard JSON payloads, allowing you to generate NPC dialogue or narrated content directly from your application logic.

Use the provided examples to test immediate generation. The API returns audio files that can be streamed or saved locally, ensuring seamless integration with existing game audio systems without requiring external plugins or custom SDKs.

Curl Command

Send a POST request with your API key and desired parameters. The following command generates a short clip using the 'felix' voice, ideal for testing integration before embedding in your production build.

  • curl -X POST "https://api.3366win.info/v1/audio/speech" \
  • -H "Authorization: Bearer YOUR_API_KEY" \
  • -H "Content-Type: application/json" \
  • -d '{"model": "tts-1", "voice": "felix", "input": "Welcome to the tavern."}'

Python SDK Example

Leverage the official OpenAI Python SDK by pointing it to our base URL. This approach allows you to use familiar methods like audio.speech.create while benefiting from our specific voice presets and pricing structure.

  • import os
  • from openai import OpenAI
  • client = OpenAI(api_key=os.environ['VOXELPOP_API_KEY'], base_url='https://api.3366win.info/v1')
  • speech_file_path = './npc_dialogue.mp3'
  • response = client.audio.speech.create(
  • model='tts-1',
  • voice='felix',
  • input='Welcome to the tavern.'
  • )
  • response.stream_to_file(speech_file_path)

JavaScript Example

For web-based game interfaces or browser extensions, use the native Fetch API. The response is returned as a binary blob, which you can convert into a playable audio object or save to local storage for offline use.

  • fetch("https://api.3366win.info/v1/audio/speech", {
  • method: "POST",
  • headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
  • body: JSON.stringify({ model: "tts-1", voice: "felix", input: "Welcome to the tavern." })
  • }).then(r => r.blob().then(b => {
  • const u = URL.createObjectURL(b);
  • new Audio(u).play();
  • }));

Response Handling

Sound wave illustration for: Response Handling

Upon successful synthesis, the API returns the generated audio file directly in the response body. You can immediately pipe this binary data to a file or feed it into your game engine’s audio pipeline without intermediate storage steps.

Requests are processed sequentially; under load, generation may wait in a queue. Typical speed is roughly real-time, though short phrases may take a few seconds to complete.

Audio File Stream

Receive the audio file directly in the response body for playback or storage.

Error Codes

If synthesis fails, the charge is returned in full. The response includes standard HTTP status codes to indicate success or specific failure reasons, allowing your application to retry or log the issue appropriately.

Speed Adjustment

Adjust playback speed between 0.25 and 4.0 using the speed parameter. This allows fine-tuning of NPC dialogue pacing without needing post-processing audio tools, ensuring character voices match the desired intensity or calmness.

Response Handling

Voice Options

Sound wave illustration for: Voice Options

VoxelPop offers eight distinct voice presets, each designed for specific NPC archetypes in game development. These voices are derived from licensed recordings of LibriTTS-R and public-domain LibriVox audiobooks, ensuring legal clarity for commercial use. Every generated audio file includes an inaudible synthetic watermark, distinguishing it from human recordings without affecting audio quality.

The selection process is straightforward: choose a voice that matches your character’s tone, from warm narrators to deep documentary styles. Any voice can speak any of the 23 supported languages, allowing for consistent character voices across global releases without needing separate voice actors for each region.

Female Voices

Four female presets provide versatile options for heroines, narrators, and UI guides. Aria offers a warm, clear narration style ideal for lore entries. Nova brings a bright, upbeat energy suitable for casual interactions or mini-games. Luna delivers a soft, storytelling tone perfect for atmospheric scenes. Sage provides a calm, instructional voice for tutorials and hints.

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

Male Voices

Four male presets cover a range of character types from news anchors to energetic promoters. Felix is energetic and promo-ready for shopkeepers or announcers. Milo offers a friendly, conversational tone for companions or guides. Atlas remains neutral and news-like for objective dialogue. Orion provides a deep, documentary style suitable for epic backstories or serious antagonists.

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

Voice Descriptions

Each voice is a preset based on licensed recordings, ensuring authenticity without the need for custom cloning. These voices are not imitations of real celebrities or politicians, reducing legal risks for your game. They are designed to be generic enough to fit various genres while remaining distinct enough to define character personality. Use these presets to quickly populate your game with diverse, legally safe dialogue.

Note that while voices are licensed, the generated audio is synthetic. This means you do not need to manage voice actor contracts or union rules for generated lines.

  • Licensed recordings from LibriTTS-R
  • Public-domain LibriVox source
  • Inaudible watermark included
  • No celebrity imitations

Languages

Sound wave illustration for: Languages

VoxelPop supports 23 languages, enabling game developers to localize NPC dialogue across diverse markets. The system handles Latin-script text by defaulting to English, but explicit language specification ensures accuracy for non-English content.

Supported Languages

The API supports 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, allowing flexible casting for international game releases.

Language Detection

If the language field is omitted, the system guesses the language from the script. Latin script defaults to English, so non-English Latin text requires explicit setting. Unsupported languages like Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, and Bengali will not process correctly.

ISO Codes

Use standard ISO codes for the language parameter to ensure precise localization. This avoids ambiguity and ensures the selected voice renders phonemes correctly for the target language, maintaining character immersion in non-English dialogues.

Rate Limits

Sound wave illustration for: Rate Limits

Understanding rate limits ensures your NPC dialogue generation remains smooth during peak production hours. VoxelPop API enforces a standard limit of 60 requests per minute per API key, which is sufficient for most batch processing workflows.

60 Requests Per Minute

Once your account is active, you can send up to 60 synthesis requests each minute. This allows for steady integration into your game’s audio pipeline without overwhelming the service.

Initial Limit

New accounts start with a lower limit of 10 requests per minute. This applies until you make your first top-up, helping to verify your integration setup before scaling volume.

Queue Behavior

Requests are processed sequentially. Under heavy load, your synthesis job may wait in a queue before processing begins. Plan your character voice generation accordingly to avoid latency spikes in your production pipeline.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. It suits projects requiring rapid iteration, multi-language support, and clear legal ownership of generated assets.

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

More on this site