Text-to-Speech API Documentation and Integration

By LingoTale editorial team · Updated 2026-11-19

This documentation provides the technical specifications for the LingoTale Text-to-Speech API, designed for content creators and language learning platforms requiring precise multilingual synthesis. You will find concrete integration details for generating audio files via JSON requests, covering supported endpoints, parameter constraints, and response handling for our 23-language infrastructure.

Integrate seamlessly using the standard OpenAI SDK by adjusting the base URL, or execute direct HTTP calls with provided cURL examples. This guide covers authentication, rate limits, and error handling to ensure reliable deployment in production environments.

Note that LingoTale does not offer streaming, SSML, or custom voice cloning. The API returns complete audio files upon request completion, supporting formats such as MP3, WAV, OPUS, FLAC, and PCM.

Text-to-Speech API Documentation and Integration

Frequently asked questions

What is the API endpoint for speech generation?

Send a POST request to https://api.godbet.info/v1/audio/speech with a JSON body containing the text, voice, model, and other parameters. The endpoint accepts standard TTS parameters and returns the generated audio file directly in the response body.

How do I authenticate requests?

Include your API key in the request header using the format: Authorization: Bearer tts-... . Each account holds one active key at a time; issuing a new key immediately invalidates the previous one.

Does the API support the OpenAI SDK?

Yes, the request shape matches the OpenAI speech endpoint. You can use official OpenAI SDKs by changing the base_url to https://api.godbet.info/v1 and providing your site-specific key for authentication.

What models are available?

Two models are available: tts-1 and tts-1-hd. Both use the same underlying engine and pricing structure, allowing you to choose based on quality preferences without affecting cost or usage limits.

What input formats are supported?

The API accepts plain text input in the input field. It does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. Text is processed directly without markup interpretation.

How do I set the language?

Pass the optional language parameter with an ISO code. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Explicitly set it for non-English Latin-script content.

What is the maximum input length?

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

Can I control the speech speed?

Yes, use the speed parameter with a value between 0.25 and 4.0. This allows you to adjust the playback rate of the generated audio to suit your specific content needs.

What audio formats are available?

You can request audio in mp3, wav, opus, flac, or pcm formats by setting the response_format parameter. The generated audio is returned directly in the HTTP response.

What are the rate limits?

The limit is 60 requests per minute per key. Before the first top-up, the limit is 10 requests per minute. Requests are processed sequentially, so high load may cause queuing.

How do I handle errors?

Failed requests are free, and the charge is returned in full if synthesis fails. Monitor the HTTP response status code to detect errors and retry if necessary, keeping the rate limit in mind.

Is there a WebSocket endpoint?

No, there is no WebSocket endpoint or real-time streaming support. The API returns the complete audio file upon request completion. Generated audio is returned in the response and not stored.

Do I need an API key for every request?

Yes, every request must include the Authorization header with your Bearer token. Each account has one active key, which you can retrieve and manage via the /get-api-key/ page.

How do I list available voices?

Send a GET request to /v1/voices. This endpoint returns details on available voices, languages, formats, and pricing information. You can also check /v1/models for model-specific details.

First request

curl

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

LingoTale’s Text-to-Speech API requires a valid API key for all requests. Each account maintains a single active key, which is issued upon sign-up and displayed on the dashboard.

Keys are used to authenticate requests and track usage against your billing balance. You can rotate your key at any time without service interruption.

API Key Format

API Key Format

API keys follow the format tts- followed by a unique alphanumeric string. You can find your current key in the account dashboard under the /get-api-key/ section.

Bearer Token Usage

Bearer Token Usage

Include your key in the HTTP Authorization header using the Bearer scheme. For example: Authorization: Bearer tts-1234567890abcdef.

Ensure the header is included in every request to the API endpoint to avoid 401 Unauthorized errors.

Key Rotation Policy

You can generate a new key from the dashboard at any time. When a new key is issued, the previous key is immediately invalidated.

Update your integration configuration promptly after rotation to avoid request failures. Only one key is active per account.

Endpoints

Sound wave illustration for: Endpoints

