API Documentation: Integrate Text to Speech in Minutes

By EchoEase editorial team · Updated 2026-11-19

This documentation helps product teams building assistive devices and elderly care tools integrate our text-to-speech API quickly. You will find clear, step-by-step instructions for generating API keys, making your first request, and configuring the OpenAI SDK for our endpoint.

We focus on clarity, predictable pricing, and voices that remain understandable in high-noise environments. The guide covers authentication, rate limits, error handling, and text chunking logic. You will also find a complete list of available voices, audio formats, and language settings. Use this page to get your first audio file generated in minutes and start testing with your assistive device prototype.

API Documentation: Integrate Text to Speech in Minutes

Frequently asked questions

How do I get my API key?

Sign up on the /get-api-key/ page using Google or email. The page displays your active key, balance, and usage details. Each account holds one active key at a time.

Can I use the OpenAI SDK with this API?

Yes. The endpoint matches the OpenAI speech endpoint shape. Update your SDK's base_url to https://api.bethkd.info/v1 and use your site key. Official OpenAI SDKs work directly with this configuration.

What is the maximum text length?

Each request accepts up to 4096 characters. For longer texts, split the input into parts of this size. Join the resulting audio files to create the final output.

How do I specify Hindi language?

Include the optional 'language' field with the ISO code 'hi' in your JSON body. If omitted, the system guesses the language from the script. Explicitly setting it ensures correct pronunciation.

What happens if I exceed the rate limit?

You are limited to 60 requests per minute per key. Requests are processed sequentially, so excess requests wait in a queue. New accounts start with 10 requests per minute.

Is the API key secure?

Use the Authorization: Bearer header to authenticate requests. Each account has one active key. You can rotate it anytime via the dashboard. The key stops working immediately upon rotation.

Can I rotate my API key?

Yes. Issue a new key from the dashboard at any time. The old key stops working immediately. This ensures secure access management without downtime for your integration.

What audio formats are supported?

Supported formats include mp3, wav, opus, flac, and pcm. Specify the desired format using the 'response_format' field in your request body. Choose based on your bandwidth and storage needs.

How do I handle failed requests?

Failed requests are free. If synthesis fails, the charge is returned in full. Check the response status code to identify failures and retry if necessary without incurring extra costs.

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 support.

Can I use custom voices?

No. The API offers eight preset voices: aria, nova, luna, sage, felix, milo, atlas, and orion. Custom voice cloning or uploading your own voice is not supported.

How is speed controlled?

Use the 'speed' field in the request body. Values range from 0.25 to 4.0. Adjust this parameter to make the speech slower or faster while maintaining clarity.

What is the base URL for the API?

The base URL is https://api.bethkd.info/v1. Use this for all API calls, including POST for speech and GET for voices and models. Ensure your SDK points to this address.

Do I need to install extra libraries?

No. You can use the official OpenAI SDK or plain HTTP. No proprietary library is required. Just configure the base URL and send standard JSON requests with your key.

First request

curl

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

Generate your API key via the /get-api-key/ page using Google or email. Each account holds one active key for the API base https://api.bethkd.info/v1.

Use the header Authorization: Bearer tts-... for all requests. The key authenticates your account and tracks usage against your balance.

Generate your API key

Generate your API key

Sign in at /get-api-key/ to create your key. Google sign-in includes a $0.50 trial credit valid for 7 days. Email accounts start with zero balance.

  • Google or email registration
  • Single active key per account

Bearer token usage

Bearer token usage

Include Authorization: Bearer tts-... in every API call. The key identifies your account for billing and rate limiting.

  • Standard Bearer format
  • Required for all endpoints

Key rotation policy

Issue a new key anytime via the dashboard. The old key stops immediately upon rotation, ensuring secure access control.

No expiration; keys remain valid until revoked.

  • Instant invalidation
  • No downtime

First Request with cURL

Sound wave illustration for: First Request with cURL

Send a POST request to the speech endpoint with your text and voice preference. The API returns an audio file directly in the response body, ready for immediate playback or storage in your assistive device software.

Basic command example

Use this cURL command to generate speech. Replace YOUR_API_KEY with your token from the /get-api-key/ page.

curl -X POST https://api.bethkd.info/v1/audio/speech -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "tts-1", "input": "Hello, this is a test.", "voice": "sage", "response_format": "mp3"}'

