API Documentation for Text-to-Speech Integration

By EchoScript editorial team · Updated 2026-11-18

This guide shows indie developers how to integrate EchoScript’s text-to-speech API using standard tools. You will learn to generate audio files via simple cURL commands or by adapting existing code with the official OpenAI SDK. The documentation covers key steps from authentication to handling responses, ensuring you can add voice synthesis to your projects efficiently.

Designed for freelancers who need reliable TTS, this page provides concrete examples for generating speech with specific voices, formats, and speeds. You will see exactly how character-based pricing works, how to handle rate limits, and how to manage your API key. All information is based on the current product facts, so you can build with verified details.

API Documentation for Text-to-Speech Integration

Frequently asked questions

How do I get an API key?

Sign up on https://123kyatslot.com/get-api-key/ using Google or email. Your key starts with 'tts-'. One active key per account; issuing a new one immediately invalidates the old one. You can find your key, balance, and usage stats on the dashboard after logging in.

What is the base URL for the API?

The base URL is https://api.123kyatslot.com/v1. Use the POST endpoint https://api.123kyatslot.com/v1/audio/speech for synthesis. Other endpoints include GET /v1/voices and GET /v1/models. This structure matches the OpenAI API shape, allowing standard SDK integration.

Can I use the OpenAI Python SDK?

Yes. The API accepts the same request shape as OpenAI. Configure your OpenAI SDK client by setting the base_url to https://api.123kyatslot.com/v1 and providing your 'tts-...' key. This allows you to use official OpenAI libraries without modification for speech generation.

What is the maximum input length?

Each request supports up to 4096 characters. If your text exceeds this limit, split it into parts and join the resulting audio files. Spaces and punctuation count toward the character limit. Failed requests do not consume this quota or incur charges.

How do I change the voice?

Include the 'voice' field in your JSON body with one of the eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. You can list available voices via GET /v1/voices. Each voice supports all 23 languages, regardless of the voice's original style.

Does the API support streaming?

No. The API returns the complete audio file in the response. There is no WebSocket endpoint or real-time partial audio streaming. You must wait for the full synthesis to complete before receiving the audio data. This applies to all request formats.

What happens if I exceed the rate limit?

The limit is 60 requests per minute per key (10 before the first top-up). Exceeding this may cause requests to queue or fail. Failed requests are free, so you are not charged for audio that does not generate. Monitor your usage on the dashboard.

How do I specify a language?

Include the 'language' field with an ISO code. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Explicitly setting the language ensures accuracy for non-English Latin-script text. Supported languages include English, Spanish, German, and 20 others.

Is SSML supported?

No. The API does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. You cannot use SSML tags to control pauses, emphasis, or pronunciation. Input is plain text only. For custom pronunciation, you must modify the input text directly before sending the request.

Can I customize pronunciation?

No. There are no phoneme dictionaries or custom pronunciation lexicons available. You cannot upload custom pronunciation rules. The engine uses standard pronunciation for the 23 supported languages. For specific pronunciation needs, you may need to adjust the input text spelling before sending it.

How do I handle errors in my code?

Check the HTTP status code and response body for error details. Failed synthesis requests are free, so no charge is applied. Ensure your 'tts-...' key is valid and included in the Authorization header. Use standard HTTP client error handling in your preferred language or SDK.

Is there a WebSocket endpoint?

No. The API is request-response based. There is no WebSocket endpoint for streaming or real-time audio delivery. You receive the full audio file once synthesis is complete. This design simplifies integration but does not support partial audio streaming or low-latency incremental delivery.

What audio formats are returned?

The API returns audio in mp3, wav, opus, flac, or pcm formats via the 'response_format' field. Unlike some services, there is no default format; you must explicitly specify your preference. Each generated file includes an inaudible watermark to identify it as synthetic speech. Select the format that best suits your application's storage and playback needs.

How do I test the API with curl?

Run this command: curl -X POST https://api.123kyatslot.com/v1/audio/speech -H "Authorization: Bearer tts-..." -H "Content-Type: application/json" -d '{"model":"tts-1","input":"Hello world","voice":"nova","response_format":"mp3"}'. Replace 'tts-...' with your key. You can find a ready curl example on the /get-api-key/ page.

