Frequently asked questions
How do I get an API key?
Sign up on the /get-api-key/ page using Google or an email and password. The page displays your active API key, balance, and usage details. You can issue a new key at any time, which immediately invalidates the previous one. Each account is tied to a single active key for authentication.
Can I use the OpenAI SDK with this API?
Yes. The API uses the same request shape as the OpenAI speech endpoint. You can use official OpenAI SDKs by changing the base_url to https://api.k101.info/v1 and providing your site-specific key. This allows seamless integration into existing workflows without requiring custom client libraries or complex configuration changes.
What is the base URL for the API?
The base URL is https://api.k101.info/v1. You should configure your client to send POST requests to https://api.k101.info/v1/audio/speech. This endpoint accepts JSON bodies containing the model, input text, voice selection, and optional parameters like speed and response format for audio generation.
How do I specify a voice in the request?
Include the voice field in your JSON body with one of the eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. You can also optionally set the language field to an ISO code. If omitted, the system guesses the language, defaulting to English for Latin script.
What audio formats are supported?
You can request audio in mp3, wav, opus, flac, or pcm formats. Specify the desired format using the response_format field in your request body. The API returns the generated audio file directly in the response, allowing you to save it immediately without additional conversion steps.
What happens if I exceed the rate limit?
The limit is 60 requests per minute per key (10 per minute before the first top-up). Requests are processed sequentially, so exceeding the limit may cause your request to wait in a queue. If synthesis fails due to errors, the request is not charged to your balance.
How do I handle long text for course modules?
Split your text into parts of up to 4096 characters. Send each part as a separate request to the API. Then, join the resulting audio files to create the final course module audio. This ensures each request stays within the character limit and maintains consistent quality.
Are errors charged to my account?
No. If synthesis fails, the charge is returned in full. You only pay for successful requests. Failed requests do not deduct from your balance, ensuring you are only charged for usable audio files. This applies to any error returned by the API during processing.
Can I rotate my API key?
Yes. You can issue a new API key at any time from your account page. When a new key is generated, the old one stops working immediately. This allows you to secure your account without downtime, as the new key becomes active right away.
How do I set the speed of the speech?
Use the speed field in your request body. Acceptable values range from 0.25 to 4.0. This allows you to adjust the playback speed of the generated audio to suit your content. Default speed is 1.0, but you can customize it for faster or slower narration.
Is there a limit on the number of characters per request?
Yes, each request supports up to 4096 characters of input text. If your content exceeds this limit, you must split it into multiple requests. Each request is processed independently, so you will receive separate audio files that you can concatenate to form the complete audio track.
Do I need to install any specific libraries?
No. You can use plain HTTP requests or the official OpenAI SDK. No proprietary libraries or SDKs are required; use the official OpenAI SDK or plain HTTP. Simply send a POST request with the correct JSON body and authentication header. This makes integration straightforward for developers using any standard programming language or framework.
How do I authenticate my requests?
Include an Authorization: Bearer tts-... header in your HTTP requests. Use the API key provided on your /get-api-key/ page. Each account has one active key at a time. Ensure the key is valid and not expired to avoid authentication errors during your API calls.
What is the difference between tts-1 and tts-1-hd?
Both models use the same engine and have the same price. Both models use the same engine and price, offering identical audio quality. Both accept the same parameters and produce audio files with similar characteristics, allowing you to choose based on your quality preferences.
First request
curl
curl https://api.k101.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.k101.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.k101.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 |
Get Your API Key
Access the /get-api-key/ page on k101.info to create your account. You can register using Google or a standard email and password combination. This account is specific to this site and provides the necessary credentials for API access.
Once registered, the dashboard displays your active API key, current balance, and usage statistics. You can immediately copy the key to begin making requests to the cloud TTS endpoint.
Sign Up on the Site
Visit the sign-up page to create your account. Support is available via email only; there is no phone or live chat option. Accounts are isolated per site, so your credentials here are distinct from other providers.
New accounts created with email and password start without trial credit. Signing in with Google provides $0.50 of credit (approx. 50,000 characters) valid for 7 days.
- Sign up via Google or email/password
- Email-based support only
- Per-site account isolation
Retrieve Your Key
The dashboard on /get-api-key/ shows your unique API key. Use this key in the Authorization header as Bearer <key> for all requests. You can generate a new key at any time from this same page.
Each account has one active key at a time. The page also displays your current balance, characters used, and a ready-to-use cURL example for immediate testing.
- Key displayed on the dashboard
- Header format: Authorization: Bearer tts-...
- One active key per account
Key Expiration and Rotation
API keys do not expire automatically. You can issue a new key at any time via the dashboard. When a new key is generated, the old one stops working immediately.
This allows you to rotate credentials quickly if needed without downtime. There is no need to update your LMS integration during rotation, as you simply switch the key in your configuration.
- No automatic expiration
- Old key stops immediately on rotation
- Instant credential update
First Request with cURL
You can test the API immediately using any command-line tool. This section shows how to generate audio from a simple text string using a standard cURL command. You will receive a binary audio file that you can save directly to your local drive.
The process requires a valid API key and specific parameters. Ensure your key is active and that you are sending requests to the correct endpoint. This guide uses the base URL specific to this storefront.
Basic cURL Command
Run the following command to generate speech. Replace YOUR_API_KEY with your actual key from the dashboard.
curl -X POST https://api.k101.info/v1/audio/speech -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "tts-1", "input": "Hello world.", "voice": "aria", "response_format": "mp3"}' -o output.mp3
This command sends a POST request to the speech endpoint. The server processes the text and returns the audio file as binary data, which is saved to output.mp3.
Required Parameters
You must provide model, input, voice, and response_format. The model accepts 'tts-1' or 'tts-1-hd'. The input field contains your text, up to 4096 characters. Choose a voice from the eight presets, such as 'aria' or 'felix'.
The response_format determines the output type. Valid options are mp3, wav, opus, flac, or pcm. The language parameter is optional but recommended for non-English Latin text to ensure correct pronunciation, as Latin text defaults to English.
- model: tts-1 or tts-1-hd
- input: text string (max 4096 chars)
- voice: one of 8 presets
- response_format: mp3, wav, opus, flac, pcm
Response Format
On success, the API returns a 200 OK status with the audio file in the response body. The content type matches your requested format. Save this output to a file for use in your LMS or course player.
If an error occurs, the response contains a JSON object with an error message. Check the status code to diagnose issues like invalid keys or rate limits.
Using the OpenAI SDK
The OpenAI Python SDK provides a straightforward way to integrate LMS Speech API into your course generation pipeline. By adjusting the base URL, you can use standard methods like client.audio.speech.create without learning a new interface, ensuring consistent behavior across different environments.
Install the OpenAI Package
Install the official package via pip to access the necessary client classes. This library handles the JSON serialization and response parsing automatically, reducing boilerplate code in your LMS plugin or backend service.
Set Base URL
Configure the client to point to our endpoint instead of OpenAI’s servers. Set the base URL to https://api.k101.info/v1 so all requests route correctly to the LMS Speech API infrastructure.
Make a Speech Request
Pass your API key and model parameters to generate audio. The SDK returns a binary stream or file object that you can save directly as an MP3, WAV, OPUS, FLAC, or PCM for your course modules.
Request Parameters Explained
The API accepts two model identifiers, both powered by the same underlying engine. Selecting either "tts-1" or "tts-1-hd" yields identical audio quality and pricing, allowing you to switch configurations without impacting your budget or output consistency for course modules.
Model Selection (tts-1, tts-1-hd)
Both models use the same voice synthesis engine, ensuring consistent audio quality across your LMS. The pricing remains identical regardless of which identifier you choose, simplifying cost calculations for bulk content generation.
Voice Presets
Choose from eight distinct presets tailored for different instructional styles. Use "sage" for calm, instructional segments or "atlas" for neutral news-style updates. Each voice supports all 23 languages, allowing you to maintain brand consistency across international courses.
- aria: warm, clear narrator
- nova: bright, upbeat
- luna: soft, storytelling
- sage: calm, instructional
- felix: energetic, promo
- milo: friendly, conversational
- atlas: neutral, news
- orion: deep, documentary
Speed Control
Adjust the speech rate between 0.25 and 4.0 to match listener preferences. Slower speeds aid comprehension for complex topics, while faster rates suit quick reviews. The API processes requests sequentially, so extreme speeds may slightly affect queue times during high load.
Audio Formats and Output
The API supports standard audio containers for immediate playback and editing. You can choose MP3 for small file sizes, WAV for lossless quality, or FLAC for compressed lossless storage. These formats suit most LMS players and audio editors.
Each generated file carries an inaudible watermark marking it as synthetic speech. This helps identify cloud-generated content in your course materials without affecting playback.
Supported Formats (MP3, WAV, etc.)
Select the format that best fits your LMS player capabilities. MP3 offers broad compatibility with minimal storage. WAV provides uncompressed audio for high-fidelity needs. FLAC ensures lossless compression without quality loss.
- mp3: Standard compressed audio
- wav: Lossless uncompressed audio
- flac: Lossless compressed audio
PCM for Raw Data
PCM returns raw linear audio without container overhead. This format is ideal for direct processing in custom audio pipelines or low-level audio applications where you need the raw byte stream.
Opus for Compression
Opus provides efficient compression suitable for web streaming and modern browsers. It balances file size and quality, making it a good choice for mobile course delivery where bandwidth is limited.

