Text-to-Speech API Documentation for Developers

By Narricore editorial team · Updated 2026-11-18

This documentation guides game developers in integrating Narricore’s text-to-speech API for NPC dialogue and interactive audio. You will learn how to generate high-quality voice lines using our straightforward REST API, which mirrors the OpenAI speech endpoint structure for seamless adoption. Whether you are prototyping a small indie title or scaling a larger studio project, these pages provide the concrete technical details you need to start generating audio immediately.

We cover authentication, request parameters, rate limits, and error handling with specific examples relevant to game development workflows. You can use the official OpenAI SDKs by simply adjusting the base URL, or send direct HTTP requests with cURL. All pricing is transparent at $0.01 per 1,000 characters, and you can test the service instantly with a free trial credit upon sign-up.

Text-to-Speech API Documentation for Developers

Frequently asked questions

Do you have your own SDK?

We don’t have a proprietary SDK. Instead, we use the same request shape as OpenAI, so their official SDKs work perfectly by simply changing the base_url to https://api.play60win.com/v1. You can also use plain HTTP requests. This keeps your integration lightweight and lets you use familiar libraries without installing a client specific to our platform.

Can I use the OpenAI SDK?

A: Yes, the official OpenAI SDKs work by changing the base URL. You simply need to set base_url to https://api.play60win.com/v1 and use your Narricore API key. The request shape matches the OpenAI speech endpoint exactly, making integration straightforward for existing OpenAI users.

What is the base URL?

The API base URL is https://api.play60win.com/v1. All requests, including text-to-speech synthesis and voice listing, originate from this endpoint. Ensure your authentication header includes your unique Bearer token to authorize your requests correctly against this base URL.

How do I set the language?

Pass the optional language field in your request body using an ISO code. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Explicitly setting it ensures accurate pronunciation for non-English languages like French or Japanese.

Can I stream audio?

No, we do not support streaming or WebSocket connections. The API returns the complete audio file in the response body after synthesis finishes. You must wait for the full file to be generated before processing or playing the audio data.

Do you support SSML?

No, SSML is not supported. You send plain text input, which is limited to 4096 characters per request. There is no support for phoneme dictionaries, custom pronunciation lexicons, or emotion tags. Simple text input is sufficient for generating NPC dialogue lines.

How do I handle rate limits?

You are limited to 60 requests per minute per key. New accounts start with 10 requests per minute until the first top-up. If you exceed the limit, requests will be rejected. Implement exponential backoff in your game’s audio engine to handle delays gracefully.

What happens on a 401 error?

A 401 error indicates an invalid or missing API key. Ensure your Authorization: Bearer header contains a valid key issued to your account. If your key was revoked or replaced, generate a new one via the dashboard and update your game’s configuration immediately.

First request

curl

curl https://api.play60win.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.play60win.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.play60win.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 and Keys

Sound wave illustration for: Authentication and Keys

To start generating voice lines for your NPCs, sign up at https://play60win.com/get-api-key/ using Google or email. Your dashboard displays your unique API key, current balance, and a ready-to-use cURL example. This key is the only credential needed to authenticate your requests.

Get Your API Key

Get Your API Key

Accounts are created per site. Google sign-ups include a $0.50 free trial valid for 7 days, while email accounts start with zero credit. You can top up later via USDT (TRC-20).

Bearer Token Authorization

Bearer Token Authorization

Include your key in the HTTP header as Authorization: Bearer tts-.... The API uses this token to verify your account and deduct characters from your balance.

Key Revocation and Regeneration

Each account has one active key. You can issue a new key at any time from the dashboard; the old key stops working immediately, ensuring secure access control.

Base URL and Endpoints

Sound wave illustration for: Base URL and Endpoints

All API interactions begin with the base URL https://api.play60win.com/v1. This structure ensures compatibility with standard HTTP clients and the official OpenAI SDKs. You simply point your client to this domain to access all available endpoints for generating NPC dialogue and interactive audio assets.

