Text-to-Speech API Documentation and Quickstart

By AudioLex Access editorial team · Updated 2026-11-19

The API documentation details the integration workflow for converting text to speech using the AudioLex Access infrastructure. This guide is structured for indie developers building accessibility and dyslexia-focused reading applications who require a reliable, programmatic solution for generating audio files from text input.

You will find precise specifications for the synthesis endpoint, including authentication requirements, rate limits, and supported audio formats. The documentation provides concrete examples for configuring the OpenAI SDK and handling request parameters, ensuring you can implement the API efficiently within your existing development environment.

Text-to-Speech API Documentation and Quickstart

Frequently asked questions

How do I get an API key?

Navigate to /get-api-key/ and sign in using Google or an email and password combination. The dashboard displays your active API key, current balance, trial status, characters left, usage, and a ready curl example. Each account holds one active key; issuing a new key immediately invalidates the previous one.

What is the base URL for the API?

The API base URL is https://api.6zzz.info/v1. You send POST requests to https://api.6zzz.info/v1/audio/speech for synthesis. Additional endpoints include GET /v1/voices for voice details and GET /v1/models for model information.

Can I use the OpenAI SDK?

Yes, the official OpenAI SDKs work by changing the base_url to https://api.6zzz.info/v1 and using your site-specific key. The request shape matches the OpenAI speech endpoint exactly, allowing seamless integration with existing client libraries.

How do I specify the language?

Include the optional language field with an ISO code in your request. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Explicitly setting it ensures correct synthesis for non-English Latin-script content.

What are the rate limits?

The limit is 60 requests per minute per key. Before your first top-up, this limit is reduced to 10 requests per minute. Requests are processed sequentially, so high load may cause queuing delays during synthesis.

How do I handle failed requests?

Failed requests are free; the charge is returned in full if synthesis fails. You should implement retry logic for transient errors. Ensure your input text does not exceed 4096 characters per request.

Which audio formats are supported?

Supported formats are mp3, wav, opus, flac, and pcm. Specify the desired format using the response_format field in your JSON body. The generated audio is returned directly in the response without being stored on our servers.

Is there an SSML tag supported?

No, the API does not support SSML. It accepts plain text input up to 4096 characters. There are no phoneme dictionaries or custom pronunciation lexicons available. You must manage text formatting and pacing within the input string itself.

How do I calculate character count?

Spaces and punctuation count as characters. The price is $10 per 1 million characters, or $0.01 per 1,000 characters. Count all characters in your input text, including spaces, to determine the exact cost of the synthesis request.

Can I stream the audio?

No, there is no streaming or WebSocket support for real-time partial audio. The API returns the complete audio file upon successful synthesis. You must wait for the full response before processing or playing the audio data.

What is the maximum input length?

The maximum input length is 4096 characters per request. For longer texts, split the content into parts of up to 4096 characters each. Synthesize each part separately and join the resulting audio files to create the final output.

How do I regenerate my API key?

Issue a new key via the /get-api-key/ dashboard page. The new key becomes active immediately, and the old key stops working at once. You can regenerate the key as many times as needed without affecting your balance.

Does the API support WebSocket?

No, the API does not support WebSocket connections. Communication is strictly HTTP-based using standard POST requests for speech synthesis. There is no real-time streaming or partial audio delivery mechanism available through WebSocket or other protocols.

How are errors returned in the JSON?

Errors are returned as standard JSON responses indicating the failure status. Failed requests incur no charge, and the cost is returned in full. Check the response status code and body to identify the specific error condition for debugging.

First request

curl

curl https://api.6zzz.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.6zzz.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.6zzz.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 and Keys

Sound wave illustration for: Authentication and Keys

Authentication is handled via a single active API key per account, issued on the /get-api-key/ page. The key must be included in the HTTP header as Authorization: Bearer <key>. This token authorizes all requests to the https://api.6zzz.info/v1 base URL.

Keys are generated upon account creation via Google or email. You can issue a new key at any time from the dashboard; the previous key becomes invalid immediately upon issuance, ensuring tight control over access for your accessibility applications.

Bearer token format

