API Documentation for Developers: Quickstart Guide

By ShortForm Audio editorial team · Updated 2026-11-19

This guide provides the technical specifications for the ShortForm Audio TTS API, designed for developers integrating automated voiceovers into TikTok, Reels, and Shorts workflows. You will find exact endpoint definitions, parameter constraints, and integration patterns for generating speech files programmatically.

Readers will learn how to authenticate using Bearer tokens, select from eight voice presets, and manage rate limits of 60 requests per minute. The documentation includes ready-to-use cURL examples and cURL commands, ensuring you can implement reliable audio generation for high-volume content creation with predictable latency and billing logic.

API Documentation for Developers: Quickstart Guide

Frequently asked questions

What is the base URL?

The API base URL is https://api.k98m.info/v1. All requests, including speech synthesis and voice listing, are directed to this endpoint. You must use this specific domain for authentication and data retrieval to ensure your requests are processed correctly by the ShortForm Audio infrastructure.

Can I use the OpenAI SDK?

Yes. The endpoint shape matches the OpenAI speech endpoint. You can use the official OpenAI SDKs by changing the base_url to https://api.k98m.info/v1 and providing your ShortForm API key. This allows you to leverage familiar code structures for your integrations without learning a new library.

What is the max character limit?

Each request supports up to 4096 characters. If your text exceeds this limit, you must split it into parts of 4096 characters or fewer. Generate audio for each part separately and then join the resulting audio files to create a complete output file.

Does the API support streaming?

No. The API does not support streaming, WebSockets, or real-time partial audio. You send a POST request and receive the complete audio file in the response. For long texts, you must handle splitting and joining audio files manually in your workflow.

How do I handle rate limits?

You are limited to 60 requests per minute per key. Before your first top-up, the limit is 10 requests per minute. Requests are processed sequentially, so under load, a request may wait in a queue. Ensure your application handles retries or delays appropriately.

What audio formats are available?

You can request audio in mp3, wav, opus, flac, or pcm formats. Specify the desired format using the response_format field in your JSON body. This allows you to choose the best balance between file size and quality for your specific content distribution needs.

Is SSML supported?

No. The API does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. You control pacing and emphasis primarily through the speed parameter (0.25–4.0) and by selecting from the eight available voice presets. Complex audio structuring must be handled by splitting text manually.

How do I rotate my API key?

You can issue a new API key at any time from your account dashboard. When you generate a new key, the old one stops working immediately. This ensures that if a key is compromised, you can revoke access instantly without waiting for a renewal cycle.

What happens if the server is down?

There is no official SLA or uptime guarantee. If synthesis fails, the charge is returned in full. You should implement retry logic in your application to handle temporary failures. Requests are processed one after another, so high load may also cause delays in processing.

Can I use custom voices?

No. The API offers eight preset voices: aria, nova, luna, sage, felix, milo, atlas, and orion. There is no custom voice cloning, no uploading your own voice, and no voice design features. You must select from the available licensed recordings: LibriTTS-R (CC BY 4.0) and LibriVox public-domain audiobook readings.

How do I specify a language?

Include the language field with an ISO code in your request body. If omitted, the system guesses the language from the script, defaulting to English for Latin text. For non-English Latin-script text, explicitly setting the language ensures accurate synthesis and avoids misinterpretation by the model.

Is there a WebSocket option?

No. The API uses standard HTTP POST requests. There is no WebSocket option for real-time data transfer. You send your text payload and receive the generated audio file as a response. This synchronous model is suitable for batch processing and automated content workflows.

Do I need a library?

No. You can use the official OpenAI SDK by adjusting the base URL, or you can use plain HTTP requests. No proprietary library is required. This flexibility allows you to integrate the API into any programming environment that supports standard HTTP POST requests with JSON bodies.

How are errors returned?

Errors are returned as standard HTTP responses. If synthesis fails, the request is free, and any charge is returned in full. You should check the HTTP status code and response body to determine the cause of the error, such as rate limits or invalid parameters.

First request

curl

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

Your API key authenticates all requests to the ShortForm Audio endpoint. It is a simple alphanumeric string starting with tts-. Use this key in the Authorization header of every HTTP request to verify your account and track usage against your balance.

The key format is strict; do not add extra spaces or prefixes like Bearer in the value itself, as the header keyword handles that. Keep your key secure in your environment variables to prevent unauthorized usage charges.

API Key Format

API Key Format

API keys follow the pattern tts- followed by random alphanumeric characters. They are unique to your account and must be passed in the Authorization: Bearer <key> header.