LingoTale exposes three primary REST endpoints for text-to-speech operations. The core speech generation endpoint accepts POST requests to synthesize audio, while the voices and models endpoints provide metadata for integration setup.

Speech Generation Endpoint

Send a POST request to https://api.godbet.info/v1/audio/speech. The JSON body requires model, input, voice, and response_format. Audio is returned directly as the response body.

Voices Listing Endpoint

A GET request to https://api.godbet.info/v1/voices returns available voice presets, supported languages, and audio formats. This allows dynamic selection of voices like 'aria' or 'atlas' without hardcoding.

Models Listing Endpoint

Query https://api.godbet.info/v1/models to retrieve available model identifiers. Both 'tts-1' and 'tts-1-hd' utilize the same underlying engine and pricing structure.

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts two model identifiers, tts-1 and tts-1-hd, which utilize the same underlying engine and pricing structure. Selecting either parameter yields identical audio quality for standard character-based billing. Input text is restricted to a maximum of 4096 characters per request, with spaces and punctuation counting toward this limit. For longer content, split the text into chunks and join the resulting audio files. The synthesis speed typically mirrors real-time processing, averaging 25 characters per second, though queue latency may apply during high load.

Voice selection requires one of eight preset identifiers, such as aria for narration or atlas for news. The optional language field accepts ISO codes to specify the target language. If omitted, the system guesses the language from the script, defaulting to English for Latin text. This explicit setting ensures accuracy for non-English Latin-script content, preventing misidentification of dialects or accents.

Model Selection

The API accepts two model identifiers, tts-1 and tts-1-hd, which utilize the same underlying engine and pricing structure. Selecting either parameter yields identical audio quality for standard character-based billing.

Input Text Limits

Input text is restricted to a maximum of 4096 characters per request, with spaces and punctuation counting toward this limit. For longer content, split the text into chunks and join the resulting audio files. The synthesis speed typically mirrors real-time processing, averaging 25 characters per second, though queue latency may apply during high load.

Voice and Language Settings

Voice selection requires one of eight preset identifiers, such as aria for narration or atlas for news. The optional language field accepts ISO codes to specify the target language. If omitted, the system guesses the language from the script, defaulting to English for Latin text. This explicit setting ensures accuracy for non-English Latin-script content, preventing misidentification of dialects or accents.

Response Formats

Sound wave illustration for: Response Formats

The API returns synthesized audio as binary data, eliminating the need for intermediate file storage. Supported output formats include mp3, wav, opus, flac, and pcm, allowing direct integration into diverse playback environments. Each generated file contains an inaudible watermark identifying the content as synthetic speech.

Audio File Formats

Select the desired format via the response_format parameter. MP3 offers efficient compression for web delivery, while WAV and FLAC provide lossless quality for archival or professional editing. PCM is available for raw audio data, and OPUS provides high-efficiency compression.

Binary Response Handling

Successful responses deliver the audio file directly in the response body. Clients must handle the binary stream immediately, as the data is not stored on our servers. Ensure your client library correctly interprets the MIME type associated with the selected format to prevent playback errors.

Error Codes

Errors return standard HTTP status codes with a JSON body describing the issue. Failed synthesis requests are free, with any pre-charged amount refunded in full. Common errors include invalid API keys, excessive request length, or unsupported voice parameters.

SDK Integration

Sound wave illustration for: SDK Integration

Integrate LingoTale’s TTS API using the official OpenAI SDK by overriding the base URL. This approach allows you to use standard SDK methods without rewriting client logic. Simply configure the SDK to point to https://api.godbet.info/v1 and supply your Bearer token.

This method works because our endpoint structure matches the OpenAI speech API. You can send text, select a voice, and receive audio files using the same code patterns you already know for the OpenAI speech API.

OpenAI SDK Configuration

The LingoTale API accepts the same request shape as OpenAI’s speech endpoint. By setting the base URL to https://api.godbet.info/v1, you can use existing OpenAI SDK clients directly. Ensure your authentication header uses the format Bearer tts-... with your unique site key.

Base URL Modification

