API Documentation for Text-to-Speech Integration

By AuraSpeak editorial team · Updated 2026-11-18

This guide helps fitness and meditation teams integrate AuraSpeak’s text-to-speech API quickly. You will learn to generate calming or energizing audio files from your scripts using standard HTTP requests. The documentation covers authentication, endpoints, and parameter details so you can start building your application without unnecessary complexity.

We focus on practical integration steps for product teams. You will find clear examples for handling long texts, managing rate limits, and choosing the right audio format. Whether you are building a meditation app or a fitness tracker, this page provides the specific technical details you need to turn text into high-quality audio seamlessly.

API Documentation for Text-to-Speech Integration

Frequently asked questions

What is the API endpoint URL?

The endpoint is POST https://api.good888ok.com/v1/audio/speech. This URL accepts JSON bodies containing your text and voice parameters. You can also use the official OpenAI SDKs by setting the base_url to https://api.good888ok.com/v1, ensuring seamless integration with your existing fitness or meditation app workflows.

How do I authenticate my requests?

Include an Authorization header with the value Bearer followed by your unique API key. Each account holds one active key at a time. If you generate a new key, the previous one stops working immediately. You can find your key on the /get-api-key/ page after signing in.

Which models are available?

Two models are available: tts-1 and tts-1-hd. Both use the same underlying engine and incur identical pricing. You can choose either model based on your preference, as the audio quality and generation characteristics remain consistent regardless of which model you select for your synthesis requests.

What is the character limit per request?

Each request supports up to 4096 characters in the input field. Spaces and punctuation count toward this limit. For texts longer than this, you must split the content into smaller parts, generate audio for each, and then join the resulting audio files together in your application.

Can I change the audio speed?

Yes, you can adjust the speed using the speed parameter in your request body. This allows you to tailor the narration pace for your meditation or fitness scripts. The value must be a number between 0.25 and 4.0, giving you precise control over the audio duration.

What speed range is supported?

The supported speed range is 0.25 to 4.0. Values outside this range will result in an error. This range allows for significant slowing down for calming meditation guides or speeding up for quick fitness cues, ensuring the audio fits your specific content pacing requirements.

How do I specify the language?

Include the language parameter with an ISO code in your request body. If omitted, the system guesses the language from the text script, defaulting to English for Latin characters. For non-English Latin text, explicitly setting the language parameter ensures accurate pronunciation and correct voice selection.

Is the language parameter required?

No, the language parameter is optional. If you do not provide it, the system attempts to guess the language from the text script. However, for non-English text using Latin script, we recommend setting the language explicitly to avoid defaulting to English and ensuring correct audio generation.

What happens if I exceed rate limits?

You are limited to 60 requests per minute per key. If you exceed this, requests may queue or fail. Before your first top-up, the limit is 10 requests per minute. Failed requests do not consume your character balance.

Are retries automatic with OpenAI SDK?

The official OpenAI SDKs work by changing the base_url, but automatic retry behavior depends on your SDK configuration. The API itself does not guarantee immediate processing due to queuing under load. You should implement retry logic in your code to handle temporary rate limit or queue delays.

How do I handle large texts?

Split your text into chunks of up to 4096 characters. Generate audio for each chunk individually using the API. Then, join the resulting audio files together in your application. This approach ensures you stay within the per-request character limit while producing a complete audio file for your users.

What is the typical generation speed?

Generation takes roughly real time, averaging about 25 characters of text per second of audio for long texts. Short phrases may take a few seconds. Requests are processed sequentially, so under heavy load, your request may wait in a queue before synthesis begins, affecting total latency.

Do I need to install extra libraries?

No extra libraries are strictly required if you use plain HTTP. However, you can use the official OpenAI SDKs by updating the base_url to https://api.good888ok.com/v1. This allows you to leverage familiar SDK methods without installing a custom, proprietary library specific to our platform.

Is the API format compatible with other TTS services?

