Frequently asked questions
How do I get an API key?
Sign up on the /get-api-key/ page using Google or email. Google sign-ups receive a $0.50 trial credit valid for seven days. Email accounts start without trial credit. Your dashboard displays your active API key, current balance, and usage statistics immediately after registration.
What is the base URL?
The API base URL is https://api.new65thai.com/v1. Use this endpoint for all requests. The speech generation endpoint is POST https://api.new65thai.com/v1/audio/speech. This URL structure ensures compatibility with standard HTTP clients and SDKs configured for this specific domain.
Which SDKs are supported?
We do not provide an official SDK of our own. You can use the official OpenAI SDKs by changing the base_url to our API endpoint. Alternatively, use any standard HTTP client library. The request shape matches the OpenAI speech endpoint exactly, ensuring easy integration.
How do I send a request?
Send a POST request to /v1/audio/speech with a JSON body. Include the model, input text, voice preset, response format, and optional speed or language. Use the Authorization header with your Bearer token. The API returns the generated audio file directly in the response.
What are the rate limits?
Limits are 60 requests per minute per key. New accounts without top-ups are limited to 10 requests per minute. Requests are processed sequentially, so high load may cause queuing delays. Failed requests do not count toward your character limit or incur charges.
How do I handle errors?
If synthesis fails, the charge is returned in full. Monitor the HTTP status code and response body for error details. Ensure your text is under 4096 characters and your key is valid. Failed requests are free, so you can retry without cost.
What formats can I receive?
You can receive audio in mp3, wav, opus, flac, or pcm formats. Specify the desired format using the response_format field in your request. All formats are generated from the same engine. Choose based on your LMS compatibility and storage requirements.
Can I change the voice speed?
Yes, adjust the speed between 0.25 and 4.0. Set the speed parameter in your request JSON. This allows you to slow down instructional content for clarity or speed up reviews. The default speed is 1.0, providing natural pacing for most lessons.
How do I specify the language?
Pass the ISO code in the language field. If omitted, the system guesses the language, defaulting to English for Latin script. Explicitly setting the language ensures accuracy for non-English texts. Supported languages include Arabic, Chinese, English, French, German, Spanish, and others listed in our docs.
What is the max character limit?
Each request supports up to 4096 characters. For longer texts, split them into chunks of this size and join the resulting audio files. Spaces and punctuation count toward the limit. This ensures consistent processing speed and prevents timeouts during synthesis.
Do I need to install any libraries?
No specific library is required. Use any standard HTTP client or the OpenAI SDK. If using the OpenAI SDK, simply update the base_url configuration.
How is authentication handled?
Authentication uses a Bearer token in the Authorization header. Include your unique API key, starting with tts-, in every request. One active key exists per account. Ensure your key is transmitted securely via HTTPS to prevent unauthorized access to your account.
Can I use the same key for multiple projects?
Yes, one active key per account can be used across multiple projects. The rate limits apply per key, not per project. Monitor your usage and balance on the dashboard. If needed, you can issue a new key, which invalidates the old one immediately.
How do I rotate my API key?
Issue a new key from your account dashboard at any time. The new key becomes active immediately, and the old one stops working at once. This allows seamless rotation without downtime. Use the new key in your applications and discard the old one.
First request
curl
curl https://api.new65thai.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.new65thai.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.new65thai.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 |
Quick Start
Start by creating an account on our /get-api-key/ page using Google or email. You will receive a unique Bearer token and a starting balance of $0.50 if you sign in with Google, giving you about 50,000 characters to test with.
Get Your API Key
Navigate to the sign-up page to generate your key. Each account gets one active key; issuing a new one immediately invalidates the previous one, ensuring secure access for your LMS integration projects.
First cURL Request
Use this command to generate your first audio file. Replace YOUR_API_KEY with your token and adjust the voice or model as needed for your course content.
```bash curl -X POST "https://api.new65thai.com/v1/audio/speech" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Welcome to this lesson.", "voice": "nova"}' ```
Base URL Configuration
Set your base URL to https://api.new65thai.com/v1. This structure mirrors the standard OpenAI speech endpoint, allowing you to use familiar SDKs by simply swapping the base URL in your configuration.
Endpoints
Our API provides three core endpoints for generating audio and managing resources. The primary endpoint handles speech synthesis, while the others list available voices and model configurations.
Each endpoint follows standard REST principles, ensuring predictable behavior for instructional designers building LMS integrations.
Speech Generation
POST /v1/audio/speech accepts text and parameters to return an audio file. This is the main workflow for converting lesson content into audio.
The endpoint supports standard formats and speed adjustments, allowing you to tailor output for different course modules.
- Accepts JSON body with text, voice, and format
List Voices
GET /v1/voices returns all available voice presets, supported languages, and pricing details. Use this to select the most appropriate narrator for your content.
Any voice can speak any of the 23 supported languages.
- Returns voice IDs, names, and language support
List Models
GET /v1/models lists the available TTS models, such as tts-1 and tts-1-hd. These models share the same engine and price.
Select the model that best fits your latency and quality requirements.
- Lists model IDs and their characteristics
Request Parameters
The API accepts plain text as the core input, with a hard limit of 4,096 characters per request. Spaces and punctuation count toward this total, so plan your chunking strategy for longer lesson scripts. For texts exceeding this limit, split the content into multiple requests and join the resulting audio files sequentially.
You can optionally specify the ISO language code to ensure accurate synthesis, especially for Latin-script languages other than English. If omitted, the system guesses the language from the script, defaulting to English for Latin characters. Explicitly setting the language avoids mispronunciation in mixed-language course materials.
Input Text
Send your lesson content in the input field of the JSON body. Each request handles up to 4,096 characters. For longer modules, split the text and concatenate the output audio files to maintain continuity in your LMS.
Specify the language parameter if your text is not English, even if it uses Latin script. Without it, the system defaults to English, which may cause incorrect pronunciation for other supported languages.
- Maximum 4,096 characters per request
- Spaces and punctuation count as characters
- Optional
languageISO code parameter
Voice Selection
Choose from eight distinct voices tailored for educational content. Select sage for calm, instructional narration or nova for bright, upbeat explanations. Each voice is consistent across all 23 supported languages, ensuring uniformity in your course audio.
The voice parameter accepts specific presets like aria for warm narration or atlas for neutral news-style delivery. You can also adjust the speed parameter between 0.25 and 4.0 to fit your pacing needs.
- 8 presets available
- Adjustable speed: 0.25–4.0
- Consistent voices across 23 languages
Response Format
Generate audio in MP3, WAV, OPUS, or FLAC formats. MP3 is recommended for web playback and smaller file sizes, while WAV offers uncompressed quality for editing. OPUS provides efficient compression.
PCM is available for raw audio data. Choose the format that best integrates with your LMS player. All generated files include an inaudible watermark identifying them as synthetic speech.
- MP3, WAV, OPUS, FLAC, PCM
- MP3 for web efficiency
- WAV for uncompressed editing
Response Formats
Your API response returns the generated audio file directly in the body, with the Content-Type header indicating the format you selected. This structure allows you to save the file immediately or pipe it into your LMS player without additional decoding steps.
MP3
MP3 is the default and most compatible format for web players and Learning Management Systems. It offers a good balance between file size and quality, making it suitable for standard course modules.
WAV
WAV provides uncompressed, high-fidelity audio. Use this format when you need raw audio for editing in professional tools or when your LMS requires lossless playback without compression artifacts.
Opus and FLAC
Opus provides efficient compression, while FLAC provides lossless quality. Choose Opus for bandwidth-efficient delivery or FLAC for archival-quality audio storage.
Error Handling
API responses include standard HTTP status codes to indicate success or failure. A 200 OK status confirms that your audio file has been generated and is ready for download. Any non-200 status indicates an issue that requires attention before retrying.
Common errors include server-side failures during synthesis, which typically resolve upon retry. Network timeouts may occur if the connection drops during large file transfers. Always check the response body for a detailed error message describing the specific issue.
Common Errors
Most errors are transient. If you receive a 500 or 502 error, wait a few seconds and retry the request. Persistent errors usually indicate a configuration mistake, such as an invalid voice ID or an unsupported response format.
Ensure your input text does not exceed the 4,096 character limit per request. If your lesson text is longer, split it into smaller chunks before sending.
- 400 Bad Request: Invalid parameters or missing fields.
- 401 Unauthorized: Invalid or expired API key.
- 429 Too Many Requests: Rate limit exceeded.
- 500/502 Server Errors: Temporary synthesis failure; retry after delay.
Rate Limit Errors
You are limited to 60 requests per minute per API key. If you exceed this limit, you will receive a 429 status code. Requests are processed sequentially, so high volumes may cause queuing delays.
Before your first top-up, the limit is stricter at 10 requests per minute. Once you add USDT via TRC-20, the standard limit applies immediately.
- 429 Too Many Requests: You have exceeded the 60 requests/minute limit.
- Retry-After: The response header indicates how many seconds to wait before retrying.
Invalid Input
If the input text contains unsupported characters or exceeds the character limit, the API will reject the request. Ensure your text is properly encoded as UTF-8.
Voice IDs must match one of the eight available presets. Using an unrecognized voice ID will result in a 400 error. Check the /v1/voices endpoint for the current list of valid voices.
- 400 Bad Request: Input text exceeds 4,096 characters.
- 400 Bad Request: Invalid voice ID specified.
- 400 Bad Request: Unsupported response format requested.
Rate Limits
Each API key allows 60 requests per minute, enabling steady audio generation for course modules. Failed requests are free: if synthesis fails, the charge is returned in full.
Requests Per Minute
The standard limit is 60 requests per minute per active key. This capacity supports typical instructional design workflows, such as generating multiple voiceovers for a single lesson in quick succession.
Pre-Top-Up Limits
New accounts start with a lower limit of 10 requests per minute until the first top-up is processed. The free trial credit ($0.50) is subject to this initial restriction.
Queue Behavior
Requests are processed sequentially. Under load, additional requests may wait in a queue before synthesis begins. Longer texts typically process at roughly real-time speed, so plan your batch sizes accordingly to avoid delays.
SDK Integration
The API endpoint mirrors the OpenAI speech structure, allowing you to reuse existing codebases. Simply update the base URL to our API domain and supply your API key. This compatibility extends to standard HTTP libraries and the official OpenAI SDKs.
You can switch between the standard and HD models by changing the model field. The request body remains identical, ensuring a smooth transition from testing to production environments without significant refactoring efforts.
OpenAI SDK Usage
Import the official OpenAI client library and configure it to point to our endpoint. Pass your API key in the standard authorization header. The library handles JSON serialization and response parsing exactly as it would for OpenAI, requiring minimal code changes.
This approach works for any language supported by the OpenAI SDK. You can test locally before deploying to your LMS integration layer, ensuring consistent behavior across different environments.
- Use the standard
openaipackage - Set
base_urltohttps://api.new65thai.com/v1 - Pass
Authorization: Bearer tts-...in headers
Base URL Change
The base URL determines where your requests are sent. Update it to https://api.new65thai.com/v1 in your SDK configuration object. This single change routes all speech generation requests to our infrastructure while maintaining the expected request shape.
Other endpoints like /v1/voices and /v1/models follow the same domain structure. You can list available voices or check model details using the same SDK instance, just by appending the specific path to the base URL.
- Base URL: https://api.new65thai.com/v1
- Consistent request shape across all endpoints
- No custom client required
Library Compatibility
Any library that supports standard RESTful JSON requests works with our API. You do not need a proprietary client or a specific version of a third-party tool. Plain HTTP requests using curl or requests work identically to the SDK approach.
The response format is standard audio data returned in the HTTP response body. Libraries that handle binary data or file streams can save the output directly to disk or stream it to your audio player component without intermediate processing steps.
- Works with any REST client
- Standard JSON request body
- Binary audio response handling
Authentication
Authentication is handled via a single active API key per account, issued on your dashboard. Pass this key in the Authorization: Bearer <key> header with every request to verify your identity and track usage against your balance.
Bearer Token
Include your key exactly as provided. Ensure no extra spaces are added. The token grants full access to your account’s character quota and billing data.
Key Rotation
You can generate a new key at any time from the dashboard. The previous key stops working immediately, ensuring no overlap or confusion. This is useful if you suspect exposure or need to revoke access for a specific integration.
- Generate new key in dashboard
- Old key invalidates instantly
- No downtime during rotation
Security Best Practices
Treat your API key like a password. Do not commit it directly to public GitHub repositories. Use environment variables in your LMS plugin or server-side scripts to keep it hidden from end-users.
Since only one key is active, rotate it promptly if shared across multiple team members. Email support is available if you need to report a compromised key.
- Use environment variables
- Avoid public repositories
- Rotate if compromised
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. The platform simplifies course creation, allowing educators to design engaging learning experiences for their students.
23 languages
Any voice speaks any of these languages.