The API exposes three primary endpoints for managing your game's audio pipeline. The main speech endpoint handles synthesis requests, while the voices and models endpoints provide metadata about available assets. These endpoints allow you to dynamically select voices and verify model availability before generating audio files.

### Main Speech Endpoint

POST https://api.play60win.com/v1/audio/speech accepts a JSON body containing your text, voice selection, and desired audio format. This is the core endpoint for generating voice lines for your characters.

### Voices List Endpoint

GET https://api.play60win.com/v1/voices returns a list of available voices, their associated languages, supported formats, and pricing details. Use this to programmatically select the best voice for your NPC's personality.

### Models Endpoint

GET https://api.play60win.com/v1/models lists the available synthesis models (tts-1 and tts-1-hd). Both use the same engine and pricing, allowing you to switch based on your quality and performance needs without changing your integration logic.

image:

Request Parameters

Sound wave illustration for: Request Parameters

Configure the synthesis engine and input constraints to generate NPC dialogue. The API accepts text up to 4096 characters per request, which you must split for longer conversations. Audio length typically matches real-time speech at roughly 25 characters per second, though short phrases may take a few seconds to process due to queueing.

Select from eight licensed voices, such as Aria for narrators or Atlas for news-style lines. Choose your output format and speed to fit your game engine’s requirements. All voices support 23 languages, with automatic detection for Latin script if the language code is omitted (defaulting to English).

Model Selection (tts-1, tts-1-hd)

Both models use the same engine and pricing. Select "tts-1" for standard efficiency or "tts-1-hd" for higher fidelity. The choice does not affect character limits or voice availability.

Input Text Limit

Each request accepts up to 4096 characters of text. Spaces and punctuation count toward this limit. For longer dialogue trees, split the text into chunks and join the resulting audio files client-side.

Voice Selection

Choose from eight presets: Aria, Nova, Luna, Sage, Felix, Milo, Atlas, or Orion. Each voice is based on licensed recordings from LibriTTS-R and LibriVox. Select the tone that best matches your character’s personality.

  • Aria: Warm, clear narrator
  • Nova: Bright, upbeat
  • Luna: Soft, storytelling
  • Felix: Energetic, promo

Response Format Options

Output files are returned as binary data. Supported formats include mp3, wav, opus, flac, and pcm. Choose mp3 for web playback or wav for high-quality game audio integration.

Speed Control

Adjust speech speed between 0.25 and 4.0. This allows you to fine-tune dialogue pacing for different character types, from slow, deliberate narration to rapid, excited exclamations.

Response Formats

Sound wave illustration for: Response Formats

The API returns audio files in the format you specify, allowing you to choose the best balance of quality, file size, and compatibility for your game engine or web player. Selecting the right format ensures smooth playback and efficient bandwidth usage during NPC dialogue sequences.

All generated files include an inaudible watermark to identify them as synthetic speech, helping you manage licensing and attribution in your game’s audio assets without extra overhead.

MP3 for Web Playback

MP3 is the recommended format for most web-based games and mobile apps due to its universal compatibility and small file size. It provides sufficient audio quality for dialogue while keeping storage and bandwidth costs low.

This format is ideal for streaming voice lines in real-time during gameplay, ensuring minimal latency for player interactions.

  • Supports all major web browsers and game engines.
  • Optimal for variable bitrate encoding to save space.

WAV for High Quality

Select WAV for uncompressed audio, preserving the full fidelity of the generated speech. This format is perfect for high-end PC games or cinematic cutscenes where audio quality is prioritized over file size.

WAV files are larger than MP3 but offer instant decoding with no compression artifacts, ensuring crystal-clear dialogue for critical story moments.

  • Lossless, uncompressed PCM audio.
  • Ideal for post-processing or high-fidelity playback.

FLAC and Opus Options

FLAC provides lossless compression for archival needs, while Opus offers superior quality-to-size ratios. Note that the API does not support streaming audio.

Use FLAC when you need to store voice assets for future editing without quality loss. Opus is excellent for efficient storage in large voice banks where bandwidth matters but quality must remain high.

  • FLAC: Lossless compression for archival storage.
  • Opus: Efficient compression for large voice libraries.

