Integrate Text-to-Speech API into Your Mobile App

By LingoSpeak editorial team · Updated 2026-11-18

This guide shows indie mobile developers how to add reliable text-to-speech to their apps using a simple API. You will learn to generate audio files from text with just a few lines of code, integrating seamlessly into your existing workflow without enterprise bloat.

We cover authentication, request parameters, and supported formats like MP3 and OPUS. You will also see how to handle rate limits, errors, and use the OpenAI SDK for easy integration. Everything you need to get started is here.

Integrate Text-to-Speech API into Your Mobile App

Frequently asked questions

How do I authenticate with the API?

Include your API key in the request header as Authorization: Bearer tts-.... Each account has one active key at a time. You can issue a new key at any time via the dashboard, and the old key stops working immediately.

What is the endpoint for generating speech?

Send a POST request to https://api.abm96casino.com/v1/audio/speech. Provide the text, voice model, and other parameters in a JSON body. The API returns the generated audio file directly in the response.

Can I use the OpenAI SDK with this API?

Yes. The request shape matches the OpenAI speech endpoint. Simply change the base_url to https://api.abm96casino.com/v1 in your OpenAI SDK configuration and use your site’s API key for authentication.

What are the rate limits for the API?

You are limited to 60 requests per minute per key. If you have not topped up your account yet, the limit is 10 requests per minute. Exceeding this may cause requests to queue or fail.

What audio formats are supported?

You can choose from mp3, wav, opus, flac, or pcm. Select your preferred format using the response_format field in your request body. These formats cover most mobile app audio playback needs.

How do I handle failed requests?

If synthesis fails, the charge is returned in full. You do not lose credits for failed requests. Check your response status to determine if the request was successful or if an error occurred.

Is there a limit on text length per request?

Each request supports up to 4096 characters of input text. For longer texts, split them into parts of this size, generate audio for each, and join the resulting audio files in your app.

How do I change my API key?

You can issue a new key at any time through your account dashboard. When you generate a new key, the old one stops working immediately, ensuring secure access management for your mobile app.

Does the API support streaming audio?

No. The API returns the complete audio file in the response. There is no WebSocket or real-time partial audio streaming. You receive the full file once generation is complete.

Can I adjust the speed of the speech?

Yes. You can set the speed parameter between 0.25 and 4.0. This allows you to speed up or slow down the narration to fit your app’s audio style and user preferences.

How do I specify the language?

Use the optional language field with an ISO code. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Explicitly setting it ensures correct pronunciation for non-English text.

What happens if I exceed the rate limit?

Requests are processed sequentially. Under load, requests may wait in a queue. Requests are processed one after another, so under load a request may wait in a queue. Stick to 60 requests per minute for smooth operation.

Is the API compatible with mobile apps?

Yes. The API is designed for easy integration into mobile applications. Use standard HTTP requests or the OpenAI SDK to generate audio from text, making it simple to add voice features to your app.

How do I get my API key?

Sign up on the /get-api-key/ page using Google or email. Your account page displays your API key, balance, and usage stats. You can also start with a free trial credit upon Google sign-in.

First request

curl

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

Authentication

Sound wave illustration for: Authentication

Secure your API access by including a Bearer token in the Authorization header of every request. This single key authenticates your mobile app’s voice synthesis calls to the LingoSpeak endpoint.

Bearer token in header

Include your API key as Authorization: Bearer tts-... in the HTTP header. This standard method ensures your requests are authenticated without cluttering the URL.

One active key per account

Each account holds exactly one active API key. This simplicity reduces integration complexity for indie developers who need a straightforward, single-point authentication method.

Revoke old keys instantly

Issue a new key at any time via your dashboard. The previous key stops working immediately, ensuring tight security without waiting for expiration periods.

Speech Generation Endpoint

Sound wave illustration for: Speech Generation Endpoint

The core of the LingoSpeak API is the speech generation endpoint. You send a POST request to https://api.abm96casino.com/v1/audio/speech with your text and configuration. This endpoint processes your input and returns the synthesized audio file, allowing you to integrate voice directly into your mobile app's user interface.

POST /v1/audio/speech

Send text to this endpoint to generate audio. The request must include your API key in the Authorization header and a JSON body containing the model, input, and voice parameters. The API handles the synthesis and returns the audio file in the specified format.

JSON body format

Structure your request as a JSON object. Include model ("tts-1" or "tts-1-hd"), input (your text, up to 4096 characters), voice (one of 8 presets), and response_format (mp3, wav, opus, flac, or pcm). You can also optionally set speed (0.25–4.0) and language.

  • model: "tts-1" or "tts-1-hd"
  • input: string, max 4096 characters
  • voice: one of 8 presets
  • response_format: mp3, wav, opus, flac, pcm

Returns audio file

The API returns the generated audio file directly in the response body. This allows you to play the audio immediately in your app or save it for later use. Failed requests are free, so you only pay for successful synthesis.