The request shape matches the OpenAI speech endpoint exactly. This means you can use the same JSON structure for model, input, voice, and response_format. Other TTS services may use different field names or structures, so you will need to adjust your code if switching between providers.

First request

curl

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

To authenticate your API requests, include your unique key in the Authorization header using the Bearer scheme. This ensures secure access to your account's generation capabilities.

Use Bearer token in Authorization header

Use Bearer token in Authorization header

Include Authorization: Bearer tts-... in every request. The key identifies your account and tracks usage against your rate limits and balance.

One active key per account

One active key per account

Each account maintains a single active API key. This simplifies management for product teams building fitness and meditation apps, ensuring consistent billing and usage tracking across your infrastructure.

Issue new key to revoke old one instantly

If you suspect a leak or need to rotate credentials, issuing a new key immediately invalidates the previous one. The old key stops working at once, securing your API access without downtime.

Endpoint: /v1/audio/speech

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

To generate audio, send a POST request to https://api.good888ok.com/v1/audio/speech. The API accepts your text and returns an audio file directly in the response body, making it easy to play or store.

POST method for speech generation

Send your text payload to this endpoint. The server processes the request and returns the synthesized audio file. You can save the binary data.

JSON body with model, input, voice

Structure your request with a JSON body containing the text to speak, the desired voice preset, and the model version. Include the input field with your script, voice for tone, and model for quality.

  • input: Your text string (max 4096 characters)
  • voice: Preset like 'aria', 'nova', or 'atlas'
  • model: 'tts-1' or 'tts-1-hd'

Standard OpenAI-compatible format

The request shape mirrors the OpenAI speech endpoint. If you already use the OpenAI SDK, simply update the base_url to https://api.good888ok.com/v1. This consistency lets fitness and meditation apps adopt the API with minimal code changes.

Request parameters

Sound wave illustration for: Request parameters

To generate speech, send a POST request to /v1/audio/speech with a JSON body. The API accepts standard parameters compatible with the OpenAI SDK, allowing you to swap the base URL and use existing client libraries seamlessly.

Model: tts-1 or tts-1-hd

Choose between tts-1 and tts-1-hd. Both models use the same underlying engine and pricing structure, so you can switch between them without changing your workflow or budget expectations.

Input: text up to 4096 characters

Pass your script content in the input field, limited to 4096 characters per request. Spaces and punctuation count toward this limit. For longer meditation guides or fitness routines, split the text into chunks and join the resulting audio files sequentially.

Voice: one of 8 available presets

Select from eight distinct voices tailored for different moods. Use calming options like luna or sage for meditation apps, or energetic voices like felix for high-intensity workout prompts. Each voice supports all 23 supported languages.

  • Female: aria, nova, luna, sage
  • Male: felix, milo, atlas, orion

Response formats

Sound wave illustration for: Response formats

The response_format parameter lets you choose how the generated audio is encoded. You can select MP3, WAV, Opus, FLAC, or PCM depending on your playback needs and storage constraints.

MP3 for web playback

MP3 is the standard choice for web applications and mobile apps. It offers a good balance between file size and audio quality, making it ideal for downloading audio files directly to users.

WAV for high-quality local storage

Choose WAV when you need uncompressed, high-fidelity audio for local storage or professional editing. This format preserves the full quality of the synthesis without any lossy compression artifacts.

FLAC and Opus for efficient compression

FLAC and Opus provide efficient compression while maintaining high audio quality. These formats are suitable for reducing bandwidth usage and storage costs, especially when distributing audio files to many users.

Rate limits

Sound wave illustration for: Rate limits

Your API key allows 60 requests per minute once your account is active. This limit applies globally to all synthesis calls, ensuring fair usage across your fitness and meditation app features.

60 requests per minute per key

Standard accounts can process up to 60 synthesis requests every minute. This capacity is sufficient for most product teams generating audio for on-demand meditation sessions or workout cues without needing complex scaling logic.

