API Documentation for Text-to-Speech Integration

By VoxLingo editorial team · Updated 2026-11-19

This guide helps indie developers integrate accessible audio into language learning apps using the VoxLingo TTS API. You will find clear examples for authentication, request structures, and response handling. The documentation covers essential endpoints, parameter details, and error codes to streamline your integration process without unnecessary complexity.

We focus on providing a predictable, simple API that handles speech synthesis so you can prioritize user experience. Whether you prefer raw cURL commands or the official OpenAI SDK, this page provides the concrete steps and code snippets you need to get started quickly. Let’s build something great together.

API Documentation for Text-to-Speech Integration

Frequently asked questions

How do I get an API key?

Sign up on the /get-api-key/ page using Google or email. Your key appears immediately. It starts with 'tts-'. You can issue a new key anytime via the dashboard; the old one stops instantly. One active key per account.

Does the API support streaming?

No streaming is supported. You send a POST request and receive the full audio file in the response. There is no WebSocket or real-time partial audio delivery. You must wait for the synthesis to complete before receiving the file.

What is the base URL?

The API base URL is https://api.e666.info/v1. Use this for all requests, including the speech endpoint at /v1/audio/speech. This URL works with standard HTTP clients or by setting the base_url in compatible SDKs.

Can I use the OpenAI SDK?

Yes. The request shape matches the OpenAI speech endpoint. Change the OpenAI SDK's base_url to https://api.e666.info/v1 and use your site's key. The official OpenAI SDKs work directly without modification.

What formats are supported?

Supported formats are mp3, wav, opus, flac, and pcm. Set the response_format field in your request. These options cover most use cases for language learning apps, from lightweight MP3s to lossless FLAC.

How do I handle errors?

Failed requests are free, and the charge is returned in full. Check the HTTP status code in the response. If synthesis fails, no characters are deducted from your balance. Handle standard HTTP errors in your integration.

What are the rate limits?

The limit is 60 requests per minute per key. Before your first top-up, the limit is 10 requests per minute. Exceeding the limit may cause requests to queue or fail. Monitor your usage via the dashboard.

Can I change my API key?

Yes. You can issue a new key at any time from your dashboard. The old key stops working immediately. This is useful if you suspect a leak or want to rotate credentials regularly.

Is there a Python SDK?

There is no official Python SDK from us. However, you can use the official OpenAI Python SDK by changing the base_url to https://api.e666.info/v1. Plain HTTP requests also work perfectly with any Python HTTP library.

How do I set the language?

Pass the optional 'language' field with an ISO code. If omitted, the system guesses the language, defaulting to English for Latin script. For non-English Latin text, always set the language explicitly to ensure correct pronunciation.

What is the max character limit?

The maximum input length is 4096 characters per request. Spaces and punctuation count toward this limit. If your text exceeds this, split it into chunks and join the resulting audio files afterward.

How do I split long texts?

Split your text into parts of up to 4096 characters. Send each part as a separate request. Then join the returned audio files in your application. This ensures every chunk is synthesized within the character limit.

What happens on rate limit?

Requests are processed sequentially. Under load, a request may wait in a queue. If you exceed 60 requests per minute, additional requests may be delayed or rejected. The system does not guarantee immediate processing during high volume.

Is SSML supported?

No, SSML is not supported. The API accepts plain text input. There are no SSML tags for pauses, emphasis, or pronunciation. You must handle prosody and pacing through text formatting or post-processing if needed.

First request

curl

curl https://api.e666.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.mp3

Python (openai)

from openai import OpenAI