Configure your SDK client to route requests to https://api.godbet.info/v1 instead of the default OpenAI endpoint. This single change directs all speech synthesis calls to our infrastructure while maintaining compatibility with standard SDK parameters like model, voice, and input text.

Python Example

```python import openai client = openai.OpenAI(base_url="https://api.godbet.info/v1", api_key="tts-your-api-key") speech_file = client.audio.speech.create( model="tts-1", voice="nova", input="Hello from LingoTale." ) speech_file.write_to_file("output.mp3") ```

SDK Integration

cURL Examples

Sound wave illustration for: cURL Examples

The LingoTale API accepts standard JSON payloads, making integration straightforward for developers familiar with common HTTP clients. Below are practical cURL commands demonstrating core usage patterns for text-to-speech synthesis.

Basic Request

Send a simple synthesis request using the default "tts-1" model. The command specifies the English voice "nova" and requests an MP3 file. Replace YOUR_API_KEY with your actual credential from the dashboard.

  • curl -X POST "https://api.godbet.info/v1/audio/speech" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Hello world", "voice": "nova", "response_format": "mp3"}' \ -o output.mp3

Custom Speed

Adjust the playback rate between 0.25 and 4.0. This example sets the speed to 1.5x for the "aria" voice, useful for accelerating language learning exercises or reviewing dense content quickly.

  • curl -X POST "https://api.godbet.info/v1/audio/speech" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Fast speech example", "voice": "aria", "speed": 1.5, "response_format": "wav"}' \ -o fast.wav

OPUS Format Output

Request OPUS format for efficient bandwidth usage. The output is saved as a binary file named audio.opus.

  • curl -X POST "https://api.godbet.info/v1/audio/speech" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1-hd", "input": "Efficient audio", "voice": "milo", "response_format": "opus"}' \ -o audio.opus

Rate Limits

Sound wave illustration for: Rate Limits

Requests are processed sequentially, which means generation time depends on queue depth. Under load, a request may wait in line before synthesis begins, affecting total latency for large batches.

Requests Per Minute

Each API key is limited to 60 requests per minute. This limit applies to the POST /v1/audio/speech endpoint. Exceeding this threshold returns a 429 Too Many Requests error.

New Account Limits

New accounts start with a reduced limit of 10 requests per minute. This applies until the first top-up is credited to the account balance. After topping up, the limit increases to 60 requests per minute.

Queue Behavior

Requests are processed one after another. If multiple requests are sent simultaneously, they are queued. Longer texts take more time to generate, potentially holding the queue. Plan batch sizes accordingly to avoid delays.

Error Handling

Sound wave illustration for: Error Handling

The API returns standard HTTP status codes to indicate request outcomes. A 200 OK confirms successful audio generation, while 4xx errors typically indicate authentication or input validation failures. The system returns 5xx codes if the service experiences temporary internal issues.

Common Error Codes

Use the provided error details to diagnose issues. A 400 Bad Request often results from exceeding the 4096-character limit or using an invalid voice ID. A 401 Unauthorized occurs when the Bearer token is missing or invalid. A 429 Too Many Requests indicates you have surpassed the 60 requests per minute limit.

  • 400: Invalid parameters or input length exceeded
  • 401: Invalid or missing API key
  • 429: Rate limit exceeded
  • 500: Internal server error

Retry Logic

Implement exponential backoff for 5xx and 429 errors. Since requests are processed sequentially, brief delays between retries prevent queue congestion. Do not retry 400 or 401 errors without modifying the request or credentials.

Refund Policy

Failed synthesis requests incur no charge. If a request fails, the character count is not deducted from your balance. Ensure your application checks the HTTP status before consuming the response stream to avoid billing errors.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. There are no monthly plans, no minimum spend requirements, and no per-seat fees.

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. IETF RFC 7845: Ogg Opus
  3. openai-node on GitHub
  4. ISO 639 language codes
  5. Python documentation
  6. Tether (USDT)
  7. curl documentation
  8. MDN: Web Speech API
  9. openai-python on GitHub
  10. TRON developer hub: TRC-20
  11. OpenAI API reference: create speech
  12. W3C WAI: making audio and video accessible

More on this site