Text-to-Speech API Quickstart Guide for Developers

By Luminaudio editorial team · Updated 2026-11-19

This guide provides the technical specifications required to integrate the Luminaudio text-to-speech API into your podcast production workflow. It details the request structure, authentication methods, and response formats necessary for converting script text into broadcast-ready audio files. The documentation assumes a developer audience familiar with standard HTTP protocols and JSON data exchange.

You will find specific instructions for configuring the OpenAI SDK, managing rate limits, and handling errors during high-volume generation. The content covers parameter selection for voice presets, language detection, and output formats. This reference enables podcast freelancers to automate audio synthesis reliably without external dependencies or proprietary client libraries, as the API is compatible with the official OpenAI SDKs.

Text-to-Speech API Quickstart Guide for Developers

Frequently asked questions

How do I generate an API key?

Navigate to https://k688.info/get-api-key/ and sign up using Google or an email address. The dashboard displays your active API key, which you use for authentication. You can issue a new key at any time, and the previous one stops immediately.

What is the base URL for requests?

The API base URL is https://api.k688.info/v1. You send POST requests to https://api.k688.info/v1/audio/speech. Other endpoints include GET /v1/voices and GET /v1/models for retrieving available voices and model details.

Can I use Python SDKs?

Yes, the official OpenAI Python SDK works by changing the base_url to https://api.k688.info/v1. We do not provide our own official SDK, so you must use the OpenAI SDK or plain HTTP requests for integration.

How do I specify the language?

Include the optional 'language' field with an ISO code in your request. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Set this explicitly for non-English Latin-script text to ensure accuracy.

What happens if the text is too long?

Split your input into parts of up to 4096 characters per request. Generate audio for each part individually, then join the resulting audio files. This ensures compliance with the character limit while maintaining audio continuity for your content.

Is the API synchronous or async?

The API is synchronous. You send a POST request and receive the audio file in the response. Requests are processed sequentially, so under load, your request may wait in a queue before synthesis begins and completes.

How do I handle rate limit errors?

You are limited to 60 requests per minute per key (10 before the first top-up). If you exceed this, implement exponential backoff in your client code. Monitor your usage via the dashboard to stay within the allowed limits.

Can I change my API key?

Yes, you can issue a new key at any time via the dashboard. When you generate a new key, the old one stops working immediately. Ensure your application updates to use the new key to avoid authentication errors.

What models are available?

Two models are available: 'tts-1' and 'tts-1-hd'. Both use the same engine and pricing. You can select either model in your request body without any difference in cost or voice quality, only in model identifier.

Do I need to install extra libraries?

No extra libraries are required beyond standard HTTP clients. If using the OpenAI SDK, install the official package. For direct HTTP requests, any standard library works. We do not provide a proprietary SDK, so use standard tools.

Is the response binary or JSON?

The response contains the audio file directly in the body. The format matches the 'response_format' parameter: mp3, wav, opus, flac, or pcm. Headers indicate content type, but the body is the raw binary audio data, not JSON.

How do I test the endpoint?

Use the ready curl example provided on the /get-api-key/ dashboard page. Send a POST request with your API key in the Authorization header. The free trial includes $0.50 credit, allowing you to verify functionality without immediate payment.

What is the default voice?

You must provide a 'voice' parameter from the eight presets. Ensure you explicitly set the voice in your request.

Can I stream the audio?

No, streaming is not supported. The API returns the complete audio file after synthesis is finished. There is no WebSocket or real-time partial audio delivery. You must wait for the full response before processing the audio file.

First request

curl

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

Authentication for the Luminaudio TTS API relies on a single Bearer token passed in the Authorization header. This key, generated upon account creation, authorizes all requests to the speech endpoint. Developers must include the header as Authorization: Bearer tts-<your_key> in every API call to ensure proper identification and billing attribution.

Bearer token in Authorization header

Bearer token in Authorization header

