API Documentation: Quickstart Guide for Developers

By Mobile TTS Audit editorial team · Updated 2026-11-18

This documentation provides the technical reference for integrating the Mobile TTS Audit API into your mobile application. You will find precise specifications for the speech generation endpoint, including required request parameters, supported response formats, and authentication protocols. The guide details how to use standard tools like cURL or the OpenAI SDK to convert text into audio files efficiently.

The content is designed for developers building voice features for startups who prioritize integration speed and pricing transparency. You will learn how to manage API keys, handle rate limits, and implement long-text splitting logic. All examples use concrete data from the live API at api.st88ok.com, ensuring you can move from prototype to production with verified code snippets and accurate cost estimates.

API Documentation: Quickstart Guide for Developers

Frequently asked questions

How do I get an API key?

Sign up at https://st88ok.com/get-api-key/ using Google or email. Accounts created with email start without trial credit. Google sign-ups receive $0.50 valid for 7 days. The dashboard displays your active key, balance, and usage statistics immediately after registration.

What SDKs are supported?

We do not provide an official SDK. You can use the OpenAI SDK by changing the base URL, or use plain HTTP requests. The API endpoint shape matches the OpenAI speech endpoint, allowing direct compatibility with existing OpenAI client libraries.

Can I use the OpenAI SDK?

Yes. The endpoint structure matches the OpenAI speech endpoint. Configure your SDK’s base URL to https://api.st88ok.com/v1 and use your site-specific API key. This allows you to use the standard OpenAI SDK libraries without modification for integration.

What is the base URL?

The API base URL is https://api.st88ok.com/v1. Use this prefix for all requests. The speech endpoint is POST https://api.st88ok.com/v1/audio/speech. Other endpoints include GET /v1/voices and GET /v1/models for retrieving available voices and model information.

How do I authenticate requests?

Include an Authorization header with the value Bearer followed by your API key. The format is: Authorization: Bearer tts-... . Each account has one active key. If you issue a new key, the old one stops immediately.

What are the rate limits?

Limits are 60 requests per minute per key. New accounts start with 10 requests per minute until the first top-up is processed. Requests are processed sequentially, so high load may cause queuing delays.

Can I change my API key?

Yes, you can issue a new key at any time via the dashboard. When a new key is generated, the previous key becomes invalid immediately. This allows you to revoke access instantly without waiting for expiration or manual deactivation.

What happens if I exceed the rate limit?

Requests are processed sequentially. Under heavy load, your request may wait in a queue. If the limit is exceeded, the API returns a 429 error. Failed requests are free, so you will not be charged for requests that do not complete successfully.

How do I handle errors?

Check the HTTP status code and response body for error details. If synthesis fails, the charge is returned in full. Ensure your input text is under 4096 characters and your key is valid. Use standard HTTP error handling in your client.

What formats are supported?

Supported response formats are mp3, wav, opus, flac, and pcm. Specify the desired format in the request body using the response_format field. The API returns the audio file directly in the response body in the requested format.

Can I adjust the speech speed?

Yes, set the speed parameter between 0.25 and 4.0. The default speed is 1.0. Adjusting speed affects the generation time but does not change the pricing model. Faster speeds may reduce generation time for long texts.

How do I handle long texts?

Split your text into parts of up to 4096 characters. Send each part as a separate request. Join the resulting audio files in your application logic. This ensures each request stays within the character limit and processes efficiently.

Is there a limit on input length?

Yes, each request supports up to 4096 characters. Spaces and punctuation count toward this limit. For longer texts, you must split the input into multiple requests. Each request is processed independently, and results are returned sequentially.

Do I need to install extra libraries?

No extra libraries are required if you use plain HTTP. If you prefer the OpenAI SDK, install the standard OpenAI package. No proprietary SDK or mobile-specific library is needed. The API works with any HTTP client capable of sending JSON.

First request

curl

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

Sound wave illustration for: Authentication

Authentication is handled via a single active API key issued per account. The key follows the format tts-<unique_identifier> and must be included in every request to verify your identity and track usage against your balance.

API Key format

API Key format

The key is generated on the /get-api-key/ dashboard. It begins with the prefix tts- followed by alphanumeric characters. Ensure you copy the entire string without trailing spaces.

Bearer token usage

Bearer token usage

Include the key in the HTTP header using the standard Bearer scheme: Authorization: Bearer tts-.... This applies to all endpoints, including speech synthesis and voice listings.

Key rotation

A new key can be issued at any time from your dashboard. Upon generation, the previous key becomes invalid immediately. Update your mobile app configuration to use the new key before the old one expires to prevent service interruption.

  • Issue new key via dashboard
  • Old key stops instantly
  • Update app config promptly