Rate Limits and Quotas

Sound wave illustration for: Rate Limits and Quotas

Rate limits protect service stability during peak generation periods. Understanding your quota ensures smooth integration with your game’s audio pipeline, preventing unexpected interruptions during dialogue synthesis.

60 Requests Per Minute

Once your account is active, you can send up to 60 requests per minute. This throughput supports rapid prototyping and bulk generation for large NPC dialogue trees.

10 Requests Per Minute Initially

New accounts start with a limit of 10 requests per minute. This allows you to verify integration and test voice quality before scaling up. The limit increases automatically once you make your first top-up.

Queue Processing Under Load

Requests are processed sequentially. During high demand, your synthesis job may wait in a queue before processing begins. Plan your audio generation timing accordingly, as requests are processed sequentially and may wait in a queue under load.

Rate Limits and Quotas

Error Handling

Sound wave illustration for: Error Handling

When your request lacks proper authentication or exceeds the character limit, the API returns a 4xx error. Check your API key validity and ensure the input text stays within the 4096-character boundary for a single request.

Server issues trigger 5xx errors, indicating a temporary problem on our end or that the request failed. These are rare, but if synthesis fails, the charge is returned in full, ensuring you are not billed for incomplete audio generation.

4xx Client Errors

Common issues include invalid API keys or malformed JSON bodies. Ensure your Authorization: Bearer tts-... header is correctly formatted and that all required fields like model and input are present.

  • Verify API key prefix and validity
  • Check JSON syntax and required fields
  • Ensure text length is under 4096 characters

5xx Server Errors

Occasional server errors may occur during peak processing times. These indicate a temporary issue with the synthesis engine. Since failed requests are free, you can retry safely without worrying about extra charges.

Rate Limit Exceeded

If you exceed 60 requests per minute, you will receive a 429 error. New accounts start with a 10 requests per minute limit. Upgrade your balance or wait for the window to reset before retrying.

  • Standard limit: 60 requests/minute
  • Initial limit: 10 requests/minute
  • Retry after window reset

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

Narricore’s API mirrors the OpenAI speech structure, allowing you to reuse existing integration code with minimal changes. By adjusting the base URL and authenticating with your Narricore key, you can generate NPC dialogue directly within your game engine or backend services using familiar tools.

Configure Base URL

Point your client to the Narricore API base URL: https://api.play60win.com/v1. This directs all requests to our infrastructure while maintaining the standard request shape for compatibility.

Use Official SDK

Leverage the official OpenAI SDKs by initializing the client with the Narricore base URL. This ensures seamless compatibility with the POST /v1/audio/speech endpoint without requiring a custom library.

Pass API Key

Include your unique API key in the Authorization: Bearer <key> header. This authenticates your requests and tracks character usage against your account balance.

cURL Example

Sound wave illustration for: cURL Example

cURL is a straightforward way to test the Narricore API without installing additional libraries. It works with any terminal that supports standard HTTP requests, making it ideal for quick prototyping in game development pipelines.

Basic Request Structure

To generate speech, send a POST request to the speech endpoint. Replace YOUR_API_KEY with your actual key from the dashboard.

Sending JSON Body

Include the text, voice, and model in a JSON payload. The engine supports tts-1 and tts-1-hd. Ensure the text is under 4096 characters.

  • - model: "tts-1" or "tts-1-hd"
  • - voice: e.g., "nova"
  • - input: "Hello world"
  • - response_format: "mp3"

Receiving Audio File

The response contains the audio binary data. Save it directly to a file for use in your game engine.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Our AI builds immersive games where NPCs adapt dynamically to player choices in real time.

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. OpenAI API reference: create speech
  4. openai-python on GitHub
  5. MDN: Web Speech API
  6. ISO 639 language codes
  7. Node.js documentation
  8. LibriVox public-domain audiobooks
  9. LibriTTS-R paper (arXiv 2305.18802)
  10. FFmpeg documentation
  11. curl documentation
  12. Tether (USDT)

More on this site