Speech Generation Endpoint

Request Parameters

Sound wave illustration for: Request Parameters

Configure your synthesis requests by selecting the model, voice, and audio parameters. The API accepts tts-1 and tts-1-hd models, which use the same engine and pricing but allow you to choose between standard and high-definition output. You must specify one of eight voice presets, such as Aria or Felix, and optionally set a speed between 0.25 and 4.0. The input text must not exceed 4096 characters per request.

Language handling is automatic but can be explicit. If the language field is omitted, the system guesses the language from the script, defaulting to English for Latin text. For non-English Latin-script inputs, always set the language code. Supported languages include Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, and Turkish.

Model selection (tts-1, tts-1-hd)

Both models use the same engine and price. Choose tts-1 for standard quality or tts-1-hd for higher fidelity. The API key and rate limits apply equally to both.

You can switch models per request without any configuration changes. Both formats accept the same voice presets and parameters.

  • Standard quality: tts-1
  • High definition: tts-1-hd
  • Same price: $0.01 per 1,000 characters
  • Same engine performance

Voice preset selection

Select from eight distinct voice presets based on your app’s tone. Female voices include Aria (warm narrator), Nova (bright and upbeat), Luna (soft storytelling), and Sage (calm instructional). Male options include Felix (energetic promo), Milo (friendly conversation), Atlas (neutral news), and Orion (deep documentary).

Every voice is based on licensed recordings: LibriTTS-R (CC BY 4.0), from LibriVox public-domain audiobook readings. Every generated file includes an inaudible watermark identifying it as synthetic speech.

  • 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 and language options

Adjust the speech rate using the speed parameter, which accepts values from 0.25 to 4.0. This allows you to fine-tune the pacing for your specific use case, whether it’s a fast-paced promo or a slow, clear instructional guide.

Set the language field with an ISO code for precise control. If omitted, the system guesses the language from the script. For non-English Latin-script text, you must set the language explicitly. The API supports 23 languages, including English, Spanish, French, German, Chinese, Japanese, Korean, Arabic, Hindi, and more. It does not support Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, or Bengali.

  • Speed range: 0.25 to 4.0
  • 23 supported languages
  • Automatic language detection if field is empty
  • Explicit language setting recommended for non-English Latin text

Supported Audio Formats

Sound wave illustration for: Supported Audio Formats

The API supports five audio formats to suit different mobile app needs: MP3, WAV, OPUS, FLAC, and PCM. Each format offers a different balance of file size, quality, and compatibility. MP3 is widely supported and compressed, making it ideal for general use. WAV provides uncompressed audio for higher fidelity. OPUS offers efficient compression for voice-heavy content.

FLAC provides lossless compression, preserving the full audio quality. PCM is an uncompressed raw format, useful for specific processing pipelines. Choose the format that best fits your app’s storage and playback requirements.

MP3, WAV, OPUS

MP3 is the most widely supported format, offering a good balance between file size and quality. It is ideal for general use cases where storage space is a concern. WAV provides uncompressed audio, ensuring the highest fidelity for critical audio segments. OPUS is efficient for voice-heavy content, reducing bandwidth usage while maintaining clarity.

These formats are suitable for most mobile apps. MP3 is recommended for background narration or UI sounds. WAV is better for short, high-quality sound effects. OPUS is ideal for longer voiceovers where data efficiency is important.

  • MP3: Compressed, widely supported, good for general use
  • WAV: Uncompressed, high fidelity, suitable for short clips
  • OPUS: Efficient compression, ideal for voice-heavy content

FLAC and PCM support

FLAC offers lossless compression, preserving the full audio quality without increasing file size significantly. It is suitable for apps where audio quality is paramount but storage space is a concern. PCM is an uncompressed raw format, useful for specific processing pipelines or when maximum compatibility is required.

Use FLAC for high-quality audio that needs to be stored efficiently. PCM is ideal for raw audio data that will be processed further or played back by specific hardware or software.

  • FLAC: Lossless compression, preserves quality, reduces file size
  • PCM: Uncompressed raw format, maximum compatibility, useful for processing

Choose based on quality needs

Select the format based on your app’s specific requirements. For general use, MP3 is recommended due to its balance of size and quality. For high-fidelity needs, WAV or FLAC are better choices. OPUS is ideal for voice-heavy content where data efficiency is crucial.

Consider the target devices and their supported formats. MP3 is compatible with almost all devices, while WAV and FLAC may require specific codecs. PCM is universally supported but results in larger file sizes.

Always test the chosen format with your app’s audio player to ensure compatibility and performance.

  • MP3: Compressed, widely supported, good for general use
  • WAV: Ideal for high-fidelity, short clips
  • OPUS: Efficient for voice-heavy content
  • FLAC: Lossless quality with smaller file size
  • PCM: Raw, uncompressed audio for processing

Rate Limits

Sound wave illustration for: Rate Limits

