TTS API Quickstart Guide for Developers to Generate Audio

By LinguaTTS Editorial Team · Updated 2026-11-18

This guide helps developers integrate the LinguaTTS API for classroom audio generation. You will learn to generate speech using the standard OpenAI-compatible endpoint at https://api.sixs6bet.com/v1. We provide concrete examples for cURL and the official OpenAI SDK, covering model selection, voice presets, and audio formats. This ensures you can quickly test text-to-speech quality for your language curriculum.

You will also understand key constraints like the 4096-character input limit and 60 requests per minute rate limit. The guide explains how to handle failed requests and choose between tts-1 and tts-1-hd models at the same price. Whether you are building a web app or a desktop tool, these steps ensure reliable audio delivery for your educational projects.

TTS API Quickstart Guide for Developers to Generate Audio

Frequently asked questions

How do I generate an API key?

Sign up on the /get-api-key/ page using Google or email and password. Your account displays a single active Bearer token. You can issue a new key at any time, which immediately invalidates the previous one. Each site account holds one key for authentication via the Authorization header.

Is the OpenAI SDK required?

No. The endpoint matches the OpenAI speech endpoint shape, so the official OpenAI SDKs work by changing the base_url to https://api.sixs6bet.com/v1. You can also use plain HTTP requests. Any library that supports standard JSON POST requests to this URL is compatible.

What is the character limit per request?

Each request supports up to 4096 characters of input text. Spaces and punctuation count toward this limit. For longer texts, split your content into parts of 4096 characters or less and join the resulting audio files after generation.

Can I use the API with Python?

Yes. You can use the official OpenAI Python SDK by setting the base_url to https://api.sixs6bet.com/v1. Alternatively, use any standard HTTP library like requests. Pass your Bearer token in the Authorization header and send the JSON body with model, input, and voice parameters.

How do I set 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. Set it explicitly for non-English Latin-script text to ensure correct pronunciation.

What happens if I exceed the rate limit?

The limit is 60 requests per minute per key (10 per minute before the first top-up). Requests are processed sequentially, so exceeding limits or high load causes requests to wait in a queue. Failed requests are free, but successful ones count toward your limit.

Are voices language-specific?

No. All eight voices can speak any of the 23 supported languages. For example, the 'aria' voice can speak Arabic, Japanese, or English. You do not need to select a different voice for each language; just specify the target language in the request.

How do I handle long texts?

Split your text into chunks of up to 4096 characters. Send each chunk as a separate POST request to the /v1/audio/speech endpoint. Receive the audio files for each part and join them to create the final audio file for the complete text.

What is the speed range?

You can adjust the speed between 0.25 and 4.0. The default speed is 1.0. This allows you to slow down speech for learners or speed it up for quick reviews. Adjust this parameter in the JSON body of your request.

Is the API synchronous?

Yes. You send a POST request and receive the audio file in the response. There is no streaming or WebSocket support. Requests are processed one after another, so under load, you may experience delays as requests wait in a queue before generation begins.

Can I use multiple models?

Yes. The API offers two models: 'tts-1' and 'tts-1-hd'. Both use the same engine and price. You can choose either model in your request. The choice does not affect the cost, which is $0.01 per 1,000 characters for both.

How do I detect errors?

Check the HTTP status code of the response. Failed requests are free, and the charge is returned in full. The API returns standard error codes if the request is invalid or if you exceed rate limits. Inspect the response body for error details.

Is SSL required?

Yes. The API endpoint is https://api.sixs6bet.com/v1. You must use HTTPS to connect. The base URL includes the 'https' protocol, ensuring encrypted communication between your client and the server for secure transmission of your text and API keys.

Do I need to install additional libraries?

Only if you use a specific SDK. If using the OpenAI SDK, you must install it via pip. For plain HTTP requests, use any standard library available in your language, such as 'requests' in Python or 'fetch' in JavaScript. No proprietary libraries are required.

First request

curl

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

Python (openai)

from openai import OpenAI

