Quick Start Guide: Text to Speech API for Schools

By LinguaCast editorial team · Updated 2026-11-18

This guide helps teachers and school IT teams integrate high-quality text-to-speech into their classroom workflows. You will find clear examples for generating audio files, configuring voice settings, and managing your API key. Whether you are reading stories aloud or providing accessible content for students, this documentation covers the essential steps to get started quickly.

We focus on clarity, affordability, and easy integration with existing school tools. You can use the standard OpenAI SDK or simple cURL commands to send text and receive audio. The guide explains rate limits, supported languages, and how to handle long texts by splitting them into manageable chunks. No complex contracts or enterprise setups are required.

Quick Start Guide: Text to Speech API for Schools

Frequently asked questions

How do I get an API key?

Visit /get-api-key/ to sign up using Google or an email and password. Your account page displays your active API key, current balance, and usage statistics. You can issue a new key at any time, which immediately invalidates the previous one.

Can I use the OpenAI SDK?

Yes. The endpoint shape matches the OpenAI speech endpoint. Simply change the SDK’s base_url to https://api.bet11ph.com/v1 and use your LinguaCast key. This allows you to use official OpenAI SDKs without modification for text-to-speech generation.

What is the base URL?

The API base URL is https://api.bet11ph.com/v1. Use this for all requests, including POST /v1/audio/speech for generation, GET /v1/voices for voice details, and GET /v1/models. This URL works with standard HTTP clients and the OpenAI SDK.

What audio formats are supported?

You can request audio in mp3, wav, opus, flac, or pcm formats. Specify your preferred format in the request body using the response_format field. This allows flexibility for different playback environments, from web players to high-fidelity recording applications.

How many voices are there?

There are eight preset voices: aria, nova, luna, and sage (female); felix, milo, atlas, and orion (male). Each voice has a distinct tone, from warm narration to deep documentary styles. You can list all available voices via the GET /v1/voices endpoint.

What is the rate limit?

Each API key allows 60 requests per minute. New accounts start with a limit of 10 requests per minute until the first top-up is processed. If you exceed this limit, requests may be delayed or rejected until the window resets.

Can I generate audio in multiple languages?

Yes, we support 23 languages including English, Spanish, French, German, Japanese, and Arabic. Any voice can speak any supported language. If you omit the language field, the system guesses it from the script, defaulting to English for Latin text.

How do I handle long texts?

Split your text into chunks of up to 4096 characters per request. Generate audio for each chunk separately, then join the resulting audio files. This ensures reliable synthesis and stays within the character limit for a single API call.

What happens if the API is slow?

Requests are processed sequentially, so under load, your request may wait in a queue. Longer texts generate at roughly real-time speed. Short phrases may take a few seconds. Failed requests are free, so you can retry without charge if needed.

Is there an SDK for mobile?

No, there is no mobile SDK. You can use the standard OpenAI SDK or any HTTP client by pointing it to our base URL. This approach works on iOS, Android, and other platforms without requiring a specific mobile library.

Do I need to install anything?

No installation is required. The API is cloud-based and accessed via standard HTTP requests. You only need an API key and a way to send JSON payloads, such as a web browser, curl, or any programming language with HTTP capabilities.

How do I authenticate?

Include your API key in the Authorization header as a Bearer token: Authorization: Bearer tts-... . Each account has one active key at a time. You can generate a new key on your account page, which immediately deactivates the old one.

What is the maximum text length?

The maximum input length is 4096 characters per request. Spaces and punctuation count toward this limit. For longer texts, you must split the content into smaller chunks, generate audio for each, and then concatenate the resulting audio files.

Can I stream audio?

No, we do not support streaming or WebSocket connections. The API returns the complete audio file in the response body after synthesis is finished. You must wait for the full file to be generated before receiving the data.

First request

curl

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

LinguaCast offers two straightforward ways to create an account for your classroom or school IT department. You can sign up quickly using your Google account, which automatically provides a $0.50 trial credit valid for seven days. Alternatively, you can create an account using a standard email and password, though this method does not include the initial trial credit.

Sign up with Google

Sign up with Google

Visit the /get-api-key/ page and select the Google sign-in option. This method is the fastest way to get started and includes a $0.50 credit (about 50,000 characters) that expires in 7 days. It is ideal for teachers who want to test the API immediately without entering payment details.

  • Instant account creation
  • $0.50 trial credit included
  • Credit expires in 7 days