First request

curl

curl https://api.123kyatslot.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.123kyatslot.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.123kyatslot.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 and API Key

Sound wave illustration for: Authentication and API Key

Create your API key via the /get-api-key/ page using Google or email. The dashboard displays your active key, balance, trial status, characters left, usage, and a ready curl example. Each account holds one active key.

Generating your API key

Sign up on the /get-api-key/ page using Google or email with a password. The interface shows your key, balance, trial status, characters left, usage, and a ready curl example. This gives you immediate visibility into your character consumption and trial status.

Bearer token format

Include your key in the HTTP header as Authorization: Bearer tts-.... This token authenticates all requests to the API endpoints.

Revoking and reissuing keys

Issue a new key at any time. The old key stops working immediately upon creation of the new one. This allows instant rotation without downtime.

Endpoint: POST /v1/audio/speech

Sound wave illustration for: Endpoint: POST /v1/audio/speech

The POST /v1/audio/speech endpoint is the core of the API. Send a JSON body with your text, and receive an audio file in return. The request shape mirrors the OpenAI speech endpoint, allowing you to use official SDKs by simply adjusting the base URL to https://api.123kyatslot.com/v1. Each request processes text up to 4096 characters, with longer texts requiring client-side splitting and audio joining.

Requests are processed sequentially, meaning under load, synthesis may queue. Failed requests incur no charge, while successful ones consume character credits based on the input length. You authenticate using a Bearer token in the Authorization header.

Request body structure

Send a standard JSON object containing the model, input text, and optional parameters. The API expects specific field names compatible with the OpenAI speech structure. Ensure your client library handles binary audio responses correctly, as the file is returned directly in the response body upon success.

Required fields: model and input

The model field accepts either "tts-1" or "tts-1-hd", both using the same engine and price point. The input field contains the raw text string, limited to 4096 characters per request. Spaces and punctuation count toward this character limit, so plan your splits accordingly for longer documents.

Optional parameters: voice and speed

Specify the voice preset (e.g., aria, nova, felix) to define the speaker. Adjust speed between 0.25 and 4.0 to alter playback rate. You may also set an optional language ISO code to force detection, or leave it blank to allow auto-detection based on the text script. Default Latin text assumes English.

  • Use voice to select from 8 available presets.
  • Set speed for rates from 0.25x to 4.0x.
  • Omit language for auto-detection or provide ISO codes.
  • Choose response_format (mp3, wav, opus, flac, pcm).
Endpoint: POST /v1/audio/speech

Supported Models and Voices

Sound wave illustration for: Supported Models and Voices

EchoScript offers two model identifiers, tts-1 and tts-1-hd, which operate on the same underlying engine with identical pricing. You can use either model for any request without worrying about variable character-based billing rates, as both are charged at $0.01 per 1,000 characters.

tts-1 vs tts-1-hd

The distinction between these models is purely structural for API compatibility; they deliver audio from the same engine. Choose whichever identifier suits your codebase, as performance and quality remain consistent across both.

Female voice presets

Select from four female voices designed for different narrative styles. Aria provides a warm, clear narrator tone, while Nova offers a bright, upbeat delivery. Luna is soft and suited for storytelling, and Sage delivers a calm, instructional voice ideal for tutorials.

  • Aria: warm, clear narrator
  • Nova: bright, upbeat
  • Luna: soft, storytelling
  • Sage: calm, instructional

Male voice presets

Four male voices cover essential commercial and broadcast needs. Felix brings energetic promotion to marketing scripts, while Milo offers a friendly, conversational tone. Atlas serves as a neutral news anchor, and Orion provides a deep, documentary-style narration.

  • Felix: energetic, promo
  • Milo: friendly, conversational
  • Atlas: neutral, news
  • Orion: deep, documentary

Audio Output Formats

Sound wave illustration for: Audio Output Formats

Choose from MP3, WAV, OPUS, FLAC, or PCM. No format is set by default, so specify response_format explicitly in your request. Each format serves different needs, from web playback to raw data processing.

MP3 compatibility

MP3 provides compressed audio suitable for web delivery. It balances file size and quality effectively for most standard TTS use cases.

WAV for lossless quality

