Frequently asked questions
What is the exact JSON structure for the request body?
The request body is a JSON object containing the fields model, input, voice, response_format, speed, and language. The model field accepts "tts-1" or "tts-1-hd". The input field contains the text string to be synthesized. The voice field specifies one of the eight available presets. The response_format determines the output audio format. The speed field adjusts playback rate between 0.25 and 4.0. The language field is optional and accepts an ISO code.
How do I set the language explicitly?
Include the language field in your request body with the desired ISO language code. If omitted, the system guesses the language from the text script, defaulting to English for Latin script. Explicitly setting the language is recommended for non-English Latin-script text to ensure accurate synthesis. The API supports 23 languages, including Arabic, Chinese, English, and Spanish. Any voice can speak any of these supported languages regardless of the voice preset.
What is the maximum character limit per request?
The maximum character limit per request is 4096 characters. This limit includes spaces and punctuation. If your text exceeds this limit, you must split it into smaller parts. Each part should be sent as a separate request. The resulting audio files can then be joined to form the complete audio. This ensures compliance with the API constraints while allowing for longer content generation.
Can I use the OpenAI JavaScript SDK?
Yes, you can use the official OpenAI SDKs. To do this, change the base_url to https://api.do666ok.com/v1. Use your API key for authentication. The request shape is identical to the OpenAI speech endpoint. This allows seamless integration with existing codebases that already use OpenAI SDKs. No custom client library is required for basic functionality.
How does the speed parameter affect the audio?
The speed parameter adjusts the playback rate of the generated audio. It accepts values between 0.25 and 4.0. A value of 1.0 is the default speed. Lower values slow down the speech, while higher values increase the pace. This allows for fine-tuning the audio to match specific application requirements, such as language learning exercises or faster narration.
What happens if I exceed the rate limit?
The rate limit is 60 requests per minute per API key. Before the first top-up, the limit is 10 requests per minute. If you exceed this limit, requests may be queued or rejected. Requests are processed sequentially, so under load, a request may wait in a queue. Failed requests do not incur charges. Ensure your application handles rate limit errors appropriately.
Is the API key sensitive information?
Yes, the API key is sensitive. It authenticates your requests to the API. Include it in the Authorization: Bearer tts-... header. Each account has one active key. If you issue a new key, the old one stops working immediately. Protect your key to prevent unauthorized usage of your balance. Do not expose it in client-side code if possible.
How do I handle large texts exceeding 4096 characters?
Split the text into parts of up to 4096 characters each. Send each part as a separate request to the API. Receive the audio files for each part. Join the audio files sequentially to create the final output. This workflow ensures that long texts are processed correctly within the character limit constraints of the API.
What is the default voice if none is specified?
The documentation does not specify a default voice preset. You must explicitly provide the voice field in the request body. The available voices are aria, nova, luna, sage, felix, milo, atlas, and orion. Selecting a voice ensures consistent audio output. Omitting the voice field may result in an error or undefined behavior depending on the implementation.
Does the API support SSML tags?
No, the API does not support SSML tags. The input is plain text. There is no support for phoneme dictionaries or custom pronunciation lexicons. Emotion tags are also not supported. The API focuses on simple text-to-speech conversion. For more complex audio structures, you must manage them externally or use the speed and voice parameters.
How do I interpret the response headers?
The response headers contain metadata about the request. The response body contains the audio data in the specified format. Check the headers for any error codes or status information. Use this information to debug issues or track usage. The headers do not contain billing details; those are available in your account dashboard.
Can I request audio in Opus format?
Yes, you can request audio in Opus format. Set the response_format field to "opus". Other supported formats include mp3, wav, flac, and pcm. Opus is a efficient codec suitable for many applications. Choose the format that best fits your application's requirements and compatibility needs. The API will return the audio data in the requested format.
What is the difference between tts-1 and tts-1-hd?
Both "tts-1" and "tts-1-hd" use the same engine and have the same price. The distinction is primarily in the model identifier. There is no difference in functionality or cost. You can use either model for your requests. The choice between them does not affect the audio quality or processing time. Both models support all available voices and languages.
How do I rotate my API key?
You can issue a new API key at any time from your account dashboard. When a new key is issued, the old key stops working immediately. This ensures that only the new key is active. Rotate your key to enhance security or after a potential compromise. The transition is instantaneous, so update your applications to use the new key promptly.
Is there a webhook for completion notifications?
No, the API does not support webhooks for completion notifications. Requests are processed synchronously. You receive the audio file directly in the response. There is no asynchronous notification mechanism. If you need to process large texts, you must manage the splitting and joining logic in your application. The API does not provide a way to track background job status.
Can I stream the audio response directly?
No, the API does not support streaming or WebSocket connections. The audio is returned as a complete file in the response. There is no real-time partial audio generation. You must wait for the entire audio file to be generated before receiving it. This is suitable for most batch processing scenarios but not for real-time interactive applications.
What models are available via the /v1/models endpoint?
The /v1/models endpoint lists the available models. Currently, the models are "tts-1" and "tts-1-hd". Both models use the same engine and pricing. You can query this endpoint to verify the available models programmatically. The endpoint provides a standardized list of models supported by the API. Use this information to configure your client applications correctly.
How do I list all available voices?
Use the GET /v1/voices endpoint to list all available voices. This endpoint returns information about the voices, languages, formats, and prices. You can use this data to populate your application's voice selection interface. The voices include aria, nova, luna, sage, felix, milo, atlas, and orion. Each voice has distinct characteristics suitable for different use cases.
What is the content type of the response?
The content type of the response depends on the response_format parameter. If you request mp3, the content type is audio/mpeg. For wav, it is audio/wav. For opus, it is audio/opus. For flac, it is audio/flac. For pcm, it is audio/pcm. Ensure your client application handles the binary data correctly based on the content type.
Are there any CORS restrictions for browser requests?
The documentation does not specify CORS restrictions. Typically, API endpoints allow cross-origin requests from browsers. However, you should verify this by testing a request from your domain. If CORS issues arise, you may need to configure your client to handle preflight requests. The API does not provide specific CORS headers in the facts provided.
How do I debug a 401 unauthorized error?
A 401 error indicates an authentication issue. Check that your API key is correct and included in the Authorization: Bearer header. Ensure the key is active and has not been revoked. Verify that the key has sufficient balance or trial credit. If the key was recently rotated, ensure you are using the new key. Contact support via email if the issue persists.
What is the timeout duration for requests?
The documentation does not specify a exact timeout duration. Requests are processed sequentially, so under load, a request may wait in a queue. Typical speed is roughly real time, about 25 characters per second. Short phrases take a few seconds. Set a reasonable timeout in your client to handle potential delays due to queueing or processing time.
Can I use this API with serverless functions?
Yes, the API can be used with serverless functions. Since it is a standard REST API, you can call it from any serverless environment. Ensure your serverless function has network access to api.do666ok.com. Manage the API key securely within the function environment. Be aware of the execution time limits of your serverless platform, as long texts may take time to process.
How do I calculate the cost before sending the request?
The cost is $0.01 per 1,000 characters. Count the characters in your input text, including spaces and punctuation. Divide by 1,000 and multiply by 0.01 to get the cost. Failed requests are free, so you only pay for successful synthesis. This allows you to estimate costs accurately before sending requests. Monitor your balance in the account dashboard.
Is the API rate-limited per IP or per key?
The API is rate-limited per API key, not per IP address. Each key has a limit of 60 requests per minute. Before the first top-up, the limit is 10 requests per minute. This allows multiple clients using the same key to share the rate limit. Rotate keys if you need higher throughput from different IP addresses.
What encoding is used for the input text?
The input text is typically UTF-8 encoded. The API accepts text in various languages, including those with non-Latin scripts. Ensure your client sends the text in UTF-8 format. The API does not support SSML, so the text should be plain. Special characters and punctuation are counted as characters for billing purposes.
Can I mix voices in a single audio file?
No, the API does not support mixing voices in a single audio file. Each request generates audio with a single voice preset. To create a multi-voice audio file, you must generate separate audio files for each voice and join them manually. This requires additional processing in your application to concatenate the audio segments.
How do I verify the synthetic watermark?
Every generated file carries an inaudible watermark that marks it as synthetic speech. The watermark is embedded in the audio data. You may need a specific tool or library to detect and verify the watermark. The API does not provide a direct endpoint for watermark verification. The presence of the watermark indicates that the audio was generated by the TTS API.
Is there a test endpoint for sandboxing?
No, there is no separate test endpoint for sandboxing. The same API endpoint is used for both testing and production. You can test your integration using your API key. Failed requests do not incur charges, allowing you to test freely. Use your trial credit or small top-ups to test in a production-like environment.
First request
curl
curl https://api.do666ok.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.do666ok.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.do666ok.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
Authentication is managed via a single active Bearer token per account, issued upon registration. The token format is tts-<unique_id>. This key authorizes all API requests and is displayed on the /get-api-key/ dashboard alongside your current balance and usage metrics.
Bearer Token Format
Include the token in the Authorization header of every request as Bearer tts-.... The format is strictly case-sensitive and must not contain trailing spaces. Only one key is active at any given time.
- Format: Bearer tts-<unique_id>
- Single active key per account
Key Generation Steps
Sign up via Google or email/password on /get-api-key/. The system automatically generates your first API key. If using email registration, no trial credit is included; Google sign-in includes $0.50 valid for 7 days.
Key Rotation Process
Generate a new key from the dashboard at any time. The previous key becomes invalid immediately upon creation of the new one. Update your client configuration to use the new token to avoid 401 errors.
Speech Endpoint
The core synthesis endpoint accepts POST requests to generate audio files from text input. The API processes character strings up to 4,096 characters per request, returning the resulting audio file in the response body. For texts exceeding this limit, clients must split the input into chunks and concatenate the resulting audio files.
POST Request Structure
Requests are sent to POST https://api.do666ok.com/v1/audio/speech with a JSON body. The structure mirrors the OpenAI speech endpoint, allowing standard OpenAI SDKs to function by updating the base URL. The request must include authentication headers and valid model identifiers.
Required Parameters
The request body must contain the model parameter, accepting either "tts-1" or "tts-1-hd". Both models use the same engine and pricing tier. The input field is mandatory, containing the text string to be synthesized, limited to 4096 characters. Spaces and punctuation count toward this limit.
- model: "tts-1" or "tts-1-hd"
- input: string (max 4,096 characters)
Optional Parameters
Additional configuration options include voice (one of eight presets), response_format (mp3, wav, opus, flac, pcm), and speed (0.25–4.0). The language parameter accepts an ISO code to override automatic script detection, which defaults to English for Latin-script text if unspecified.
- voice: preset ID string
- response_format: mp3, wav, opus, flac, or pcm
- speed: float between 0.25 and 4.0
- language: ISO code (optional)
Voice Configuration
Voice selection determines the acoustic character of the generated audio. The API provides eight distinct presets, categorized by gender and tonal quality, allowing precise alignment with your application's context.
Available Voice IDs
Select from eight licensed voices derived from LibriTTS-R and LibriVox recordings.
- 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 Range Limits
Adjust playback speed between 0.25 and 4.0 to match learner proficiency. Slower speeds aid pronunciation analysis, while faster rates simulate natural conversation flow for advanced users.
Language Code Usage
Specify the ISO language code to ensure accurate phoneme generation. If omitted, the system guesses the language, defaulting to English for Latin-script text. Explicitly setting the language prevents mispronunciation in multilingual datasets.
Response Formats
The API returns synthesized audio in the specified format via the HTTP response body. The default response format is MP3. WAV and FLAC provide lossless audio data.
MP3 Output
MP3 is the default response format, offering a balance between file size and audio quality.
WAV and FLAC Options
WAV and FLAC formats provide uncompressed, lossless audio data.
PCM Raw Data
The PCM format returns raw linear pulse-code modulation audio data without container overhead.
Rate Limits
Rate limits enforce a cap of 60 requests per minute per active key. This limit applies uniformly across all endpoints.
Requests Per Minute
Each API key is restricted to 60 requests per minute. Exceeding this threshold results in a 429 Too Many Requests error. Requests are processed sequentially, so sustained high-volume usage may introduce minor latency.
- Limit: 60 requests/minute per key
- Status: 429 when exceeded
- Processing: Sequential queue
Pre-Trial Limits
New accounts without a top-up are limited to 10 requests per minute. This lower limit applies until the first USDT top-up is credited. Top-ups via TRON network (TRC-20) are processed automatically within minutes.
- Base limit: 10 requests/minute
- Upgrade: After first top-up
- Crediting time: Minutes
Queue Behavior
Requests are processed one after another. Under load, a request may wait in a queue before synthesis begins. Typical speed is roughly real-time, but short phrases may take a few seconds due to queueing.