Include the token in the Authorization header of every request. The format is strictly Bearer tts-.... Omitting this header results in a 401 Unauthorized error, preventing audio synthesis.

One active key per account

One active key per account

Each account maintains exactly one active API key. This simplifies credential management for freelance podcast workflows, ensuring that all usage is tracked against a single identifier without needing to rotate keys manually for different services or environments.

Revoke old keys instantly

Issuing a new key immediately invalidates the previous one. This provides instant security control; if a key is compromised, generating a new one stops all usage from the old credential immediately without delay.

  • New key generation invalidates the old key instantly.
  • Old key stops working at once.
  • No waiting period for revocation.

Endpoint Overview

Sound wave illustration for: Endpoint Overview

The API provides three primary endpoints for integrating text-to-speech into your podcast production workflow. The core synthesis endpoint processes text into audio, while the metadata endpoints allow you to retrieve available voice options and model details programmatically.

POST /v1/audio/speech

This endpoint accepts a JSON body containing the input text, voice preset, and desired output format. It returns the generated audio file directly in the response, enabling immediate playback or storage in your audio pipeline.

  • Accepts text up to 4096 characters per request
  • Supports MP3, WAV, Opus, FLAC, and PCM formats
  • Returns audio data in the response body

GET /v1/voices

Retrieve a list of all available voice presets, their associated languages, and supported formats. This endpoint helps you dynamically select the appropriate voice for your script without hardcoding voice IDs.

  • Lists 8 distinct voice presets
  • Indicates supported languages and formats per voice
  • Useful for building dynamic voice selection UIs

GET /v1/models

Returns details about the available speech synthesis models, including pricing tiers and technical specifications. Use this to verify model availability before initiating synthesis requests.

  • Lists tts-1 and tts-1-hd models
  • Provides model-specific metadata
  • Confirms available pricing structures

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts two model identifiers: "tts-1" and "tts-1-hd". Both utilize the same underlying engine and incur identical pricing, allowing you to switch versions without altering your billing structure or integration logic.

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

Selecting either model sends the request to the same synthesis backend. The choice is purely for clarity in your code or logging, as performance and audio quality remain consistent across both identifiers.

Input text (max 4096 chars)

The input field accepts a string of up to 4,096 characters. Spaces, punctuation, and special symbols count toward this limit. For scripts exceeding this length, split the text into multiple requests and concatenate the resulting audio files.

  • Maximum length: 4,096 characters per request
  • Spaces and punctuation are counted
  • Split longer texts into sequential requests

Voice preset selection

Choose from eight presets tailored for broadcast quality. Female voices include aria (warm, clear narrator), nova (bright, upbeat), luna (soft, storytelling), and sage (calm, instructional). Male options include felix (energetic, promo), milo (friendly, conversational), atlas (neutral, news), and orion (deep, documentary).

  • Aria: Warm, clear narrator
  • Nova: Bright, upbeat
  • Luna: Soft, storytelling
  • Sage: Calm, instructional
  • Felix: Energetic, promo
  • Milo: Friendly, conversational

Response Formats

Sound wave illustration for: Response Formats

The API returns audio data as binary content in the response body, allowing direct integration into your podcast production pipeline. The response_format parameter determines the encoding of the generated file, ensuring compatibility with your existing editing software and distribution platforms.

MP3 output format

MP3 is one of the supported formats, optimized for broad compatibility and efficient storage. It is suitable for most podcast delivery standards, balancing file size with acceptable audio quality for standard broadcast use.

WAV output format

WAV provides uncompressed, lossless audio data. This format is ideal for post-production workflows where maximum fidelity is required before final compression, ensuring no quality loss during editing.

FLAC and Opus support

FLAC offers lossless compression for smaller file sizes without sacrificing quality. Opus provides high-quality audio at lower bitrates, suitable for efficient streaming or archival where bandwidth is a constraint.

Rate Limits

Sound wave illustration for: Rate Limits