Sign up with email

Sign up with email

Choose the standard registration option to create an account using an email address and a password. This method is suitable for school IT teams managing multiple accounts or those who prefer traditional login credentials. Note that accounts created this way do not receive the initial trial credit.

  • Standard email/password registration
  • No trial credit included
  • Ideal for IT team management

Find your key

Once logged in, the dashboard displays your unique API key, current balance, and usage statistics. You can issue a new key at any time, which immediately invalidates the old one. Use this key in the Authorization header as 'Bearer tts-...' to authenticate your requests.

  • Key shown on dashboard
  • Revoke old key instantly
  • Format: Bearer tts-...

First Request with cURL

Sound wave illustration for: First Request with cURL

Send your first text-to-speech request using a simple cURL command. This example generates a short audio clip using the default settings, allowing you to verify that your API key and account balance are working correctly before integrating into your classroom tools.

The request sends JSON data to the API endpoint, specifying the model, input text, and desired voice. The server processes the request and returns the audio file directly in the response body, ready for immediate playback or storage.

Basic example

Use the following cURL command to generate speech. Replace YOUR_API_KEY with your actual key. The example uses the nova voice for a bright, upbeat tone suitable for educational content.

```bash curl -X POST https://api.bet11ph.com/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Hello class, welcome to today's lesson.", "voice": "nova", "response_format": "mp3"}' \ -o speech.mp3 ```

Authentication

Include your API key in the Authorization header as a Bearer token. The format is Authorization: Bearer tts-.... Ensure your key is valid and has sufficient balance. Failed requests are free: if synthesis fails, the charge is returned in full.

If you lose your key, you can generate a new one from the dashboard. The old key stops working immediately, ensuring secure access for your IT team.

Response format

On success, the API returns the audio file directly in the response body with the specified response_format (e.g., mp3, wav). The HTTP status code will be 200 OK.

If an error occurs, such as invalid input or insufficient funds, the API returns a JSON error object with a descriptive message and an appropriate HTTP status code.

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

Teachers often already use the OpenAI SDK for other tools. You can redirect it to LinguaCast’s API with a simple configuration change, keeping your existing code structure intact.

Base URL configuration

Set your client’s base URL to https://api.bet11ph.com/v1. This tells the SDK where to send your requests instead of the standard OpenAI endpoint.

Client initialization

Initialize the client using your LinguaCast API key. Ensure you pass the key via the standard Authorization header or the SDK’s API key parameter.

Speech generation

Call the audio.speech.create method with your text and voice. The SDK handles the JSON body and returns the audio file directly to your application.

  • Use models 'tts-1' or 'tts-1-hd'
  • Specify voice presets like 'nova' or 'atlas'

Supported Audio Formats

Sound wave illustration for: Supported Audio Formats

Choose the format that best fits your classroom technology stack. MP3 is the standard for web players and most learning management systems, offering a good balance of quality and file size. WAV provides uncompressed audio.

MP3

MP3 is the most widely supported format for educational platforms. It ensures compatibility with standard HTML5 audio players in most LMS environments without requiring additional plugins.

WAV

WAV files offer uncompressed audio, preserving the full quality of the generated speech.

OPUS, FLAC, PCM

OPUS provides high-quality audio at lower bitrates, suitable for bandwidth-constrained environments. FLAC offers lossless compression for archival purposes, while PCM delivers raw uncompressed audio data for specialized hardware integrations.

Available Voices

Sound wave illustration for: Available Voices

LinguaCast provides eight distinct voice presets designed for clarity in educational settings. Voices are based on licensed recordings: LibriTTS-R (CC BY 4.0), from LibriVox public-domain audiobook readings.

Female voices: Aria, Nova, Luna, Sage

Aria offers a warm, clear narration style ideal for reading textbooks. Nova provides a bright, upbeat tone suitable for engaging younger students. Luna delivers a soft, storytelling voice perfect for literature or history lessons. Sage is calm and instructional, making it excellent for step-by-step guides or instructions.

  • Aria: Warm, clear narrator
  • Nova: Bright, upbeat
  • Luna: Soft, storytelling
  • Sage: Calm, instructional

Male voices: Felix, Milo, Atlas, Orion