client = OpenAI(base_url="https://api.e666.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.e666.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
ariafemale
novafemale
lunafemale
sagefemale
felixmale
milomale
atlasmale
orionmale
language
arالعربية
zh中文
daDansk
nlNederlands
enEnglish
fiSuomi
frFrançais
deDeutsch
elΕλληνικά
heעברית
hiहिन्दी
itItaliano
ja日本語
ko한국어
msBahasa Melayu
noNorsk
plPolski
ptPortuguês
ruРусский
esEspañol
swKiswahili
svSvenska
trTürkçe

Authentication

Sound wave illustration for: Authentication

Access the VoxLingo API using a single active bearer token. Each account holds one key that authenticates all requests to the speech endpoint.

API Key Format

API Key Format

Keys start with the prefix tts- followed by alphanumeric characters. This format distinguishes our tokens from other service credentials.

Bearer Token Usage

Bearer Token Usage

Include the token in the HTTP header: Authorization: Bearer tts-.... The API validates this header on every request to authorize character consumption.

Key Rotation

Issue a new key via the dashboard at any time. The previous key stops working immediately, ensuring secure access without downtime.

Quickstart with cURL

Sound wave illustration for: Quickstart with cURL

Generate speech instantly using simple HTTP requests. This guide demonstrates the core workflow for indie developers building language learning features, focusing on clarity and predictable outcomes without infrastructure complexity.

The API returns audio files directly, allowing you to cache responses or play them to users. We prioritize straightforward integration so you can focus on the user experience.

First Request Example

Run this command to generate your first audio file. Replace YOUR_API_KEY with your key from /get-api-key/. The request uses the standard tts-1 model.

```bash curl https://api.e666.info/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Hello, welcome to the lesson.", "voice": "nova"}' \ --output speech.mp3 ```

This request generates a few seconds of audio. Long texts require splitting into parts of 4096 characters each.

  • Use tts-1 for standard quality or tts-1-hd for higher fidelity.

Basic JSON Body

The request body is a JSON object containing the text, voice selection, and optional parameters. The input field accepts up to 4096 characters. Spaces and punctuation count toward this limit.

You can specify the voice from the 8 available presets. The language parameter is optional; if omitted, the system guesses the language based on the script (Latin defaults to English).

  • model: "tts-1" or "tts-1-hd" input: string, max 4096 chars voice: one of 8 presets response_format: mp3, wav, opus, flac, pcm speed: 0.25–4.0 language: ISO code (optional)

Response Handling

A successful request returns an audio file directly in the response body. The file format matches your response_format parameter, defaulting to MP3. No JSON wrapper is used for the audio data.

Errors return a JSON object with an error field containing a message and code. Failed synthesis requests are free, so you are not charged if the audio generation fails.

  • Check the HTTP status code for success (200) or errors.
  • Handle network timeouts gracefully; processing is sequential.

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

VoxLingo’s API mirrors the OpenAI speech endpoint structure, allowing you to integrate our text-to-speech service using familiar tools. By simply adjusting the base_url in your existing OpenAI client configuration, you can route requests to our infrastructure without rewriting your core logic.

Change Base URL

Update your client’s base URL from https://api.openai.com/v1 to https://api.e666.info/v1. This directs all standard speech synthesis calls to our servers while maintaining the same JSON request and response shapes.

Use Official SDKs

You can use the official OpenAI SDKs for Python, Node.js, and other languages. Pass your VoxLingo API key (starting with tts-) in the Authorization header. The SDK handles serialization and retries automatically.

  • Python: openai.OpenAI(base_url="https://api.e666.info/v1", api_key="tts-...")
  • Node.js: new OpenAI({ baseURL: "https://api.e666.info/v1", apiKey: "tts-..." })

Compatibility Notes

Our endpoint accepts the same model, voice, input, and response_format fields as the OpenAI speech endpoint. Rate limits and pricing differ, so monitor your usage via the /v1/voices endpoint. We do not support streaming or SSML in this SDK mode.

Endpoints Reference

Sound wave illustration for: Endpoints Reference

The API exposes three core endpoints to handle synthesis, metadata retrieval, and configuration. All endpoints require a valid Bearer token in the Authorization header. The speech endpoint accepts text and returns audio, while the metadata endpoints provide voice details and model information.

POST /v1/audio/speech

This endpoint generates audio from text. Send a JSON body with the model, input text, voice, and response format. The API returns the audio file directly in the response.

  • Accepts up to 4096 characters per request.
  • Supports mp3, wav, opus, flac, and pcm formats.
  • Requires a valid Bearer token.

GET /v1/voices

Retrieve the list of available voices, languages, and formats. This helps you select the right voice for your language learning app. The response includes details for all 8 presets.

  • Lists all 8 voice presets.
  • Shows supported languages and formats.
  • Includes pricing information.

GET /v1/models

Fetch the available models. Currently, only tts-1 and tts-1-hd are available. Both use the same engine and price. This endpoint confirms the model IDs for your requests.

  • Returns model IDs and names.
  • Indicates engine and pricing tier.

Request Parameters

Sound wave illustration for: Request Parameters

Configure synthesis behavior by selecting the model, voice, speed, and optional language. These parameters define how the API converts your text input into audio output.

Model Selection

Choose between "tts-1" and "tts-1-hd". Both use the same engine and pricing structure, so the choice depends only on your quality preference.

Voice Selection

Select one of eight presets (e.g., aria, nova, felix). Each voice is a licensed recording capable of speaking any of the 23 supported languages. You do not need to specify the language for English text, but setting it explicitly improves results for other Latin-script languages.

  • Aria: warm, clear narrator
  • Felix: energetic, promo
  • Atlas: neutral, news

Speed and Language

Adjust speed from 0.25 to 4.0. The default rate is 1.0. You may also provide an optional ISO language code to force synthesis in a specific language, overriding script-based guessing.

Request Parameters

Response Formats

Sound wave illustration for: Response Formats

The API returns generated audio directly in the response body, ensuring seamless integration into your language learning application's audio player. You control the output format to match your app’s requirements without needing external conversion tools.

Audio File Formats

Choose from mp3, wav, opus, flac, or pcm via the response_format field. MP3 offers an efficient balance of quality and file size for web playback, while WAV provides uncompressed audio for precise synchronization in educational tools.

  • mp3 (default, efficient for web)
  • wav (uncompressed, high fidelity)
  • opus (low bandwidth, modern)
  • flac (lossless compression)
  • pcm (raw linear audio)

Error Responses

Errors return a JSON object with an error key containing a type and message. Failed synthesis requests are free, so you can retry without worrying about character consumption.

  • Invalid request parameters
  • Rate limit exceeded
  • Server processing errors

Status Codes

Standard HTTP status codes indicate request success or failure. A 200 OK means the audio file is ready for immediate playback. Use 4xx codes to validate input before sending large text batches.

Rate Limits

Sound wave illustration for: Rate Limits

Your API key allows 60 requests per minute once funded. This limit ensures fair usage across the network. You can monitor your current rate limit status via the dashboard.

60 Requests per Minute

After your first top-up, you can send up to 60 requests per minute. This is sufficient for most language learning app features. If you exceed this limit, you will receive a 429 Too Many Requests error.

Pre-Top-Up Limits

New accounts start with a limit of 10 requests per minute. This applies until you add your first USDT payment. The limit increases immediately upon credit receipt.

Queue Behavior

Requests are processed sequentially under load. Short phrases may take a few seconds, while longer texts take longer. If the queue is busy, your request waits until a slot is available.

Common Errors

Sound wave illustration for: Common Errors

Even with a valid key, you may encounter specific errors during integration. Understanding these common failure modes helps you build robust retry logic and handle edge cases gracefully in your language learning app.

Invalid API Key

Return a 401 status if the token is missing, malformed, or revoked. Ensure your request includes the header Authorization: Bearer tts-.... Note that issuing a new key instantly invalidates the old one.

  • Check for typos in the tts- prefix.
  • Verify the key hasn’t been rotated.

Character Limit Exceeded

Return a 400 status if the input field exceeds 4096 characters. You must split longer texts into chunks before sending them to the API and concatenate the resulting audio files.

  • Count spaces and punctuation as characters.
  • Handle splits seamlessly for continuous playback.

Service Unavailable

Return a 503 status when the queue is full or the service is temporarily down. Requests are processed sequentially, so high load may cause delays. Retry with exponential backoff.

  • Respect the Retry-After header if provided.
  • Implement jitter in retry logic to avoid thundering herds.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. If many users trigger synthesis simultaneously, your requests may wait in a queue before processing begins.

Avatar of the voice aria
ariafemale
Avatar of the voice nova
novafemale
Avatar of the voice luna
lunafemale
Avatar of the voice sage
sagefemale
Avatar of the voice felix
felixmale
Avatar of the voice milo
milomale
Avatar of the voice atlas
atlasmale
Avatar of the voice orion
orionmale

23 languages

Any voice speaks any of these languages.

Sources and further reading

  1. Wikipedia
  2. LibriTTS-R paper (arXiv 2305.18802)
  3. openai-python on GitHub
  4. TRON developer hub: TRC-20
  5. FFmpeg documentation
  6. Creative Commons Attribution 4.0
  7. Node.js documentation
  8. Tether (USDT)
  9. ISO 639 language codes
  10. LibriTTS-R corpus (OpenSLR 141)
  11. OpenAI API reference: create speech
  12. openai-node on GitHub

More on this site