Endpoints Overview

Sound wave illustration for: Endpoints Overview

The API exposes three primary endpoints for generating and managing speech assets. The core synthesis endpoint accepts text payloads and returns audio files directly, while metadata endpoints provide available voices and model configurations without charge.

POST /v1/audio/speech

This endpoint accepts a JSON body containing the text input, selected voice, model type, and output format. It returns the generated audio file directly in the response, supporting formats like MP3, WAV, Opus, FLAC, and PCM. Requests are limited to 4096 characters of input text.

  • Accepts JSON body with input, voice, model, and response_format
  • Returns binary audio data or JSON error object
  • Supports MP3, WAV, Opus, FLAC, and PCM outputs

GET /v1/voices

Retrieve the list of eight available voice presets and their associated metadata, including supported languages and formats. This endpoint allows developers to verify voice availability and pricing details before initiating synthesis requests, ensuring correct integration for mobile app voice features.

  • Lists 8 voice presets (e.g., aria, nova, felix)
  • Details supported languages and output formats
  • Returns current pricing per character (flat rate for all voices)

GET /v1/models

Fetch the available model identifiers, specifically tts-1 and tts-1-hd. Both models use the same engine and pricing tier, allowing developers to standardize their client implementation while retaining the option to specify a preferred model identifier for future compatibility.

  • Returns tts-1 and tts-1-hd model IDs
  • Both models share identical engine and pricing
  • No additional configuration required for model selection

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts text input up to 4096 characters per request, including spaces and punctuation. For longer content, clients must split the text into chunks, generate audio for each part, and join the resulting files sequentially.

Model selection determines synthesis quality and cost. Both tts-1 and tts-1-hd use the same engine and pricing tier, allowing teams to switch formats without changing infrastructure or incurring price differences.

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

Select either tts-1 or tts-1-hd in the request body. Both models use the same engine and are billed at the same rate of $0.01 per 1,000 characters. This uniformity simplifies cost estimation for mobile applications regardless of the chosen model.

Input text limits

The input field accepts a maximum of 4096 characters. Requests exceeding this limit will fail. To handle longer narratives, split the text into smaller segments, process each segment individually, and concatenate the audio outputs in the correct order.

  • Maximum length: 4096 characters per request.
  • Spaces and punctuation count toward the limit.
  • Split logic should preserve natural pauses between segments.

Voice and language selection

Choose from eight distinct voice presets, such as aria for narration or atlas for news. The language parameter is optional; if omitted, the system guesses the language based on the script, defaulting to English for Latin characters. Explicitly set the ISO code for non-English Latin text to ensure accurate synthesis.

  • Voice: 8 presets available (e.g., aria, nova, felix).
  • Language: Optional ISO code; defaults to English if unspecified.
  • Supports 23 languages including Arabic, Chinese, and Spanish.

Response Formats

Sound wave illustration for: Response Formats

The API returns audio in the format specified by the response_format parameter. Supported outputs include MP3, WAV, OPUS, and FLAC, allowing teams to balance file size and quality based on their mobile app requirements.

MP3 output

MP3 is the default format, providing a balance between file size and compatibility. It is suitable for most mobile applications where bandwidth efficiency is a priority without sacrificing acceptable audio clarity.

  • Default output format
  • High compatibility across mobile platforms

WAV output

WAV provides uncompressed audio, ensuring maximum fidelity for applications requiring pristine sound quality. This format is larger but avoids any compression artifacts, making it ideal for high-end voice features.

  • Uncompressed audio quality
  • Larger file size

Opus and FLAC options

OPUS offers efficient compression for storage-constrained environments, while FLAC provides lossless compression for archival quality. These options allow developers to choose between advanced codec efficiency and perfect audio reproduction.

  • OPUS: efficient compression
  • FLAC: lossless quality

Rate Limits

Sound wave illustration for: Rate Limits

The API enforces a standard rate limit of 60 requests per minute per active key. This threshold applies uniformly regardless of the model selected, ensuring predictable throughput for mobile app workflows. Developers should monitor their usage to avoid temporary throttling during peak generation periods.

60 requests per minute

Each API key is capped at 60 requests per minute. This limit is strict and applies to all successful and failed requests. Exceeding this threshold results in a 429 Too Many Requests response until the window resets.

10 requests before top-up

New accounts without a funded balance are restricted to 10 requests per minute. This lower limit ensures stability for trial users while they evaluate voice quality and integration speed before committing to a top-up.

Queue behavior under load