Felix brings energetic delivery, great for promotional announcements or quick updates. Milo sounds friendly and conversational, suitable for dialogue or informal explanations. Atlas provides a neutral, news-style tone for factual content. Orion offers a deep, documentary-style voice for serious or historical contexts.

  • Felix: Energetic, promo
  • Milo: Friendly, conversational
  • Atlas: Neutral, news
  • Orion: Deep, documentary

Voice characteristics

All eight voices can speak any of the 23 supported languages. If you do not specify a language, the system guesses it from the text script, defaulting to English for Latin characters. We recommend explicitly setting the language parameter for non-English texts to ensure accurate pronunciation. Every generated audio file includes an inaudible watermark to mark it as synthetic speech.

Available Voices

Rate Limits and Quotas

Sound wave illustration for: Rate Limits and Quotas

Manage your classroom audio generation efficiently by understanding our request limits. The API allows 60 requests per minute per key, ensuring steady performance for lesson preparation. Before your first top-up, you are limited to 10 requests per minute, which is sufficient for testing or small-scale classroom use.

60 requests per minute

Once your account is funded, the standard rate limit increases to 60 requests per minute. This capacity supports typical classroom workflows, such as generating multiple audio files for different reading passages or language exercises.

10 requests before top-up

New accounts start with a 10 requests per minute limit. This lower threshold allows you to verify integration without immediate billing pressure. You can upgrade to the higher limit by adding funds via USDT.

Handling limits

If you exceed the limit, requests may be delayed or rejected. Requests are processed sequentially, so under heavy load, synthesis may queue. We recommend implementing exponential backoff in your scripts to handle temporary throttling gracefully.

  • Split large text batches into smaller groups to avoid spikes.

Error Handling

Sound wave illustration for: Error Handling

When integrating LinguaCast into your classroom tools, understanding how the API handles issues ensures smooth audio delivery. Errors are returned as standard JSON objects, allowing your scripts to catch and manage failures without crashing the user experience.

Common errors

The API returns specific HTTP status codes for common issues. A 401 Unauthorized error means your API key is missing, invalid, or expired. A 429 Too Many Requests indicates you have hit the rate limit of 60 requests per minute. A 400 Bad Request usually means the input text exceeds the 4096-character limit or contains invalid parameters.

  • 401: Invalid or missing API key
  • 429: Rate limit exceeded (60 req/min)
  • 400: Invalid input or character limit exceeded

Retry logic

Implement exponential backoff for transient errors like 429 or 500 series errors. Since requests are processed sequentially, brief delays often resolve queue congestion. Retry after 1–2 seconds for rate limits, and slightly longer for server errors.

  • Wait 1 second before retrying on 429
  • Wait 2–5 seconds for 500 errors
  • Use exponential backoff to avoid overwhelming the API

Failed request refunds

If synthesis fails due to a server error or invalid input that prevents audio generation, the charge is returned in full. This ensures you only pay for successful audio files. Check the response status code to confirm if a charge was applied.

  • Full refund for failed synthesis requests
  • Failed requests are free: if synthesis fails, the charge is returned in full.
  • Balance updates automatically within minutes

Text Length Limits

Sound wave illustration for: Text Length Limits

The API accepts input text up to 4,096 characters per request. This limit applies to the entire string, including spaces and punctuation. For shorter lessons or announcements, a single call is sufficient to generate clear audio quickly.

4096 characters max

Each request processes up to 4,096 characters. If your text exceeds this, you must split it. The API does not handle long-form content in one go, so breaking chapters or long articles into smaller segments is required.

Splitting long texts

Divide your text into chunks of 4,096 characters or fewer. Send each chunk as a separate POST request. Ensure you maintain the correct voice and language settings for each part to keep the audio consistent across segments.

Joining audio files

Receive individual audio files for each chunk. Your application should concatenate these files in the original order. This approach ensures smooth playback of longer educational materials without exceeding character limits.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. This automatic detection simplifies integration for teachers who may not know the exact language code.

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. LibriTTS-R corpus (OpenSLR 141)
  4. W3C WAI: making audio and video accessible
  5. ISO 639 language codes
  6. Python documentation
  7. openai-python on GitHub
  8. LibriVox public-domain audiobooks
  9. OpenAI API reference: create speech
  10. openai-node on GitHub
  11. IETF RFC 7845: Ogg Opus
  12. Tether (USDT)

More on this site