API consumption is governed by strict rate limits to ensure stable generation queues for podcast workflows. The standard limit allows 60 requests per minute per active API key, providing sufficient throughput for routine voiceover production.

60 requests per minute

Each API key supports up to 60 requests per minute. This capacity accommodates batch processing of multiple script segments or parallel requests from different applications without immediate throttling.

  • Limit applies per API key, not per IP address.
  • Counting resets every 60 seconds.

10 requests before first top-up

New accounts begin with a restricted quota of 10 requests per minute. This limit applies until the first USDT (TRC-20) top-up is credited to the account balance.

  • Free trial accounts ($0.50) start with the standard 10 requests per minute limit before the first top-up.
  • Top-up credits are processed automatically within minutes.

Queue behavior under load

Requests are processed sequentially within each minute window. Under heavy load, additional requests may wait in a queue before synthesis begins. Expect slight delays for longer texts during peak usage periods.

  • No priority queue; requests are handled in order of receipt.
  • Failed requests are free and do not consume quota.
Rate Limits

Error Handling

Sound wave illustration for: Error Handling

Errors indicate request status. The API returns standard HTTP codes to signal success or failure. Failed synthesis returns a full refund. Check your key and request body if errors persist.

HTTP status codes

Use 200 for success. Use 400 for bad requests. Use 401 for invalid keys. Use 429 for rate limits. Use 500 for server errors.

  • 200: Success
  • 400: Bad Request
  • 401: Unauthorized
  • 429: Rate Limit

JSON error responses

Errors return a JSON object. The object contains an error code and message. Parse this response to identify the specific issue.

Retry logic for failures

Implement exponential backoff for 5xx errors. Retry immediately for 429 rate limits. Failed requests incur no charge. Retry failed requests to ensure audio generation.

SDK Integration

Sound wave illustration for: SDK Integration

The API accepts standard JSON bodies compatible with the OpenAI SDK, allowing developers to leverage existing client libraries. This compatibility simplifies integration by eliminating the need for custom HTTP wrappers or proprietary client implementations.

Use OpenAI SDK with base_url

Import the official OpenAI SDK and instantiate the client with your API key. Configure the client to point to the Luminaudio base URL instead of the default OpenAI endpoint.

Custom base_url configuration

Set the base_url parameter to https://api.k688.info/v1. This directs all requests to the correct infrastructure while maintaining standard request shapes.

Standard request shapes

Pass parameters such as model, input, voice, and response_format exactly as defined in the OpenAI specification. The SDK handles serialization and authentication headers automatically when configured with the correct base_url.

Curl Example

Sound wave illustration for: Curl Example

The API accepts standard JSON payloads via POST requests. You must include your Bearer token in the Authorization header to authenticate each request. The endpoint returns binary audio data or an error JSON object depending on the response status code.

Basic text to speech command

Send a simple request with the tts-1 model to generate audio. The system requires the input text and a valid voice preset. Ensure the text does not exceed 4096 characters to avoid truncation.

Setting voice and language

Specify the voice ID (e.g., aria, felix) and the ISO language code. While the system guesses language from script, explicitly setting the language parameter ensures accurate pronunciation for non-English Latin text.

Saving output to file

Use the -o flag to write the response directly to a file. This avoids piping issues and preserves the binary integrity of WAV or MP3 outputs for immediate use in podcast workflows.

  • Response format must be set to mp3, wav, opus, flac, or pcm
  • Speed parameter ranges from 0.25 to 4.0
  • Audio files contain an inaudible synthetic watermark

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Her tone remains consistent and engaging, making her ideal for long-form content where listener retention is critical.

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. Tether (USDT)
  4. curl documentation
  5. Python documentation
  6. Creative Commons Attribution 4.0
  7. OpenAI API reference: create speech
  8. TRON developer hub: TRC-20
  9. Node.js documentation
  10. IETF RFC 7845: Ogg Opus
  11. FFmpeg documentation
  12. LibriTTS-R corpus (OpenSLR 141)

More on this site