Bearer token format

Include the key in the Authorization header using the Bearer scheme. Example: Authorization: Bearer tts-12345abcdef. The token is a string starting with tts- followed by alphanumeric characters.

  • Format: Bearer <key-string>
  • Case-sensitive transmission
  • Single active token per account

Key generation process

Key generation process

Keys are created during sign-up on the /get-api-key/ page. Google sign-in provides immediate access; email/password accounts start without trial credit until balance is updated.

Key invalidation rules

Issuing a new key instantly invalidates the old one. This allows immediate revocation if a key is exposed, without waiting for a session timeout.

Core Endpoint: Speech Synthesis

Sound wave illustration for: Core Endpoint: Speech Synthesis

The POST https://api.6zzz.info/v1/audio/speech endpoint converts input text into synthesized audio files. Requests follow the standard JSON structure, supporting models tts-1 and tts-1-hd. The API processes text sequentially, returning the audio file directly in the response body.

POST method specification

Send a POST request to the speech synthesis endpoint. The request must include a valid Bearer token in the Authorization header. The endpoint accepts JSON payloads and returns the generated audio file after processing, which may take time as requests are processed sequentially.

JSON body structure

The request body requires the model, input, voice, and response_format fields. Optional parameters include speed (0.25–4.0) and language. The input text is limited to 4096 characters. For longer texts, clients must split the content into chunks and join the resulting audio files.

Input and output fields

The input field accepts plain text strings up to 4096 characters. The voice field specifies one of the eight available presets. The response returns the audio file in the requested format (mp3, wav, opus, flac, or pcm). Failed requests return an error status and the charge is returned in full.

Voice and Model Selection

Sound wave illustration for: Voice and Model Selection

Select the appropriate engine and voice configuration to match your application’s audio requirements. Both models utilize the same underlying synthesis infrastructure, ensuring consistent quality across different output types.

tts-1 vs tts-1-hd

The tts-1 and tts-1-hd models share identical pricing and engine performance. Choose tts-1-hd when higher fidelity is required for accessibility features, as both incur the same $0.01 per 1,000 characters rate.

Available voice presets

Eight distinct voice presets are available, categorized by tone and gender. Options include aria for warm narration, nova for upbeat content, and atlas for neutral delivery. All voices support the full range of 23 languages.

  • Female: aria, nova, luna, sage
  • Male: felix, milo, atlas, orion

Speed range parameters

The speed parameter accepts values between 0.25 and 4.0. Adjusting speed allows you to optimize listening experiences for users with varying processing speeds, such as those using assistive reading technologies.

Audio Format Options

Sound wave illustration for: Audio Format Options

Selecting the correct audio format ensures compatibility with your accessibility and dyslexia reading applications while optimizing bandwidth usage. The API supports MP3, WAV, OPUS, FLAC, and PCM via the response_format parameter.

MP3 compression

MP3 provides efficient compression suitable for general playback. It reduces file size significantly while maintaining acceptable quality for standard text-to-speech delivery.

WAV lossless

WAV offers uncompressed, lossless audio. This format is ideal for archival purposes or applications requiring pristine audio fidelity without data loss.

OPUS and FLAC support

OPUS provides high-quality compression. FLAC offers lossless compression, reducing file size without sacrificing audio quality, ideal for storage efficiency.

  • OPUS: Efficient for real-time playback
  • FLAC: Lossless compression for storage

Rate Limits and Quotas

Sound wave illustration for: Rate Limits and Quotas

Rate limits are enforced per API key to ensure stable synthesis performance. The standard quota allows 60 requests per minute, which is sufficient for most batch processing workflows in accessibility applications.

60 requests per minute

Once your account is active, you may send up to 60 requests per minute. This limit applies to all endpoints and ensures consistent processing speeds for long-text synthesis tasks.

Initial 10 req/min limit

New accounts without a top-up are limited to 10 requests per minute. This lower threshold applies until you add funds via USDT (TRC-20), after which the limit increases to the standard 60 req/min.

Queue behavior under load