Our API enforces a standard rate limit of 60 requests per minute per API key, allowing indie developers to generate audio at a steady pace without overwhelming the service. This limit applies uniformly across all endpoints to ensure consistent performance for your mobile app's background synthesis tasks.

Before your first top-up, new accounts start with a reduced limit of 10 requests per minute. This ensures fair usage during the trial phase. Once you add USDT (TRC-20), your limit increases to the full 60 requests per minute immediately.

60 requests per minute

After topping up, your account supports up to 60 requests per minute. This throughput is sufficient for most mobile app features, such as generating voiceovers for short UI prompts or narrative segments.

If you need to process longer texts, split them into chunks of 4096 characters. Each chunk counts as one request toward your per-minute limit.

  • Limit resets every 60 seconds.
  • Applies per API key, not per user.

10 requests before top-up

New accounts begin with a 10 requests per minute cap. This allows you to test integration without immediate high-volume pressure.

Add USDT to TRC-20 to unlock the full 60 requests per minute. Top-ups are credited automatically within minutes.

Queue processing under load

Requests are processed sequentially. Under heavy load, your request may wait in a queue before synthesis begins. Short phrases typically take a few seconds, while longer texts process at roughly real-time speed (25 characters per second).

Requests are processed one after another, so under load a request may wait in a queue.

  • No SLA guarantees for queue wait times.
  • No priority queues for paid tiers.
Rate Limits

Error Handling

Sound wave illustration for: Error Handling

When synthesis fails, you never pay for the wasted compute. If the API returns an error, the charge is returned in full, so you can retry or adjust your input without losing credits. This safety net is essential for mobile apps where network conditions or input lengths vary.

Failed requests are free

A failed synthesis does not deduct from your balance. Whether the text exceeds the 4096-character limit or the engine times out, you get your credit back immediately. This ensures your mobile app’s audio feature remains cost-effective even during unexpected errors.

  • No charge for failed synthesis requests
  • Credits returned instantly to your account
  • Safe to retry failed requests

Standard HTTP error codes

The API returns standard HTTP status codes to indicate the result. Use 400 for bad requests (e.g., missing fields) and 500 for server issues. These codes help your mobile app handle errors gracefully without crashing.

Check response status

Always check the HTTP status code before parsing the audio. A 200 OK means the audio file is included in the response body. For errors, the response body contains details about what went wrong, allowing you to log or display the issue to the user.

OpenAI SDK Compatibility

Sound wave illustration for: OpenAI SDK Compatibility

You do not need to learn a new library or install a custom SDK. Our API is fully compatible with the official OpenAI SDKs, allowing you to reuse your existing codebase with minimal changes. This means you can integrate speech synthesis into your mobile app using the same tools you already know.

Change base_url

Update your SDK configuration to point to our API endpoint. Set the base URL to https://api.abm96casino.com/v1. This simple change directs all requests to our service while keeping your authentication and request logic intact.

Use official SDKs

Leverage the standard OpenAI SDKs for your preferred language. Whether you are using Python, JavaScript, or Go, the official libraries work seamlessly. You simply swap the base URL and use your LingoSpeak API key for authentication.

Same request shape

The JSON body structure mirrors the OpenAI speech endpoint exactly. Send your text, select a voice, and specify the model. The response returns the audio file directly, requiring no extra parsing or custom handling logic.

OpenAI SDK Compatibility

Example Request with cURL

Sound wave illustration for: Example Request with cURL

Generating audio is straightforward with a simple HTTP POST request. The API expects a JSON body containing your text, selected voice, and preferred format. You receive the audio file directly in the response, ready for immediate playback in your mobile app.

The following cURL example demonstrates the standard workflow. It sends a short text string to the synthesis endpoint, authenticating with your API key. This single request returns the audio data, which you can then save or play within your application.

Basic cURL command

Use the standard POST method to send your request to the speech endpoint. The command structure remains consistent across different programming environments, making it easy to adapt for iOS or Android backend calls.

  • - Use POST method
  • - Target /v1/audio/speech endpoint
  • - Send JSON payload

Include API key

Authentication is handled via the Authorization header. Include your unique Bearer token to validate your request and deduct characters from your balance.

  • - Header: Authorization: Bearer tts-...

Send text input

The input field accepts up to 4096 characters. Ensure your text is properly escaped within the JSON structure to avoid parsing errors.

  • - Max 4096 characters per request
  • - Specify voice and format
  • - Include model selection

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Crafting delightful mobile apps requires deep empathy and relentless iteration.

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. W3C WAI: making audio and video accessible
  3. TRON developer hub: TRC-20
  4. FFmpeg documentation
  5. curl documentation
  6. openai-python on GitHub
  7. Creative Commons Attribution 4.0
  8. ISO 639 language codes
  9. LibriTTS-R corpus (OpenSLR 141)
  10. OpenAI API reference: create speech
  11. MDN: Web Speech API
  12. Tether (USDT)

More on this site