Ensure no trailing whitespace is included when copying the key from your dashboard, as this can cause 401 Unauthorized errors.

  • Starts with 'tts-'
  • Alphanumeric characters only
  • No spaces or prefixes in value

Bearer Token Usage

Bearer Token Usage

Include Authorization: Bearer YOUR_API_KEY in every request header. This standard HTTP method ensures your identity is verified before processing speech synthesis.

The header is case-insensitive, but the value is case-sensitive. Incorrect capitalization in the key will result in authentication failure.

Key Rotation

You can issue a new API key at any time via the dashboard. When a new key is generated, the old one becomes invalid immediately.

This allows instant revocation if a key is compromised. Old keys stop working at once, so update your automation scripts promptly.

Endpoints

Sound wave illustration for: Endpoints

The API exposes three core endpoints for generating audio, retrieving available voices, and listing supported models. All requests are sent to https://api.k98m.info/v1, requiring a valid Bearer token for authentication.

Speech Generation

POST /v1/audio/speech accepts JSON with model, input, voice, and optional parameters like speed or language. It returns an audio file directly in the response body, ready for immediate playback or storage.

  • Endpoint: POST /v1/audio/speech

Voices List

GET /v1/voices returns a JSON array of all available voice presets, their associated languages, and supported audio formats. This allows developers to dynamically populate UI selectors for TikTok or Reels creators.

  • Endpoint: GET /v1/voices

Models List

GET /v1/models lists the available TTS models (tts-1 and tts-1-hd). Both use the same engine and pricing, allowing simple fallback logic if one model is temporarily unavailable.

  • Endpoint: GET /v1/models

Request Parameters

Sound wave illustration for: Request Parameters

The model parameter accepts "tts-1" or "tts-1-hd", using the same engine and pricing tier. Your input text must not exceed 4096 characters per request, with spaces and punctuation counting toward this limit. For longer scripts, split the text into chunks and join the resulting audio files.

Model Selection

Both "tts-1" and "tts-1-hd" utilize the identical synthesis engine with no price difference. Choose based on your preference for audio quality versus file size, though the underlying generation speed remains consistent for both.

Input Text Limits

The API enforces a strict 4096-character ceiling per request. If your voiceover exceeds this, split the text into smaller parts and concatenate the returned audio files. Generation speed averages roughly 25 characters per second for long texts, but short phrases may take a few seconds.

Voice Selection

Select from 8 presets: aria, nova, luna, sage (female) or felix, milo, atlas, orion (male). If the language field is omitted, the system guesses from the script, defaulting to English for Latin text. Explicitly set the ISO language code for non-English Latin-script content to ensure accuracy.

  • 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 synthesized audio directly in the response body, allowing immediate playback or storage. You choose the output format via the response_format parameter to match your workflow needs.

MP3 Output

MP3 is the default format, offering a good balance between file size and compatibility. It is ideal for web playback and most social media platforms like TikTok or Reels.

WAV Output

WAV provides uncompressed, high-quality audio suitable for professional editing or voiceover pipelines. It preserves the full fidelity of the generated speech without lossy compression artifacts.

Other Formats

You can also request Opus, FLAC, or PCM formats. Opus offers efficient compression, FLAC provides lossless storage, and PCM delivers raw uncompressed data.

Rate Limits

Sound wave illustration for: Rate Limits

The API enforces strict rate limits to ensure stable generation during high-volume content workflows. By default, each API key is limited to 60 requests per minute. This cap applies uniformly regardless of the model selected, ensuring consistent throughput for automated TikTok or Reels production pipelines.

Requests Per Minute

The standard limit is 60 requests per minute per key. This allows developers to batch-process scripts efficiently without overwhelming the synthesis engine. If you exceed this threshold, subsequent requests will receive a 429 Too Many Requests error until the window resets.

  • Limit: 60 requests/minute per key
  • Applies to all models (tts-1, tts-1-hd)
  • Reset occurs on a sliding window basis

Pre-Topup Limits

New accounts without a funded balance are restricted to a lower tier. You may make only 10 requests per minute before making your first top-up. This ensures fair usage while you verify your integration setup before committing USDT.

  • Unfunded keys: 10 requests/minute
  • Fund via USDT (TRC-20) to unlock 60 req/min
  • Limit lifts automatically within minutes of confirmation

Queue Behavior

