Frequently asked questions
How do I get an API key?
Sign up on /get-api-key/ using Google or email plus password. The page displays your active key, balance, and usage statistics. You can issue a new key at any time, which immediately invalidates the old one. One active key is permitted per account.
What is the base URL for the API?
The API base URL is https://api.km510.info/v1. Use this base URL when configuring the official OpenAI SDKs. All requests are sent to https://api.km510.info/v1/audio/speech via POST.
Does the API support OpenAI SDKs?
Yes. The request shape matches the OpenAI speech endpoint. You can use official OpenAI SDKs by changing the base_url to https://api.km510.info/v1 and providing your site-specific key. No custom SDK is required.
What is the character limit per request?
Each request supports up to 4096 characters of input text. Spaces and punctuation count toward this limit. For longer texts, split the input into parts of 4096 characters and join the resulting audio files.
Can I change the voice mid-sentence?
No. The API generates audio for a single voice per request. To change voices, you must send separate requests for each segment and join the audio files manually. There is no mid-sentence voice switching.
What is the speed range?
The speed parameter accepts values between 0.25 and 4.0. This allows you to slow down or speed up the narration. The default speed is 1.0. Adjust this value to match your content's pacing requirements.
How do I handle long texts?
Split your text into chunks of up to 4096 characters. Send each chunk as a separate request to the speech endpoint. Finally, join the returned audio files to create the complete audio file.
What happens if I exceed the rate limit?
The limit is 60 requests per minute per key. If you exceed this, requests may queue or fail. New accounts start with 10 requests per minute. Failed requests do not incur charges.
Is there a WebSocket endpoint?
No. The API does not support WebSocket connections or streaming audio. You must use standard HTTP POST requests to receive complete audio files. There is no real-time partial audio support.
Do you support SSML tags?
No. The API does not support SSML tags, phoneme dictionaries, or custom pronunciation lexicons. Input is plain text. You control pacing and voice selection via the request parameters.
How do I test the API?
Use the ready curl example provided on the /get-api-key/ page. You can also use the official OpenAI SDKs with the adjusted base_url. Send a POST request with your key and text to receive audio.
What is the typical response time?
Long texts generate at roughly real-time speed (25 characters per second). Short phrases take a few seconds. Requests are processed sequentially, so under load, a request may wait in a queue.
Can I stream the audio?
No. The API returns complete audio files in the response. There is no streaming endpoint or WebSocket support. You receive the full file after synthesis completes.
How do I verify the voice ID?
Send a GET request to /v1/voices. This endpoint returns the list of available voices, languages, and formats. You can then select from the eight preset voices for your requests.
First request
curl
curl https://api.km510.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.mp3Python (openai)
from openai import OpenAI
client = OpenAI(base_url="https://api.km510.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.km510.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 | |
|---|---|
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
Authentication for the News TTS Logic API relies on a single active Bearer token per account. Pass the key in the Authorization header as Bearer tts-<your_key>. This token grants access to all endpoints, including speech synthesis and voice listing.
Bearer token setup
Include the header Authorization: Bearer tts-... in every API request. The token must be generated from your dashboard at /get-api-key/ and remains valid until rotated or revoked.
Key generation
Keys are issued automatically upon account creation via Google or email. Your unique key is displayed on the dashboard alongside your current balance and usage statistics.
Key rotation policy
You may generate a new key at any time from the dashboard. The previous key is invalidated immediately upon creation of the new one, ensuring zero overlap in active credentials.
- One active key per account
- Old key stops immediately
- New key issued instantly
Speech Endpoint
Send text to the speech endpoint to receive synthesized audio. The endpoint accepts standard JSON payloads and returns audio files directly in the response body, allowing seamless integration into existing news production pipelines without complex middleware.
POST /v1/audio/speech
Submit a POST request to https://api.km510.info/v1/audio/speech with your Bearer token. The service processes text up to 4096 characters per request, returning the audio file synchronously.
- Endpoint: POST /v1/audio/speech
- Base URL: https://api.km510.info/v1
- Auth: Bearer token in header
JSON body structure
The request body requires model, input, and voice. Optional fields include response_format, speed, and language. The input field accepts plain text strings, with spaces and punctuation counting toward the character limit.
- model: "tts-1" or "tts-1-hd"
- input: text string (max 4096 chars)
- voice: one of 8 presets
- speed: 0.25–4.0
- language: optional ISO code
- response_format: mp3, wav, opus, flac, pcm
Response format
The API returns the audio file directly in the response body with the appropriate content type. If synthesis fails, a JSON error object is returned with details, and no charge is applied.
Voice Endpoint
The /v1/voices endpoint returns the available voice presets, supported languages, and associated formats for your integration. This endpoint allows your application to dynamically select the appropriate voice and language configuration before sending speech requests.
Use this data to map user preferences to specific voice IDs, ensuring the generated audio matches the intended tone and language of your news content.
GET /v1/voices
Send a GET request to retrieve the full list of available voices. The response includes voice IDs, descriptions, and supported languages, enabling programmatic selection without hardcoding values.
This endpoint helps you verify available options before synthesizing speech, ensuring compatibility with your target audience's language requirements.
- Returns JSON array of voice objects
- Includes voice ID, name, and gender
- Lists supported language codes
- Shows available response formats
Voice list details
The API provides eight distinct voice presets, including female voices like Aria and Nova, and male voices like Felix and Milo. Each voice has a specific tonal quality, such as "warm, clear narrator" or "energetic, promo," suitable for different news segments.
You can select any voice for any supported language, allowing flexible deployment across diverse content types without needing multiple voice subscriptions.
- Aria: warm, clear narrator
- Nova: bright, upbeat
- Luna: soft, storytelling
- Sage: calm, instructional
- Felix: energetic, promo
- Milo: friendly, conversational
Language support
The API supports 23 languages, including English, Spanish, German, French, and Japanese. Any voice can speak any of these languages, providing flexibility in voice selection regardless of the target language.
If the language parameter is not set, the system guesses the language from the script. For non-English Latin-script text, explicitly set the language parameter to ensure accurate pronunciation and tone.
- 23 supported languages
- Any voice can speak any language
- Automatic language detection available
- Explicit language code recommended for non-English
Models
The API offers two model variants, tts-1 and tts-1-hd, which utilize the same underlying synthesis engine. Both models accept identical input parameters and produce audio with consistent voice characteristics and quality profiles.
GET /v1/models
Send a GET request to https://api.km510.info/v1/models to retrieve available model identifiers and metadata. This endpoint confirms the supported model strings for use in your speech requests.
- Returns a list of available model IDs.
- Includes metadata for each model variant.
tts-1 vs tts-1-hd
Both models deliver identical voice synthesis. The distinction lies solely in the model identifier; both tts-1 and tts-1-hd use the same engine and have the same price. Choose based on your budget requirements without affecting audio quality.
Engine parity
Switching between tts-1 and tts-1-hd does not change the voice presets or language support. You can use either model with any of the 8 voice presets and 23 supported languages without modification to your request structure.
Request Parameters
The API accepts text inputs up to 4096 characters per request, where spaces and punctuation count toward the limit. For longer articles, split the text into chunks and join the resulting audio files sequentially. This ensures consistent generation speed and avoids timeout issues during high-volume processing.
Input text limit
Each request is capped at 4096 characters. Longer content requires client-side splitting and audio concatenation. This approach maintains stable processing times and prevents queue bottlenecks during peak news cycles.
Speed range
Adjust playback speed between 0.25x and 4.0x using the speed parameter. Values outside this range are rejected. Fine-tune pacing to match broadcast standards or archival requirements without re-generating audio.
Language code
Set the language field to an ISO code for precise control. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Explicitly setting the language prevents misidentification for non-English content.

Response Formats
The API returns audio data in the response_format specified during the request. Supported formats include MP3, WAV, Opus, FLAC, and PCM, allowing you to balance file size and quality based on your delivery pipeline.
MP3 output
MP3 is the default format for most use cases. It provides efficient compression suitable for web streaming and mobile applications, keeping bandwidth costs low while maintaining acceptable audio clarity.
WAV output
WAV provides uncompressed PCM audio. Use this when you need lossless quality for archiving or further processing in professional audio workflows. Note that WAV files are significantly larger than MP3s.
Opus and FLAC options
Opus offers high-quality compression at low bitrates, ideal for VoIP or low-bandwidth environments. FLAC provides lossless compression, reducing file size without sacrificing quality, making it suitable for storage-efficient archiving.
Rate Limits
Synthetic speech generation processes requests sequentially, meaning throughput is governed by strict rate limits to maintain stability during high-volume news production cycles. Understanding these constraints ensures your integration handles bursts without losing audio data.
60 requests per minute
Each API key supports a maximum of 60 requests per minute. This limit applies per key, so splitting load across multiple keys increases aggregate throughput. Requests are processed in the order received, with typical generation taking roughly real-time duration for long texts.
- Limit: 60 requests/minute per key
- Processing is sequential, not parallel
Pre-top-up limit
Accounts without a top-up are restricted to 10 requests per minute. This lower threshold allows for testing and small-batch news updates without requiring immediate payment. Once a USDT (TRC-20) top-up is confirmed, the limit automatically increases to 60 requests per minute.
- Standard limit: 60 req/min
- Pre-top-up limit: 10 req/min
Queue behavior
Under load, requests may wait in a queue before synthesis begins. Short phrases take a few seconds, while longer texts generate at approximately 25 characters per second. Failed requests do not consume credit.
- Requests queue under load
- Generation speed: ~25 chars/sec
Error Handling
Error responses return standard HTTP status codes to indicate failure. A 400 error typically signals invalid input, such as exceeding the 4096-character limit or using an invalid parameter. A 401 error indicates an invalid or expired authentication key. These errors do not consume your character balance.
The API returns a JSON object with an error message and code. Always check the code field for specific details, such as text_too_long or invalid_voice. Logging these codes helps automate debugging without manual intervention.
Common HTTP errors
400 Bad Request occurs when the JSON body is malformed or parameters are out of range. For example, setting speed outside 0.25–4.0 triggers this. 401 Unauthorized means your Bearer token is missing or invalid. 429 Too Many Requests indicates you have exceeded the 60 requests per minute limit.
- 400: Invalid input (e.g., speed range, character limit)
- 401: Invalid or missing API key
- 429: Rate limit exceeded
Retry logic
Implement exponential backoff for transient errors like 429 or 500. Since requests are processed sequentially, high load may cause temporary delays. Retry up to three times with increasing delays (e.g., 1s, 2s, 4s) before failing. Do not retry on 400 errors, as they will fail repeatedly.
- Use exponential backoff for 429 and 500 errors
- Retry max 3 times before failing
- Do not retry 400 errors
Billing error states
If a synthesis fails due to a technical error, the charge is returned in full. However, if you request an invalid voice or model, no charge occurs. Check your balance endpoint to verify credits. Failed requests do not appear in your character usage count.
- Technical failures refund the character cost
- Invalid parameters (400) do not consume credits
- Check balance endpoint for real-time status
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. News production teams often manage tight budgets and need predictable costs.
23 languages
Any voice speaks any of these languages.