Error Handling
Errors are returned as standard JSON objects containing an error field with a code and message. Failed synthesis requests incur no charge, and the cost is returned in full. This ensures that transient infrastructure issues do not impact your billing accuracy.
The API uses standard HTTP status codes to indicate success or failure. Understanding these codes allows your application to distinguish between client-side configuration errors and server-side processing limits.
HTTP Status Codes
The API returns 200 OK for successful synthesis. Use 400 Bad Request for invalid parameters or malformed JSON. 401 Unauthorized indicates an invalid or expired API key. 429 Too Many Requests signals that you have exceeded the rate limit of 60 requests per minute.
- 200: Request processed successfully
- 400: Invalid input or missing fields
- 401: Invalid API key
- 429: Rate limit exceeded
Common Error Messages
Error responses include a descriptive message to aid debugging. Common issues include exceeding the 4096 character limit per request or providing an unsupported voice ID. If the language parameter conflicts with the text script, the system may reject the request.
- Input text exceeds 4096 characters
- Invalid voice ID specified
- Unsupported response format requested
Retry Logic
Implement exponential backoff for 429 responses. Since requests are processed sequentially, high load may cause queuing delays. Retry after a short delay, but avoid aggressive loops that may exacerbate congestion. Failed requests are free, so immediate retries on permanent errors (4xx) are safe.
SDK Integration
The API is compatible with the official OpenAI SDKs, allowing you to leverage existing codebases with minimal adjustments. By updating the base URL, you can utilize standard client libraries to interact with the speech endpoint directly.
OpenAI Python SDK Setup
Install the standard library via pip. The package provides the necessary classes to handle JSON payloads and audio responses efficiently without requiring custom HTTP clients.
- pip install openai
Base URL Configuration
Set the base URL to https://api.do666ok.com/v1. This directs requests to the correct endpoint while maintaining the standard request shape expected by the SDK.
Client Initialization
Initialize the client with your API key and the configured base URL. The key is passed as a Bearer token, ensuring authenticated access to the speech generation endpoint.
Curl Examples
The following examples demonstrate standard integration patterns for the EchoLingua TTS API. These commands verify connectivity and confirm correct payload formatting for your language learning application.
Basic Request Example
This request generates a short audio file using the Aria voice. It verifies that your API key authenticates correctly against the endpoint.
Advanced Configuration
Specify the language code to prevent automatic guessing. Use the HD model.
Batch Processing Logic
Split input text into 4096-character segments. Process each segment sequentially to ensure consistent audio quality without exceeding character limits.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Build your app with multilingual support so players worldwide can learn the language effortlessly.
23 languages
Any voice speaks any of these languages.