client = OpenAI(base_url="https://api.sixs6bet.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.sixs6bet.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
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

Get Your API Key

Sound wave illustration for: Get Your API Key

To begin generating audio for your language lessons, you must first obtain an API key. You can sign up using your Google account for instant access with a $0.50 trial credit, or create a standard account with an email and password. This account is specific to the LinguaTTS Review platform.

Sign Up with Google or Email

Sign Up with Google or Email

Visit the /get-api-key/ page to create your account. Google sign-up provides immediate trial credit valid for 7 days, while email accounts start with a zero balance. This key authenticates your requests to the API endpoint.

  • Google sign-up includes $0.50 trial credit
  • Email accounts start without trial credit
  • One active key per account

Access the Dashboard

Access the Dashboard

Once registered, you will access the dashboard which displays your current balance, characters remaining, and usage statistics. The dashboard also provides a ready-to-use cURL example for immediate testing.

  • View real-time usage metrics
  • Check remaining character balance
  • Access generated audio history

Copy Your Secret Key

Locate your secret key in the dashboard and copy it. You will use this key in the Authorization: Bearer header for all API requests. You can issue a new key at any time, which immediately invalidates the old one.

  • Format: tts-...
  • Use in Bearer token header
  • New key invalidates old one instantly

Make Your First Request

Sound wave illustration for: Make Your First Request

Begin by sending a POST request to the speech endpoint. The API accepts standard JSON payloads, allowing you to generate audio files directly from your application or terminal without complex integrations.

cURL Example for Speech Generation

Use this command to generate speech immediately. Replace the placeholder key with your secret token from the dashboard.

  • curl -X POST "https://api.sixs6bet.com/v1/audio/speech" \ -H "Authorization: Bearer tts-your-key-here" \ -H "Content-Type: application/json" \ -d "{\"model\": \"tts-1\", \"input\": \"Hello, this is a test.\", \"voice\": \"nova\", \"response_format\": \"mp3\"}"

JSON Body Structure

The request body requires specific fields to define the audio output. You must specify the model, the text input, the voice preset, and the desired audio format.

Required Parameters

Ensure you include model, input, voice, and response_format. The input field supports up to 4096 characters, which is sufficient for most classroom sentences.

Using with OpenAI SDK

Sound wave illustration for: Using with OpenAI SDK

LinguaTTS is fully compatible with the official OpenAI Python and JavaScript SDKs. By simply redirecting the API client to our base URL, you can generate speech without rewriting your core logic or installing new dependencies.

Set base_url to api.sixs6bet.com

Configure your SDK client to point to https://api.sixs6bet.com/v1. This replaces the standard OpenAI endpoint, allowing your existing code to communicate directly with our synthesis engine using your LinguaTTS API key.

Use Official OpenAI SDKs

You can use the standard OpenAI SDKs for Python and JavaScript. This ensures you benefit from official updates and type safety while leveraging our TTS infrastructure for your language learning applications.

Standard Endpoint Compatibility

The request shape matches the OpenAI speech endpoint exactly. Send a POST request with your text, voice, and format preferences, and receive a direct audio file response in your preferred format.

Supported Models

Sound wave illustration for: Supported Models

The API offers two model variants, "tts-1" and "tts-1-hd," which utilize the identical underlying synthesis engine. This means both models generate audio with the same voice characteristics, pacing, and linguistic behavior. The distinction lies solely in the backend processing quality, allowing developers to choose based on their specific bandwidth or fidelity requirements without changing the voice presets.

tts-1 Standard Quality

The "tts-1" model provides efficient, clear audio generation suitable for most educational applications. It processes text at a speed roughly equivalent to real-time, generating approximately 25 characters per second. This makes it ideal for bulk curriculum material creation where latency is less critical than volume.

tts-1-hd High Quality

The "tts-1-hd" model delivers enhanced audio fidelity, beneficial for language learners who need precise phonetic clarity. Despite the higher quality output, the generation speed and character limits remain consistent with the standard model, ensuring predictable performance for classroom exercises.

Same Price for Both Models

Both models are priced identically at $10 per 1 million characters. There is no cost premium for selecting the high-quality variant. This flat-rate structure simplifies budgeting for educators and developers, allowing you to upgrade quality for specific lessons without increasing overall API costs.

Available Voices

Sound wave illustration for: Available Voices

LinguaTTS Review evaluates eight preset voices, each derived from licensed recordings in LibriTTS-R (CC BY 4.0) and public-domain audiobooks from LibriVox. These voices are designed for clear, pedagogical use in language learning environments, ensuring consistent pronunciation across diverse texts.

8 Preset Voices

The API offers eight distinct voice presets: Aria, Nova, Luna, and Sage for female tones; Felix, Milo, Atlas, and Orion for male tones. Each voice provides a specific tonal quality, from warm narration to energetic promos, allowing educators to match audio to lesson context.

  • 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

Gender and Style Options

Voices are categorized by gender and stylistic intent. Neutral options like Atlas suit news or formal instructions, while conversational tones like Milo aid in dialogue practice. All voices are based on licensed recordings and carry an inaudible synthetic watermark, confirming their origin for classroom transparency.

Language Agnostic Voices

Each of the eight voices can speak all 23 supported languages, including Arabic, Chinese, English, Japanese, Spanish, and Swahili. The language parameter should be set explicitly for non-English Latin-script text to ensure accurate pronunciation, as the default guess is English.

Available Voices

Response Formats

Sound wave illustration for: Response Formats

The API returns audio in five distinct formats: MP3, WAV, OPUS, FLAC, and PCM. This flexibility allows educators to select the optimal codec for their specific classroom technology or curriculum requirements.

MP3, WAV, OPUS, FLAC, PCM

MP3 offers compressed audio for efficient bandwidth usage, while WAV provides uncompressed, high-fidelity sound ideal for local storage. OPUS is efficient for web streaming, whereas FLAC ensures lossless quality for archival purposes. PCM provides raw audio data for direct processing.

Choosing the Right Format

Select MP3 or OPUS for mobile apps and web players to conserve data. Choose WAV or FLAC when precise audio quality is critical for phonetic analysis. Use PCM if your integration requires raw binary input.

  • MP3: Best for web delivery and mobile apps.
  • WAV: Ideal for local playback and editing.
  • OPUS: Efficient for web delivery.
  • FLAC: Lossless compression for high-quality archives.
  • PCM: Raw binary data for custom processing.

Audio File Delivery

The audio file is returned directly in the API response body. No external storage or download links are generated; the client receives the binary data immediately upon successful synthesis.

Rate Limits and Performance

Sound wave illustration for: Rate Limits and Performance

Understanding rate limits and generation speed is essential for planning classroom demos or batch processing. Our API processes requests sequentially, meaning performance depends on queue depth during high load. Knowing these constraints helps teachers schedule audio generation without unexpected delays.

60 Requests Per Minute

Each API key allows up to 60 requests per minute once funded. This limit ensures stable performance for most educational use cases, though requests are processed sequentially. If you exceed this threshold, subsequent requests will queue until the window resets.

  • Limit: 60 requests/minute per key
  • Processing: Sequential, one after another
  • Queue: Requests wait during high load

10 Requests Before Top-Up

New accounts start with a lower limit of 10 requests per minute. This applies to free trial credits or unpaid balances. You can top up via USDT (TRC-20) to immediately raise the limit to the full 60 requests per minute.

  • Initial limit: 10 requests/minute (before first top-up)
  • Applies to: Trial or unpaid accounts
  • Upgrade: USDT top-up raises limit to 60/min

Real-Time Generation Speed

Generation speed is roughly real-time for long texts, processing about 25 characters per second of audio output. Short phrases may take a few seconds due to startup overhead. Under load, requests may wait in queue, extending total time.

  • Speed: ~25 characters per second of audio
  • Short phrases: A few seconds each
  • Load: Queueing may increase total time

Error Handling

Sound wave illustration for: Error Handling

API calls may fail due to rate limits, invalid inputs, or network issues. The API returns standard HTTP status codes to help you diagnose the problem quickly.

Understanding these errors ensures your classroom audio generation workflows remain smooth and predictable during peak usage times.

Common Error Codes

Use 400 for invalid parameters, 401 for authentication failures, and 429 when exceeding 60 requests per minute.

  • 400: Invalid JSON or missing required fields like 'model' or 'input'
  • 401: Expired or incorrect API key
  • 429: Rate limit exceeded (10 req/min before top-up, 60 req/min after)

Retry Logic

Implement exponential backoff for 429 and 500 errors. Avoid rapid retries to prevent queue congestion.

Requests are processed sequentially; wait briefly between retries to ensure fair queue positioning.

  • Wait 1–2 seconds before first retry
  • Double wait time for each subsequent attempt
  • Maximum 3 retries before alerting the user

Failed Request Refunds

If synthesis fails, the charge is returned in full. No credit is lost for failed attempts.

This applies to network errors, invalid inputs, and server-side failures during processing.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Effective language instruction requires deliberate practice and authentic communication to foster genuine fluency.

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. LibriVox public-domain audiobooks
  3. TRON developer hub: TRC-20
  4. LibriTTS-R corpus (OpenSLR 141)
  5. Tether (USDT)
  6. curl documentation
  7. FFmpeg documentation
  8. LibriTTS-R paper (arXiv 2305.18802)
  9. W3C WAI: making audio and video accessible
  10. IETF RFC 7845: Ogg Opus
  11. MDN: Web Speech API
  12. ISO 639 language codes

More on this site