Error Handling and Status Codes
The API returns standard HTTP status codes to indicate the result of your synthesis request. A 200 OK response includes the audio file directly in the body. Other codes indicate specific failures that require different handling strategies.
Common errors include 400 Bad Request for malformed JSON, 401 Unauthorized for invalid keys, and 500 Internal Server Error for temporary processing issues. Always check the response body for a descriptive message explaining the failure.
Common Error Messages
When a request fails, the API returns a JSON object with an error code and a human-readable message. For example, a 401 error indicates your API key is invalid or expired. A 503 error suggests temporary service overload or maintenance.
- 400 Bad Request: Invalid JSON syntax or missing required fields.
- 401 Unauthorized: Invalid, expired, or revoked API key.
- 404 Not Found: Incorrect endpoint URL.
- 500 Internal Server Error: Unexpected server-side issue.
- 503 Service Unavailable: Temporary overload or maintenance.
Rate Limit Errors
If you exceed 60 requests per minute, the API returns a 429 Too Many Requests status. Your key is limited to 10 requests per minute until the first top-up is credited. Ensure your client implements exponential backoff to handle these limits gracefully.
- 429 Too Many Requests: Exceeded 60 requests/minute limit.
- Retry-After header: Indicates seconds to wait before retrying.
- Initial limit: 10 requests/minute for new keys without top-up.
Invalid Input Errors
The API validates input text length and voice availability. If the text exceeds 4096 characters, you receive a 400 error. Similarly, using an unsupported voice ID or an invalid response format triggers a 400 error. Ensure the text is within limits before sending.
- 400 Bad Request: Input text exceeds 4096 characters.
- 400 Bad Request: Invalid voice ID specified.
- 400 Bad Request: Unsupported response format.
- 400 Bad Request: Speed value outside 0.25–4.0 range.
Rate Limits and Quotas
The API enforces a hard limit of 60 requests per minute per key to ensure stable service for course production pipelines. This quota applies uniformly regardless of text length or voice model, meaning that processing large course modules requires careful request pacing to avoid throttling during peak synthesis times.
60 Requests Per Minute
Each API key is capped at 60 requests per minute. If your LMS triggers multiple simultaneous synthesis jobs, excess requests will queue or return a 429 error. Monitor your usage dashboard to align batch sizes with this throughput limit, ensuring consistent audio generation for your training content without unexpected delays.
Initial Limit for New Keys
New API keys start with a lower limit of 10 requests per minute. This applies until you complete your first top-up. Once a minimum $5 USDT transfer is confirmed, the limit automatically increases to the standard 60 requests per minute. This ensures system stability for newly onboarded developers.
Burst Handling
Requests exceeding the per-minute limit are processed sequentially in a queue. Under load, synthesis may take longer than the typical real-time speed. To handle bursts effectively, split large texts into smaller chunks and stagger submission times. Use the /v1/voices endpoint to verify available voices before batching.
Handling Long Text for Courses
Course transcripts often exceed the 4096-character limit per request. You must split your source text into smaller segments before sending them to the API, ensuring each chunk fits the constraint.
Split Text into 4096 Char Chunks
Divide your script into parts of up to 4096 characters. This limit includes spaces and punctuation. Send each segment as a separate POST request to the speech endpoint.
Join Audio Files
The API returns individual audio files for each chunk. You must concatenate these files in the correct order to reconstruct the full course narration. Use standard audio libraries to merge the streams seamlessly.
Manage Queue Times
Requests are processed sequentially. Under load, later chunks may wait in a queue. Plan your generation window accordingly, as processing speed is roughly real-time for long texts, though requests may wait in a queue under load.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Reliable voice selection allows educators to match tone to content, whether it is instructional guidance or narrative storytelling.
23 languages
Any voice speaks any of these languages.