Required JSON fields

The request body must include model ("tts-1" or "tts-1-hd"), input (text up to 4096 characters), and voice (one of the 8 presets like "aria" or "atlas"). The response_format determines the output file type.

  • model: tts-1 or tts-1-hd
  • input: max 4096 characters
  • voice: e.g., sage, nova
  • response_format: mp3, wav, opus, flac, or pcm

Response handling

On success, the API returns the audio file directly. Failed requests return an error JSON and do not charge your balance. Handle the binary audio data by saving it to a file or piping it to your device's audio player.

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

The OpenAI SDKs work seamlessly with our API by simply redirecting the base URL. This allows product teams using standard Python or Node.js libraries to generate audio without writing custom HTTP parsers.

You can use the official OpenAI SDKs for convenience. You do not need to build a dedicated client library for our API.

Base URL configuration

Set the API base URL to https://api.bethkd.info/v1. This endpoint handles all TTS requests and mirrors the standard OpenAI structure.

Ensure your authentication header uses the Authorization: Bearer format with your unique key.

  • Base URL: https://api.bethkd.info/v1
  • Auth Header: Authorization: Bearer tts-...

Client initialization

Initialize the client using your preferred language SDK (Python or Node.js). Pass the base URL and your API key during instantiation.

  • Use the standard OpenAI client constructor
  • Pass base_url and api_key parameters

Code snippet example

Below is a Python example. It sends a text payload and receives an audio file directly.

The code handles the request and returns the audio bytes for immediate playback or storage.

Available Voices and Formats

Sound wave illustration for: Available Voices and Formats

The API provides eight distinct voice presets, derived from licensed recordings and public-domain audiobook readings. These voices are designed to remain clear and understandable, even in high-noise environments typical of assistive devices or elderly care settings. Each voice offers a specific tonal quality, from warm narrators to energetic promos, ensuring your application sounds natural without being distracting.

Audio output is available in multiple formats to suit different bandwidth and playback constraints. While MP3 and WAV are standard, the API also supports OPUS, FLAC, and PCM for specialized use cases. All generated files include an inaudible watermark to identify them as synthetic speech, which helps in auditing and quality control for product teams.

List of 8 presets

Select from four female and four male voices, each optimized for different content types. You can choose a soft, storytelling voice for bedtime stories or a calm, instructional voice for medication reminders. All voices support all 23 supported languages, allowing consistent user experience across diverse demographics.

The voices are based on licensed recordings from LibriTTS-R (CC BY 4.0) and public-domain readings from LibriVox. This ensures high legal clarity for your product.

  • 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

Audio formats (mp3, wav)

MP3 is recommended for general use due to its small file size and wide compatibility with mobile and embedded devices. WAV offers lossless quality, suitable for high-fidelity playback or archival purposes. OPUS and FLAC provide efficient compression with high quality, ideal for low-bandwidth connections.

PCM is available for raw audio processing needs. The choice of format should balance clarity with the device's storage and processing capabilities. Faster processing may be needed for WAV files due to their larger size, but the API handles this efficiently.

  • MP3: Recommended for most devices
  • WAV: Lossless quality
  • OPUS: Efficient compression
  • FLAC: High-quality lossless
  • PCM: Raw audio data

Voice selection guide

For elderly care applications, choose voices with clear enunciation and moderate pacing. Sage or Aria are often suitable for instructional content, while Luna works well for narrative content. Avoid overly energetic voices like Felix for calming environments.

Consider the context of use. For news updates, Atlas provides a neutral tone. For conversational interfaces, Milo’s friendly tone can enhance user engagement. Test voices with your target audience to ensure they remain understandable in your specific device environment.

  • Aria: Narration
  • Nova: Upbeat updates
  • Luna: Stories
  • Sage: Instructions
  • Felix: Promos
  • Milo: Conversations
  • Atlas: News
  • Orion: Documentaries

Language and Speed Parameters

Sound wave illustration for: Language and Speed Parameters

The API supports 23 languages, from Arabic to Turkish. You can explicitly set the language parameter using an ISO code to ensure accurate pronunciation, especially for non-English Latin text. If omitted, the system guesses the language, defaulting to English for Latin scripts.

Adjust speech speed between 0.25 and 4.0 to match your device’s audio profile. Slower speeds improve clarity for elderly users with hearing impairments, while faster rates suit high-noise environments. Voices remain natural across the full range.

