Frequently asked questions
How do I get an API key?
Sign up on the /get-api-key/ page using Google or email. Accounts are specific to yy88vn.com. You receive one active key per account, displayed with your balance and usage details. You can issue a new key at any time, which immediately invalidates the old one.
Can I use the OpenAI Python SDK?
Yes. The request shape matches the OpenAI speech endpoint. Use the official OpenAI SDK by changing the base_url to https://api.yy88vn.com/v1 and providing your site-specific key. This allows you to use familiar Python methods for generating audio files directly in your scripts.
What is the base URL?
The API base URL is https://api.yy88vn.com/v1. All requests, including speech synthesis and voice listing, use this domain. Ensure your client libraries point to this specific endpoint to authenticate correctly with your Bearer token and access the available voices and models.
How do I handle large texts?
Split your input text into parts of up to 4096 characters each. Send each part as a separate request and join the resulting audio files. This ensures compliance with the character limit per request while allowing you to generate longer content seamlessly.
What happens if I exceed rate limits?
The limit is 60 requests per minute per key (10 before the first top-up). Requests are processed sequentially, so exceeding the limit may cause your request to wait in a queue. Failed requests are free.
Is the API key single-use?
No, it is reusable until you revoke it. You can issue a new key at any time via your dashboard. When a new key is generated, the old one stops working immediately. You can have only one active key per account.
How do I change the speed?
Include the speed field in your JSON body, with values between 0.25 and 4.0. This adjusts the playback rate of the synthesized audio. The default speed is 1.0. Adjusting speed helps match the tone of your content without changing the voice preset.
Can I send custom headers?
You must include the Authorization: Bearer tts-... header with your key. Other headers depend on your HTTP client. The API does not require specific custom headers beyond authentication. Ensure your client handles standard HTTP headers correctly for JSON payloads.
What is the default model?
The models are tts-1 and tts-1-hd. Both use the same engine and price. You can specify either in the model field.
How do I specify a language?
Include the optional language field with an ISO code. If omitted, the system guesses the language from the script, defaulting to English for Latin text. For non-English Latin-script text, always set the language to ensure correct synthesis from the 23 supported languages.
Does the API support streaming?
No. The API returns complete audio files (mp3, wav, opus, flac, or pcm) in the response. There is no WebSocket or real-time partial audio streaming. You receive the full file after synthesis completes, which typically takes roughly real-time for long texts.
Can I use this with Flask or Django?
Yes. Since the API uses standard HTTP POST requests with JSON bodies, it works with any Python HTTP library. You can easily integrate it into Flask or Django views by sending the request and returning the audio file to the user.
How do I debug a failed request?
Check the HTTP response status code and body for error details. Failed requests are free, so no charge is applied. Ensure your key is valid and the text is within the 4096-character limit. Verify the voice and format parameters are correct.
Is JSON or XML supported?
The API accepts JSON bodies for requests. The response contains the audio file or JSON error details. XML is not mentioned as a supported format. Use standard JSON libraries in your Python code to structure the model, input, voice, and response_format fields.
First request
curl
curl https://api.yy88vn.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.mp3Python (openai)
from openai import OpenAI
client = OpenAI(base_url="https://api.yy88vn.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.yy88vn.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 | |
|---|---|
aria | female |
nova | female |
luna | female |
sage | female |
felix | male |
milo | male |
atlas | male |
orion | male |
| language | |
|---|---|
ar | العربية |
zh | 中文 |
da | Dansk |
nl | Nederlands |
en | English |
fi | Suomi |
fr | Français |
de | Deutsch |
el | Ελληνικά |
he | עברית |
hi | हिन्दी |
it | Italiano |
ja | 日本語 |
ko | 한국어 |
ms | Bahasa Melayu |
no | Norsk |
pl | Polski |
pt | Português |
ru | Русский |
es | Español |
sw | Kiswahili |
sv | Svenska |
tr | Türkçe |
Authentication
Sign up on the /get-api-key/ page using Google or an email password to generate your unique API credential. This key authenticates all requests to the PyTTS Cloud API and is tied to your account balance and rate limits.
Obtain your API key
Create an account via the get-api-key/ page using Google or email/password. The dashboard displays your active key, current balance, and usage statistics immediately after registration.
- Google sign-in includes a $0.50 trial credit valid for 7 days.
- Email/password accounts start without trial credit.
- One active key per account.
Bearer token format
Include your key in the HTTP header as Authorization: Bearer tts-.... Ensure the token is passed exactly as generated; no additional prefixes are required.
Key rotation policy
Issue a new key at any time via the dashboard. The old key stops working immediately, ensuring secure access management without downtime.
Endpoints
PyTTS Cloud exposes three primary endpoints to manage your speech synthesis workflow. The core POST /v1/audio/speech endpoint accepts text and returns audio files, while GET /v1/voices and GET /v1/models provide metadata for configuration.
POST /v1/audio/speech
Send a JSON payload containing model, input, voice, and optional response_format to receive synthesized audio. The API accepts up to 4096 characters per request, returning binary audio data or a JSON object depending on the format specified.
- Endpoint:
POST https://api.yy88vn.com/v1/audio/speech - Accepts JSON bodies with text input and voice selection
GET /v1/voices
Retrieve a list of all available voice presets, their associated languages, and supported audio formats. Use this endpoint to dynamically populate your UI or configuration files with valid voice IDs before making synthesis requests.
- Endpoint:
GET https://api.yy88vn.com/v1/voices - Returns voice IDs, names, and supported languages
GET /v1/models
Fetch current model configurations. This endpoint returns details about the available models (tts-1 and tts-1-hd) without including pricing tiers, which are handled separately in the billing section.
- Endpoint:
GET https://api.yy88vn.com/v1/models - Returns model IDs and technical specifications

Request Parameters
Configure the synthesis engine by selecting either tts-1 or tts-1-hd. Both models use the same underlying engine and incur identical pricing, allowing you to switch formats without cost implications.
Model selection (tts-1, tts-1-hd)
Pass the desired model name in the model field. The API accepts tts-1 for standard quality or tts-1-hd for high-definition audio. There is no performance difference in generation speed or character pricing between the two.
Input text limit (4096 chars)
The input field accepts up to 4,096 characters per request. Spaces and punctuation count toward this limit. For longer documents, split the text into chunks and join the resulting audio files manually.
Voice and language fields
Specify one of eight preset voices via the voice parameter. While voices can speak any of the 23 supported languages, you should explicitly set the language field (e.g., "en", "ja") for non-English Latin-script text to ensure correct pronunciation. If omitted, the system guesses the language, defaulting to English for Latin scripts.
- aria, nova, luna, sage (Female)
- felix, milo, atlas, orion (Male)
- Supported languages: Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Turkish
Response Formats
The API returns raw audio binary data in the response body, allowing direct saving to disk or playing in local players. Choose mp3, wav, opus, flac, or pcm via the response_format parameter to match your deployment needs. MP3 offers small file sizes for web use, while WAV and FLAC provide uncompressed quality for high-fidelity processing. PCM is useful for raw audio pipelines.
MP3, WAV, OPUS, FLAC, PCM
Select the output format based on your storage and bandwidth constraints. MP3 and OPUS provide efficient compression suitable for web delivery. WAV and FLAC deliver lossless audio for archival or further processing. PCM outputs raw uncompressed samples, ideal for real-time audio interfaces.
- MP3: Compressed, web-friendly
- WAV: Uncompressed, high quality
- OPUS: Efficient compression
- FLAC: Lossless compression
- PCM: Raw audio data
Binary audio data
The response body contains the raw bytes of the audio file. You can write this directly to a file using standard HTTP clients. No decoding is required on the client side unless you need to convert formats later.
JSON metadata
The response headers may include metadata such as content type and length. However, the primary payload is the audio binary. Use standard HTTP headers to determine file size and type before writing to disk.
Rate Limits
The API enforces a standard rate limit of 60 requests per minute per API key. This limit applies uniformly regardless of the model or voice selected, ensuring predictable performance for indie developers integrating speech synthesis into their applications.
During peak usage, requests are processed sequentially. If the system is busy, your request may wait in a queue before synthesis begins. This can increase latency for long texts but ensures fair resource distribution across all users.
60 requests per minute
Each API key is allowed a maximum of 60 requests per minute. This cap helps maintain stability for the cloud infrastructure while allowing sufficient throughput for most freelance projects and small-scale deployments.
10 requests before first top-up
New accounts start with a reduced limit of 10 requests per minute. This lower threshold applies until you perform your first top-up. Once you add funds via USDT (TRC-20), the limit increases to the standard 60 requests per minute immediately.
This initial cap allows you to verify your integration works without requiring an immediate payment, though the free trial credit remains available for testing.
- Limit resets every 60 seconds.
- Applies per API key, not per IP.
Queue behavior under load
Requests are processed one after another. Under heavy load, your request may wait in a queue before synthesis starts. This means short phrases might take a few seconds longer than usual, and longer texts will generate at roughly real-time speed once processing begins.
Failed requests are free. Always implement retry logic with exponential backoff to handle temporary queue delays gracefully.

Error Handling
Handling errors correctly ensures your Python scripts remain robust when the API returns unexpected states. Since the service is designed for indie developers, clear feedback allows you to distinguish between temporary network hiccups and permanent configuration mistakes, keeping your automated voice generation pipelines running smoothly.
HTTP status codes
The API returns standard HTTP codes to indicate request outcomes. A 200 OK means synthesis succeeded. Use 400 Bad Request for invalid parameters, 401 Unauthorized for missing or invalid keys, and 429 Too Many Requests if you exceed the 60 requests per minute limit.
JSON error messages
Error responses include a JSON body with an error field explaining the issue. This helps you quickly identify if a voice is missing or if the text length exceeds the 4096 character limit. Failed synthesis charges are refunded automatically, so check the status to confirm billing adjustments.
Retry logic
Implement exponential backoff for 429 and 5xx errors. Since requests are processed sequentially, high load may cause temporary queuing delays. Retry with increasing delays rather than immediate retries to avoid overwhelming the endpoint and to respect your rate limit window effectively.
Code Examples
To replace local engines like pyttsx3, send a POST request to the speech endpoint with your key and text. The API returns binary audio data directly in the response body.
Below are practical examples using cURL, the Python requests library, and the official OpenAI SDK configured for our base URL. These snippets demonstrate how to handle authentication and receive the audio file efficiently.
Curl example
Use this command to generate speech immediately. Replace YOUR_API_KEY with your actual key and adjust the voice or model as needed.
- curl -X POST https://api.yy88vn.com/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Hello world", "voice": "nova", "response_format": "mp3"}' \ -o output.mp3
Python requests library
Send a POST request using the requests library. The response content contains the raw audio bytes, which you can write directly to a file.
- import requests url = "https://api.yy88vn.com/v1/audio/speech" headers = {"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"} data = {"model": "tts-1", "input": "Hello world", "voice": "nova"} response = requests.post(url, headers=headers, json=data) with open("output.mp3", "wb") as f: f.write(response.content)
OpenAI SDK configuration
Since the endpoint shape matches OpenAI’s, you can use the official SDK by changing the base URL. This allows you to use familiar methods like client.audio.speech.create().
Ensure your API key is set correctly. The SDK handles the binary response, allowing you to save the file with minimal code overhead.
- from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.yy88vn.com/v1" ) speech_file_path = client.audio.speech.create( model="tts-1", voice="nova", input="Hello world" ).audio_data with open("output.mp3", "wb") as f: f.write(speech_file_path)

Voice Selection
You can retrieve the full list of available voices, their associated languages, and supported formats by calling the GET /v1/voices endpoint. This response provides the necessary metadata to integrate voice selection into your application logic without hardcoding values.
Selecting a voice is straightforward: pass one of the eight preset names (e.g., aria, nova, felix) as the voice parameter in your speech request. The API accepts any voice for any supported language, allowing you to mix and match voices across different text segments freely.
List available voices
Call GET /v1/voices to retrieve all eight presets. The response includes each voice's name, gender, and the 23 supported languages. This data helps you build dynamic UI dropdowns or configure batch processing jobs accurately.
The endpoint also returns supported output formats (mp3, wav, opus, flac, pcm) for each voice, ensuring your client-side logic matches the server's capabilities.
- Retrieves all 8 voice presets
- Shows supported languages and formats
Select by name
Use the exact voice name in your POST request body. For example, use aria for warm narration or atlas for neutral news delivery. The API validates the voice name against the available presets; invalid names return a 400 error.
You can switch voices between requests without needing to reload the model. Each request is independent, allowing you to alternate voices for different characters or sections in your audio output.
- Use exact names: aria, nova, luna, sage, felix, milo, atlas, orion
- No case sensitivity issues
- Switch voices per request freely
Check language support
All eight voices support all 23 listed languages. If you omit the language field, the API guesses the language from the text script, defaulting to English for Latin script. For non-English Latin text, explicitly set the language parameter to ensure correct pronunciation.
Voices do not support Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, Bengali, or other languages outside the 23 supported list. Verify your target language against this list before deploying to avoid silent failures or mispronunciations.
- Supports 23 languages including Arabic, Chinese, French, German, Hindi, Japanese, Korean, Spanish
- Explicitly set
languagefor non-English Latin text - Not supported: Vietnamese, Thai, Ukrainian, Romanian, Czech, Bengali
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Indie developers are freelancers who thrive on creative freedom and independent game production.
23 languages
Any voice speaks any of these languages.