Requests are processed sequentially. If the queue is full, new requests wait in line rather than failing immediately. This ensures that no request is dropped due to temporary high traffic, maintaining reliability for critical reading applications.

Rate Limits and Quotas

Error Handling and Status Codes

Sound wave illustration for: Error Handling and Status Codes

The API returns standard HTTP status codes to indicate request processing states. Clients should implement robust error handling to manage network interruptions or server-side processing delays during high-load periods.

Common HTTP error codes

Use 400 Bad Request for invalid JSON or missing required fields. Use 401 Unauthorized if the Bearer token is missing or invalid. Use 429 Too Many Requests when exceeding the 60 requests per minute limit.

Failed request refunds

If synthesis fails due to server errors, the character charge is returned in full. Failed requests do not consume your balance, ensuring accurate billing for successful audio generation only.

Retry strategies

Implement exponential backoff for 429 and 500 errors. Do not retry 400 errors as they indicate client-side input issues. Requests are processed sequentially, so under load, a request may wait in a queue.

SDK Integration Examples

Sound wave illustration for: SDK Integration Examples

Integrate AudioLex Access using the official OpenAI SDK by adjusting the base URL to https://api.6zzz.info/v1. This allows you to use the same request structure for POST /v1/audio/speech without rewriting client logic. Pass your tts-... bearer token in the Authorization header to authenticate requests.

The API accepts standard parameters like model, input, voice, and response_format. Configure the SDK client to point to the API base, then call the speech endpoint as you would with any standard TTS service. The response returns the audio file directly.

OpenAI SDK configuration

Set the base_url to https://api.6zzz.info/v1 in your SDK client instance. Ensure the Authorization header includes your tts-... key. This setup enables compatibility with existing OpenAI SDK implementations.

You can switch between tts-1 and tts-1-hd models using the model field. Both use the same engine and pricing, allowing easy testing of quality differences without changing the integration code.

Base URL modification

The base URL change is the only required configuration adjustment. All other endpoints, such as GET /v1/voices and GET /v1/models, remain accessible under the /v1 prefix. This ensures consistent path structures across all API interactions.

Verify connectivity by checking the GET /v1/models endpoint. It returns the available model identifiers, confirming that the SDK is correctly pointing to the AudioLex Access API.

Python and Node.js examples

  • Use the openai Python package with base_url='https://api.6zzz.info/v1' and api_key='tts-...'.
  • For Node.js, set BASE_URL='https://api.6zzz.info/v1' in the OpenAI client configuration.
  • Pass response_format='mp3' or wav to specify the output type.
  • Include voice='aria' or another preset to select the desired voice.
  • Set speed between 0.25 and 4.0 for playback adjustments.
  • Handle errors by checking HTTP status codes; failed requests receive full refunds.

Language Parameter Usage

Sound wave illustration for: Language Parameter Usage

The API accepts an optional language parameter to specify the ISO 639-1 code, ensuring accurate pronunciation for non-English text.

ISO code specification

Specify the language explicitly using standard two-letter codes, such as es for Spanish or de for German. This ensures the engine selects the correct phonetic rules from the 23 supported languages.

  • Supported codes include: ar, zh, da, nl, en, fi, fr, de, el, he, hi, it, ja, ko, ms, no, pl, pt, ru, es, sw, sv, tr.

Automatic detection logic

If the language field is omitted, the system guesses the language based on the text script. This works reliably for Cyrillic or CJK characters.

Latin script default

Text in Latin script defaults to English if no language is specified. For French, Portuguese, or other Latin-script languages, you must set the language parameter explicitly to avoid English pronunciation.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. WAV provides uncompressed, lossless audio, preserving every detail of the synthesized voice.

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. Creative Commons Attribution 4.0
  3. TRON developer hub: TRC-20
  4. LibriTTS-R corpus (OpenSLR 141)
  5. openai-node on GitHub
  6. ISO 639 language codes
  7. openai-python on GitHub
  8. Tether (USDT)
  9. OpenAI API reference: create speech
  10. LibriTTS-R paper (arXiv 2305.18802)
  11. LibriVox public-domain audiobooks
  12. FFmpeg documentation

More on this site