10 requests per minute before top-up

New accounts start with a lower limit of 10 requests per minute. This allows you to test the API with your free trial credit before committing to a top-up. Once you add USDT, the limit increases to 60 requests per minute immediately.

Queue handling during high load

Requests are processed sequentially during periods of high demand. If you exceed the limit or the queue is busy, your request may wait briefly. This ensures audio quality remains consistent, though generation times may vary slightly during peak usage.

Rate limits

Handling long texts

Sound wave illustration for: Handling long texts

The API accepts a maximum of 4096 characters per request, so longer scripts must be split into smaller chunks. This ensures every part of your meditation or fitness instruction is processed correctly without truncation.

You can then join the resulting audio files sequentially. Since requests are processed one after another, longer texts may take a few seconds per chunk to generate, so plan your queue timing accordingly.

Split text into 4096 char chunks

Divide your input text into segments of up to 4096 characters. Each segment becomes a separate API call. Spaces and punctuation count toward this limit, so ensure your splitting logic accounts for the full string length.

  • Ensure each chunk is independent and valid
  • Count all characters, including spaces and punctuation

Join audio files sequentially

Once all chunks are synthesized, concatenate the audio files in order. This creates a single, continuous track. For long texts, generation speed is roughly real-time, so plan your queue timing accordingly.

Maintain consistent voice output

Use the same voice preset for every chunk in a single request batch. This ensures the tone remains consistent throughout the entire meditation session or workout guide, avoiding jarring voice shifts between segments.

Error handling

Sound wave illustration for: Error handling

The API returns standard HTTP status codes to help you handle common issues. A 400 error indicates invalid input, such as text exceeding the 4096-character limit per request. A 429 error means you have hit the rate limit of 60 requests per minute (or 10 before the first top-up).

If the synthesis fails, you receive a 500 error (or other error status), and the charge is returned in full. In this case, the charge is returned in full, so you do not lose credits for failed attempts. Check your key validity and request format to resolve most issues quickly.

400 Bad Request for invalid input

Check that your input text does not exceed 4096 characters. Ensure the voice and model parameters match the available options.

  • Verify text length
  • Check parameter values

429 Too Many Requests for limits

You are limited to 60 requests per minute per key.

  • 60 req/min after top-up
  • 10 req/min initially

500 errors return full charge refund

Server errors during synthesis result in a full refund. Your balance remains unaffected by these failures.

SDK integration

Sound wave illustration for: SDK integration

AuraSpeak’s API is fully compatible with the official OpenAI SDK, allowing you to leverage familiar libraries for seamless integration. By simply adjusting the base URL, your existing code structure remains intact while connecting to AuraSpeak’s infrastructure.

Use official OpenAI SDK

You do not need a custom SDK. The standard OpenAI client handles our endpoints correctly, reducing boilerplate code and simplifying maintenance for your fitness or meditation app.

  • Official OpenAI SDK support
  • Familiar method signatures
  • Reduced integration overhead

Change base_url to api.good888ok.com

Point your SDK client to https://api.good888ok.com/v1. This single configuration change directs all requests to AuraSpeak’s service without altering the core logic of your speech generation calls.

Standard client initialization

Initialize the client with your tts-... Bearer token. The request shape mirrors the standard speech endpoint, so you can generate audio using the same speech.create() pattern you know.

  • Set base_url to https://api.good888ok.com/v1
  • Pass Authorization: Bearer tts-... header
  • Use standard speech method

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Our wellness platform helps teams find calm and strength through guided fitness and meditation practices.

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. Node.js documentation
  5. W3C WAI: making audio and video accessible
  6. LibriTTS-R corpus (OpenSLR 141)
  7. openai-python on GitHub
  8. IETF RFC 7845: Ogg Opus
  9. TRON developer hub: TRC-20
  10. Python documentation
  11. LibriVox public-domain audiobooks
  12. ISO 639 language codes

More on this site