WAV delivers uncompressed audio data. Use this format when you need exact fidelity without any compression artifacts, ideal for professional editing or archival.

FLAC and OPUS options

FLAC offers lossless compression, reducing file size without quality loss. OPUS provides efficient compression for real-time streaming or low-bandwidth scenarios. Both are valid options for specific technical requirements.

Speed and Language Parameters

Sound wave illustration for: Speed and Language Parameters

The speed parameter accepts values between 0.25 and 4.0, allowing you to adjust the playback rate of the generated audio. This is useful for adapting voiceover pacing to your specific content needs without post-processing.

Adjusting speed from 0.25 to 4.0

Set the speed field in your JSON request body to control how fast the voice speaks. Values outside this range will result in an error. Adjusting speed does not affect pitch or tone, only the duration of the output file.

Auto-detecting language from script

If you omit the language field, the API guesses the language based on the text script. Latin script text defaults to English. For accurate detection in mixed-script inputs, providing the ISO code is recommended.

Forcing language with ISO codes

To ensure correct pronunciation, explicitly set the language parameter using an ISO 639-1 code (e.g., es, de, ja). This is critical for non-English texts written in Latin script, such as German or Dutch, which might otherwise default to English.

Speed and Language Parameters

Rate Limits and Throttling

Sound wave illustration for: Rate Limits and Throttling

Your account key allows up to 60 requests per minute. This count is based on the number of API calls, not the character volume of each request. If you exceed this threshold, the API returns an error.

60 requests per minute limit

Each call to POST /v1/audio/speech counts as one request. The limit resets every minute. You can monitor your usage on the dashboard to stay within this window.

10 requests per minute initial limit

New accounts without a top-up are limited to 10 requests per minute. This lower limit applies until you add funds. Once you top up, the limit increases to the standard 60 requests per minute.

Handling queue delays under load

Requests are processed sequentially. Under heavy load, your request may wait in a queue before synthesis begins. This means generation can take longer than usual during peak times. Plan your batch jobs accordingly to avoid timeouts.

Error Handling and Responses

Sound wave illustration for: Error Handling and Responses

Synthesis failures result in a full refund of the character cost. If the service cannot generate audio from your input, you are not charged for that specific request, ensuring you only pay for successful outputs.

Standard HTTP error codes

The API uses standard HTTP status codes to indicate the result of your request. While specific codes like 400 or 500 may appear, the primary indicator of a billing event is whether the synthesis succeeded or failed.

Handling failed synthesis requests

If synthesis fails, the charge is returned in full. You do not need to manually claim refunds; the system automatically adjusts your balance when a request does not produce audio.

Returning audio files

Successful requests return the audio file directly in the response body. The file format matches your specified response_format parameter (mp3, wav, opus, flac, or pcm). No additional storage or retrieval step is required.

Error Handling and Responses

Integration with OpenAI SDK

Sound wave illustration for: Integration with OpenAI SDK

Our API mirrors the OpenAI speech endpoint structure, allowing you to leverage existing libraries with minimal configuration. By simply adjusting the base URL, you can direct requests to our infrastructure without rewriting your core logic.

Setting the base_url

Configure your client to point at https://api.123kyatslot.com/v1. This single change redirects standard OpenAI TTS requests to our endpoint while preserving the JSON body format for model, input, voice, and response_format.

Using official OpenAI libraries

Import the standard OpenAI SDK and instantiate the client with your Bearer token (tts-...). Pass your API key via the authorization header. The library handles serialization automatically, treating our endpoint as a drop-in replacement for the standard service.

Migrating existing code snippets

Replace the default base URL in your existing Python or Node.js snippets. Ensure your model is set to tts-1 or tts-1-hd. All other parameters like voice and speed map directly, requiring no additional field adjustments.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. As an indie developer, you know how hard it is to find reliable freelance help.

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. openai-node on GitHub
  3. Node.js documentation
  4. LibriVox public-domain audiobooks
  5. ISO 639 language codes
  6. Creative Commons Attribution 4.0
  7. IETF RFC 7845: Ogg Opus
  8. OpenAI API reference: create speech
  9. FFmpeg documentation
  10. MDN: Web Speech API
  11. curl documentation
  12. Python documentation

More on this site