Requests are processed sequentially within the limit window. Under heavy load, a request may wait in a queue before synthesis begins. Typical generation speed is roughly real-time (25 characters per second), so longer scripts naturally take more time. Plan your automation scripts to account for this sequential processing.

  • Sequential processing under load
  • Queues may form during peak demand
  • No SLA or uptime guarantee
Rate Limits

Error Handling

Sound wave illustration for: Error Handling

Errors during synthesis are tracked for billing accuracy, but failed requests never incur charges. If the API cannot generate audio from your input, the character count is restored to your balance immediately, ensuring you only pay for successfully delivered files.

Common Errors

Most failures stem from exceeding the 4096-character limit per request or using an invalid voice ID. Ensure your text is split correctly and the model name matches 'tts-1' or 'tts-1-hd'.

  • Invalid API key
  • Input text too long
  • Voice ID not found
  • Rate limit exceeded

Refund Logic

Failed requests are free. If synthesis fails, the charge is returned in full. Your balance reflects this automatically without manual intervention.

Status Codes

Standard HTTP codes apply. Use 400 for bad requests, 401 for auth errors, 429 for rate limits, and 500 for server issues. Check the response body for specific error details.

  • 400 Bad Request
  • 401 Unauthorized
  • 429 Too Many Requests
  • 500 Internal Server Error

SDK Integration

Sound wave illustration for: SDK Integration

The API mimics the OpenAI speech endpoint structure, allowing you to reuse existing client code with minimal adjustments. By updating the base URL, you can leverage the official OpenAI SDKs without needing a custom wrapper or proprietary client library.

This approach simplifies integration for developers already familiar with OpenAI’s ecosystem, ensuring consistent request shapes for audio generation.

OpenAI SDK Setup

Install the standard openai Python package. No special dependencies are required beyond the core library and your API key. The client handles JSON serialization and retry logic automatically.

The SDK’s default behavior aligns with our endpoint structure, making it a reliable choice for automating voiceover generation in production workflows.

Base URL Change

Configure the base_url parameter to point to https://api.k98m.info/v1. This directs all requests to our infrastructure while maintaining compatibility with OpenAI’s request schema.

Ensure your API key is passed via the Authorization: Bearer header, formatted as tts-....

Python Example

Use the openai.OpenAI class to initialize the client with the correct base URL and API key.

Call client.audio.speech.create() with your model, voice, and input text to receive the audio file directly in your application.

This method works seamlessly for both short phrases and longer texts when combined with character splitting logic.

cURL Examples

Sound wave illustration for: cURL Examples

cURL commands provide a direct way to test the API without installing SDKs. Use these examples to verify your key, test voice output, and adjust audio parameters for your TikTok or Reels content.

Each request sends JSON to the speech endpoint. The response returns the audio file directly, allowing you to pipe it into your video editing pipeline or save it for later use.

Basic Request

Send text to generate audio using the standard model. Replace YOUR_API_KEY with your actual credential.

This command returns an MP3 file by default. Save the output to a local file for immediate use in short-form video projects.

  • ["POST https://api.k98m.info/v1/audio/speech", "--header \"Authorization: Bearer YOUR_API_KEY\"", "--data '{\"model\": \"tts-1\", \"input\": \"Hello world\", \"voice\": \"nova\"}'"]

Speed Adjustment

Adjust the speaking rate between 0.25 and 4.0. Faster speeds help fit longer voiceovers into short video formats without rushing delivery.

Use this to match the fast-paced editing style common in Shorts and Reels content.

  • ["--data '{\"model\": \"tts-1\", \"input\": \"Fast content\", \"voice\": \"nova\", \"speed\": 1.5}'"]

Language Spec

Explicitly set the language code to avoid incorrect auto-detection. This is crucial for non-English Latin script text.

Ensures consistent pronunciation across different voices and prevents the engine from defaulting to English.

  • ["--data '{\"model\": \"tts-1\", \"input\": \"Bonjour\", \"voice\": \"aria\", \"language\": \"fr\"}'"]

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. This means you can swap voices between videos without any change in your billing rate, simplifying cost forecasting for high-volume TikTok and Shorts creators.

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. LibriTTS-R paper (arXiv 2305.18802)
  3. Node.js documentation
  4. Tether (USDT)
  5. Creative Commons Attribution 4.0
  6. openai-node on GitHub
  7. MDN: Web Speech API
  8. LibriTTS-R corpus (OpenSLR 141)
  9. openai-python on GitHub
  10. curl documentation
  11. ISO 639 language codes
  12. OpenAI API reference: create speech

More on this site