Frequently asked questions
How do I get an API key?
Sign up on the /get-api-key/ page using Google or email plus password. The dashboard displays your active API key, balance, and usage statistics. You can issue a new key at any time, which immediately invalidates the previous one. Each account is tied to a specific site.
What is the base URL for the API?
The API base URL is https://api.my36.info/v1. You send POST requests to https://api.my36.info/v1/audio/speech. Other endpoints like /v1/voices and /v1/models are also available at this base path for retrieving voice details and model information.
Which SDKs are compatible?
The request shape matches the OpenAI speech endpoint. Therefore, official OpenAI SDKs work by changing the base_url to https://api.my36.info/v1 and using your site-specific key. You can also use plain HTTP requests without any specific vendor SDK.
What is the character limit per request?
Each request supports a maximum of 4096 characters in the input field. For longer texts, you must split the content into chunks of up to 4096 characters. After generating audio for each part, you join the resulting audio files to create the final output.
How do I handle rate limits?
The limit is 60 requests per minute per key. Before your first top-up, the limit is 10 requests per minute. Failed requests are free. Monitor your usage in the dashboard to avoid throttling during high-volume generation.
What happens if the API is slow?
Requests are processed sequentially, so under load, a request may wait in a queue. Typical speed is roughly real-time, but short phrases take a few seconds. Longer texts generate at about 25 characters per second. Patience is required during peak usage times.
Can I use the OpenAI Python SDK?
Yes, the OpenAI Python SDK is compatible. You must configure the base_url to https://api.my36.info/v1 and provide your API key. The endpoint structure for speech generation is identical to OpenAI’s, allowing you to use standard methods with minimal code changes.
How do I specify a voice?
Include the voice parameter in your JSON body with one of eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. These voices are based on licensed recordings. You can retrieve the full list of available voices via the GET /v1/voices endpoint.
What is the default response format?
You can specify the response format using the response_format field. Supported formats include mp3, wav, opus, flac, and pcm. If not specified, the behavior depends on the client implementation.
How do I detect the language?
If the language field is omitted, the system guesses it from the script. Latin script defaults to English. For non-English Latin text, you must explicitly set the language parameter to an ISO code. Supported languages include Arabic, Chinese, French, German, and others.
Can I change the speed of the voice?
Yes, use the speed parameter to adjust playback speed between 0.25 and 4.0. This allows you to slow down narration for clarity or speed up content for quick reviews. The value is a float representing the multiplier relative to normal speech speed.
Is the API RESTful?
Yes, it is a standard RESTful API. You use POST for speech generation and GET for retrieving voices and models. Authentication is handled via the Authorization header. The endpoints follow standard HTTP methods and return JSON responses with audio data in the specified format.
How do I handle errors in my code?
Check the HTTP status code and response body for error details. Failed synthesis requests are free, and the charge is returned in full. Implement retry logic for temporary issues, but be mindful of the 60 requests per minute rate limit to avoid throttling.
Can I use this with JavaScript?
Yes, you can use plain JavaScript fetch API or any HTTP library. Configure the base_url to https://api.my36.info/v1 and send a POST request with your JSON payload. Include the Authorization header with your Bearer token to authenticate the request successfully.
First request
curl
curl https://api.my36.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.my36.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.my36.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 relies on a single active Bearer token per account, issued directly from the /get-api-key/ page. You can sign up via Google or email to access this dashboard, which displays your current key, balance, and usage statistics.
API Key Generation
Keys are generated on the /get-api-key/ page. Each account maintains only one active key at a time. If you generate a new key, the previous one stops working immediately, ensuring secure access control without complex permission layers.
Bearer Token Usage
Include your key in the Authorization header as Bearer tts-... for every request. This simple standard works seamlessly with the OpenAI SDK by setting the base URL to https://api.my36.info/v1. No additional authentication headers are required.
Key Rotation
Rotate your key anytime from the dashboard. The transition is instantaneous; the old key becomes invalid the moment the new one is issued. This allows you to revoke compromised credentials without waiting for manual approval or processing delays.
Endpoints
The API exposes three core endpoints for managing speech synthesis. The primary endpoint handles audio generation, while the others provide metadata about available voices and model configurations. All endpoints require valid authentication via the Bearer token.
Speech Generation
Send a POST request to /v1/audio/speech with your text and selected voice parameters. The endpoint returns the audio file directly in the requested format, such as mp3 or wav. Ensure the input text does not exceed 4096 characters per request to avoid truncation.
- Endpoint: POST /v1/audio/speech
- Accepts JSON body with model, input, voice, and speed
- Returns audio file in response body
Voice Listing
Use GET /v1/voices to retrieve a list of all available voice presets, their associated languages, and supported formats. This endpoint allows developers to dynamically populate dropdown menus in their applications, ensuring they select valid voice IDs before making synthesis requests.
- Endpoint: GET /v1/voices
- Returns voice ID, name, gender, and supported languages
- Includes format and pricing details for each voice
Model Details
The GET /v1/models endpoint provides details about the underlying TTS models, specifically 'tts-1' and 'tts-1-hd'. Both models use the same engine and pricing structure, offering flexibility in quality selection without affecting cost. This endpoint helps verify model availability and specifications.
- Endpoint: GET /v1/models
- Lists available models: tts-1 and tts-1-hd
- Includes model metadata and pricing equivalence
Request Parameters
The API accepts text input up to 4096 characters per request, with spaces and punctuation counting toward the limit. For longer course content, split the text into chunks and join the resulting audio files seamlessly.
Input Text Limits
Each request handles a maximum of 4096 characters. Exceeding this limit returns an error. To generate audio for lengthy lectures, divide the script into manageable segments and concatenate the output files.
Voice Selection
Choose from eight presets: Aria, Nova, Luna, Sage, Felix, Milo, Atlas, or Orion. Every voice supports all 23 listed languages. If the language field is omitted, the system guesses from the script, defaulting to English for Latin text.
- 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 playback speed between 0.25 and 4.0. Faster speeds compress delivery for quick reviews, while slower speeds aid comprehension for language learners. The default speed provides a natural, balanced pace suitable for most educational materials.
Response Formats
The API returns synthesized audio in the requested format via the response_format parameter. MP3 provides efficient compression suitable for web delivery, while WAV offers uncompressed PCM audio for direct integration into audio editors or learning management systems without quality loss.
MP3 Output
MP3 is a supported format, offering a balance between file size and audio fidelity. This format is suitable for embedding in course modules where bandwidth efficiency matters for large student cohorts.
WAV Output
WAV provides uncompressed, high-quality audio data. Use this format when you need raw audio files for post-production editing, quality assurance checks, or integration with systems that prefer standard PCM wave files over compressed codecs.
Lossless Formats
FLAC and OPUS are available for specialized use cases. FLAC provides lossless compression for archival purposes, while OPUS offers efficient compression suitable for voice-centric applications. PCM is also supported for raw data processing pipelines.
OpenAI SDK Integration
VoiceLayer is compatible with the official OpenAI SDKs. By overriding the base_url to https://api.my36.info/v1, developers can use the same client structure they already know. This eliminates the need to learn a proprietary library or write custom HTTP wrappers for basic speech synthesis.
The SDK handles the JSON request body and binary audio response transparently. You only need to provide your API key and configure the endpoint. This approach ensures that the request shape remains compatible with the OpenAI SDKs.
Base URL Configuration
Set the base_url parameter in your SDK client to https://api.my36.info/v1. This directs all requests to VoiceLayer’s infrastructure while maintaining standard OpenAI request shapes. Ensure your Authorization header includes your tts-... key.
SDK Compatibility
The official OpenAI SDKs work directly with this API. No custom client is required. The request payload matches the OpenAI speech endpoint exactly, including support for model, input, voice, response_format, and speed parameters.
Code Examples
- Use
openai.OpenAI(base_url='https://api.my36.info/v1', api_key='tts-...')to initialize the client. - Call
client.audio.speech.create()with standard parameters likemodel='tts-1'andvoice='nova'. - Handle the binary response to save audio files directly to your LMS media library.