Requests are processed sequentially. Under heavy load, additional requests may wait in a queue before synthesis begins. This can increase latency for short phrases, as the system prioritizes processing order over parallel execution.

  • No parallel processing for a single key
  • Latency increases during high-demand periods
  • Queue position is not guaranteed
Rate Limits

Error Handling

Sound wave illustration for: Error Handling

The API returns standard HTTP status codes to indicate request outcomes. A 200 OK response confirms successful synthesis, while 400-level errors indicate invalid parameters such as an unsupported voice or excessive input length. A 429 Too Many Requests error occurs when you exceed the 60 requests per minute limit. Notably, failed requests do not count against your character balance, ensuring you are not charged for unusable audio.

When a synthesis job fails due to temporary backend issues, the response includes an error code and message. You should log these errors for debugging but do not retry immediately without checking the rate limit status. Understanding these codes helps mobile teams maintain stable voice features during high-traffic periods.

Common error codes

Use the HTTP status code to determine the next step. 400 errors require parameter correction. 401 errors indicate an invalid or expired API key. 429 errors mean you must wait before sending more requests.

Failed requests do not count against limits, preserving your balance for successful generations.

  • 400: Bad Request - Invalid input or voice parameter.
  • 401: Unauthorized - Invalid API key.
  • 429: Too Many Requests - Rate limit exceeded.

Handling timeouts

The API processes requests sequentially. Under load, a request may wait in a queue before generation begins. If the client timeout is too short, you may receive a timeout error even if the server is processing the request. Set your HTTP client timeout to at least 30 seconds to accommodate queue delays.

Long texts take longer to synthesize than short phrases. Ensure your mobile app handles extended wait times gracefully without freezing the UI.

  • Set HTTP timeout to 30 seconds or higher.
  • Account for queue delays during peak usage.
  • Short phrases may take a few seconds; long texts take longer.

Retry logic

Implement exponential backoff for retrying failed requests. Start with a short delay and increase it for each subsequent attempt. This prevents overwhelming the API when it is under high load. Do not retry 400 errors, as they indicate a client-side mistake that will persist.

For 429 errors, wait until the rate limit window resets before retrying. For 500-level errors, retry once after a short delay. If the error persists, notify the user that the voice feature is temporarily unavailable.

  • Use exponential backoff for transient errors.
  • Do not retry 400 errors.
  • Retry 500-level errors once after a short delay.

Code Examples

Sound wave illustration for: Code Examples

Use cURL for immediate verification of the TTS endpoint. Pass the Bearer token in the Authorization header and provide the JSON body with the model and voice parameters.

The OpenAI SDK requires only a base_url adjustment. This allows teams to swap providers without rewriting integration logic, ensuring faster deployment for mobile voice features.

cURL command

Execute a direct POST request to generate audio. Replace YOUR_API_KEY with your active token and adjust the voice parameter as needed.

OpenAI SDK example

Initialize the client with the custom base URL. This leverages existing OpenAI SDK structures for seamless integration into your mobile backend.

Python snippet

Import the library and set the base URL to https://api.st88ok.com/v1. The code remains identical to standard OpenAI implementations.

Advanced Usage

Sound wave illustration for: Advanced Usage

The API allows precise control over speech pacing via the speed parameter, accepting values from 0.25 to 4.0. This enables developers to optimize audio length for mobile app constraints without post-processing.

For texts exceeding 4096 characters, the client must split the input into segments. Each segment generates a separate audio file, requiring manual concatenation to restore continuity.

Speed adjustment (0.25–4.0)

Adjust the speed parameter to modify playback rate. Values below 1.0 slow the narration, while values above 1.0 accelerate it. This feature is useful for fitting audio into strict UI timelines or improving comprehension for specific user groups.

  • Minimum speed: 0.25
  • Maximum speed: 4.0
  • Default speed: 1.0

Long text splitting

Since each request supports up to 4096 characters, larger inputs must be divided by the client. Split logic should respect word boundaries to avoid truncating mid-word. Each chunk triggers an independent synthesis request.

Audio joining logic

The API returns individual audio files per request. Developers must concatenate these files in the correct sequence to reconstruct the full audio. Note that generation is roughly real time on long texts; longer texts may experience queue delays, so pre-generation is recommended for static content.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Mobile applications transform startup visions into tangible user experiences through intuitive design and seamless functionality.

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. Creative Commons Attribution 4.0
  3. IETF RFC 7845: Ogg Opus
  4. Node.js documentation
  5. LibriTTS-R paper (arXiv 2305.18802)
  6. ISO 639 language codes
  7. MDN: Web Speech API
  8. LibriVox public-domain audiobooks
  9. Tether (USDT)
  10. TRON developer hub: TRC-20
  11. FFmpeg documentation
  12. curl documentation

More on this site