ISO language codes

Specify the language field with standard ISO 639-1 codes (e.g., en, es, de). This prevents mispronunciation when the input text uses shared scripts. 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.

  • Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Turkish

Speed range 0.25–4.0

The speed parameter accepts values from 0.25 to 4.0. A setting of 1.0 plays audio at normal pace. Lower values (e.g., 0.75) enhance comprehension for users with cognitive or auditory processing challenges. Higher values compress speech for quick updates in noisy settings.

Default language guessing

If you do not provide a language code, the API infers it from the text script. Latin text defaults to English. For other Latin-script languages like Spanish or French, always set the language parameter to avoid English pronunciation artifacts. Cyrillic or CJK scripts are detected automatically.

Language and Speed Parameters

Rate Limits and Quotas

Sound wave illustration for: Rate Limits and Quotas

Under load, requests are processed sequentially, so generation may wait in a queue. Typical speed is roughly real-time, taking about 25 characters of text per second for long texts, while short phrases take a few seconds.

Our straightforward quotas ensure predictable behavior for assistive device workflows. Understanding these limits helps product teams design robust retry logic without over-provisioning.

60 requests per minute

Each API key is limited to 60 requests per minute. This limit applies uniformly across all requests, ensuring fair usage for your integration.

If you exceed this rate, subsequent requests will be queued rather than rejected immediately, though processing time may increase.

  • Limit: 60 requests/minute per key
  • Applies to all request types
  • Queued under load

Pre-top-up limits

Before your first top-up, the rate limit is lower: 10 requests per minute. This allows you to test the integration without immediate capacity constraints.

Once you add USDT via TRC-20, your limit automatically increases to the standard 60 requests per minute.

  • Pre-top-up: 10 requests/minute
  • Post top-up: 60 requests/minute
  • No manual adjustment needed

Queue behavior

Requests are processed one after another. If the system is busy, your request will wait in a queue.

This sequential processing ensures consistent audio quality and predictable billing, even during peak usage periods.

  • Sequential processing
  • Queued under high load
  • Predictable billing

Error Handling and Status Codes

Sound wave illustration for: Error Handling and Status Codes

Errors return standard HTTP codes to indicate synthesis status. Failed requests are free, with the charge returned in full if synthesis fails. Understanding these responses helps you maintain reliable audio generation pipelines without unexpected costs.

Common error codes

Use 400 Bad Request for invalid JSON or missing fields. 401 Unauthorized indicates an invalid or expired Bearer token. 429 Too Many Requests means you have exceeded the 60 requests per minute limit per key.

Retry strategies

Implement exponential backoff for 429 and 500 errors. Since requests are processed sequentially, long texts may queue, causing temporary delays. Do not retry failed requests immediately; wait briefly to avoid further rate limiting.

Billing error cases

If synthesis fails, the charge is returned in full. Check your balance on the dashboard if charges seem incorrect. Ensure your USDT top-up is confirmed on the TRON network, as pending transactions may show zero balance.

Text Limits and Chunking

Sound wave illustration for: Text Limits and Chunking

The API accepts up to 4,096 characters per request. This limit applies to the full input string, including spaces and punctuation. If your source text exceeds this threshold, you must split it into smaller segments before sending requests.

4096 character limit

Each API call processes a single text block. Exceeding the character count returns an error. Ensure your application handles truncation or splitting logic to stay within this boundary.

Splitting long texts

Divide long articles or instructions into chunks of 4,096 characters or fewer. Send each chunk as a separate POST request. This approach ensures reliable synthesis without data loss or truncation errors.

Audio joining logic

The API returns individual audio files for each chunk. Your client must concatenate these files in order to reconstruct the full audio stream. This keeps memory usage low for assistive devices with limited resources.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. This helps maintain transparency in assistive devices where users need to distinguish between human-recorded and AI-generated content.

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. Tether (USDT)
  4. LibriVox public-domain audiobooks
  5. Python documentation
  6. Node.js documentation
  7. MDN: Web Speech API
  8. LibriTTS-R corpus (OpenSLR 141)
  9. OpenAI API reference: create speech
  10. openai-node on GitHub
  11. openai-python on GitHub
  12. TRON developer hub: TRC-20

More on this site