Rate Limits
The API enforces a strict limit of 60 requests per minute per active key. Before your first top-up, this allowance is reduced to 10 requests per minute. These limits apply to the POST /v1/audio/speech endpoint specifically.
Requests Per Minute
Each request counts toward the 60 RPM quota. If you exceed this threshold, subsequent requests will be rejected until the window resets. New accounts without a top-up start with a lower limit of 10 requests per minute.
Queue Behavior
Requests are processed sequentially. Under load, a request may wait in a queue before synthesis begins. For long texts split into multiple parts, each part is processed one after another, which can extend total generation time.
Burst Handling
To avoid rejection during high-volume course creation, batch your requests carefully. Since shorter phrases take a few seconds and long texts generate at roughly real-time speed, plan your API calls to stay within the 60 RPM or 10 RPM limit depending on your account status.
Error Handling
The API returns standard HTTP status codes to indicate success or failure. Understanding these responses helps you quickly identify whether a request was processed, rejected due to validation errors, or failed during synthesis.
Common Error Codes
Use 400 for invalid parameters (e.g., voice not found), 401 for authentication issues, and 429 when you exceed the 60 requests per minute limit. Failed synthesis returns a 500-series error with a descriptive message.
- 400: Bad Request (invalid JSON or missing fields)
- 401: Unauthorized (invalid or expired API key)
- 429: Too Many Requests (rate limit exceeded)
- 500: Internal Server Error (synthesis failure)
Retry Logic
Implement exponential backoff for 429 and 500 errors. Since requests are processed sequentially, brief waits often resolve queue congestion. Failed requests are free, so retrying does not incur extra charges if the error persists.
- Wait 1 second, then 2, then 4 seconds before retrying.
Debugging Tips
Check the response body for detailed error messages. Verify that your API key is correct and that the input text does not exceed 4096 characters. Ensure the Authorization header uses the Bearer scheme correctly.
Best Practices
Optimizing your integration ensures reliable audio delivery for large student cohorts without unnecessary latency or errors. By adhering to specific limits and configuration rules, you can maintain consistent quality across your e-learning platform.
Text Chunking
Split input text into segments of up to 4,096 characters. Concatenate the resulting audio files to handle longer course materials efficiently.
- Maximum 4096 characters per request
- Join audio files sequentially for longer content
Language Detection
Set the language parameter explicitly for non-English Latin-script text to ensure accurate pronunciation. Without it, the API defaults to English for Latin characters.
- Default to English for Latin script
- Explicitly set ISO code for other languages
Audio Quality
Use tts-1-hd for higher fidelity or tts-1 for standard quality. Choose WAV or FLAC for lossless storage, or MP3/OPUS for efficient delivery.
- Select model based on quality needs
- Use lossless formats for archival
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. The raw text you submit is processed in real-time to produce the audio output.
23 languages
Any voice speaks any of these languages.
