Text to Speech API Documentation and Integration Guide

By SpeakWise editorial team · Updated 2026-11-18

This documentation guides agencies integrating SpeakWise for corporate training content. You will find exact specifications for generating clear audio files from scripts, managing voice presets, and handling high-volume requests. The guide covers authentication, parameter details, and integration patterns tailored to your workflow.

We provide concrete examples for the OpenAI Python SDK and direct HTTP requests. You can see how to split long texts, select appropriate voices, and manage rate limits. This page helps your developers connect the API quickly, ensuring your team can focus on curriculum design while we handle the audio generation.

Frequently asked questions

How do I get an API key?

Sign up on the /get-api-key/ page using Google or an email and password. The dashboard displays your active API key, balance, and usage statistics. Each account holds one active key, which you can replace at any time.

What is the base URL?

The API base URL is https://api.t6slotth.com/v1. You send POST requests to /v1/audio/speech for synthesis. Other endpoints include GET /v1/voices and GET /v1/models for configuration details.

Does it work with OpenAI SDK?

Yes. The request shape matches the OpenAI speech endpoint. You can use official OpenAI SDKs by changing the base_url to https://api.t6slotth.com/v1 and providing your site-specific API key in the Authorization header.

How do I handle errors?

Failed requests are free, and the charge is returned in full. Check the response status code to identify issues. If synthesis fails, you are not billed, ensuring your budget remains accurate for corporate training projects.

What are the 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 high volume may cause queuing delays during peak times.

Can I use Python?

Yes. Since the API follows the OpenAI request format, you can use the standard OpenAI Python SDK. Simply configure the base_url to https://api.t6slotth.com/v1 and use your API key for authentication in your scripts.

How do I change voices?

Include the voice parameter in your JSON body. Choose from eight presets like aria, nova, or atlas. You can also specify a language ISO code to ensure correct pronunciation for non-English texts.

Is the API RESTful?

Yes. It uses standard HTTP methods. POST to /v1/audio/speech for generation. GET /v1/voices lists available options. GET /v1/models provides model details. All interactions are stateless and follow standard REST principles for easy integration.

Do I need JSON?

Yes. The request body must be JSON. It includes fields like model, input, voice, and response_format. The API expects this specific structure to process your text and return the audio file efficiently for your agency workflows.

How do I detect language?

Set the optional language parameter to an ISO code. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Explicitly setting it ensures accuracy for diverse corporate training content.

What if the request fails?

If synthesis fails, the request is free, and the charge is returned in full. You can retry the request or split long texts into parts under 4096 characters to improve reliability and manage processing queues effectively.

Can I stream audio?

No. The API returns the complete audio file in the response. There is no WebSocket or real-time partial audio streaming. You receive the file once generation is complete, which suits standard training content delivery workflows.

Do you have a mobile SDK?

No. We do not offer a dedicated mobile SDK. You can use the official OpenAI SDKs or plain HTTP requests. This allows you to integrate the API into any mobile application using standard networking libraries.

How do I rotate keys?

Issue a new key from your dashboard at any time. The new key becomes active immediately, and the old one stops working at once. This ensures secure access management for your agency’s corporate training infrastructure.

First request

curl

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

Authenticate your API requests using a single active key issued to your account. You can locate your key on the dashboard at /get-api-key/, where it is displayed alongside your current balance and usage statistics.

API Key Location

API Key Location

Your key is generated when you sign up via Google or email. It appears on the key management page, ready to be copied into your application configuration or environment variables.

Header Format

Header Format

Include the key in every request using the standard Authorization header. The format is Authorization: Bearer tts-..., ensuring the API recognizes your account credentials for each synthesis job.

Key Rotation

Key Rotation

If needed, you can issue a new key at any time from your dashboard. The previous key stops working immediately, ensuring secure access control for your agency’s integration.

Endpoints

Sound wave illustration for: Endpoints

SpeakWise provides three core REST endpoints to power your corporate training audio pipeline. These endpoints handle voice discovery, model metadata, and the actual audio synthesis, allowing your engineering team to integrate TTS capabilities directly into your LMS or content management system without managing external dependencies.

Speech Generation

Speech Generation

POST to https://api.t6slotth.com/v1/audio/speech to convert text into audio. Send a JSON body with model, input, voice, and response_format. The API returns the audio file directly in the response body, ready for playback or storage in your training module assets.

Voice List

GET https://api.t6lotth.com/v1/voices to retrieve available voices, languages, and formats. This helps your team select the right tone for different modules without hardcoding voice IDs.

Model Info

GET https://api.t6slotth.com/v1/models returns metadata about the underlying TTS engines (tts-1 and tts-1-hd). Use this to verify model availability and pricing tiers before committing to a specific synthesis quality for your corporate curriculum.

Request Parameters

Sound wave illustration for: Request Parameters

Configure your API requests by defining the source text, the desired voice persona, and the output audio format. Each parameter directly influences the clarity and usability of the generated training audio files.

Input Text

Send plain text in the input field. The maximum length is 4,096 characters per request, including spaces and punctuation. For longer scripts, split the text into chunks and join the resulting audio files.

  • Max 4,096 characters per request
  • Spaces and punctuation count toward the limit
  • Split and join for longer content

Voice Selection

Choose from eight preset voices using the voice parameter. Each voice has a distinct tone suitable for different training scenarios, from upbeat introductions to calm, instructional narration.

  • Female voices: aria, nova, luna, sage
  • Male voices: felix, milo, atlas, orion
  • Select based on script tone

Response Format

Specify the audio format using response_format. Supported formats include mp3, wav, opus, flac, and pcm. Choose the format that best fits your learning management system or playback requirements.

  • mp3, wav, opus, flac, pcm
  • Select based on LMS compatibility

Response Codes

Sound wave illustration for: Response Codes

SpeakWise returns standard HTTP status codes to indicate the outcome of your synthesis requests. A successful call returns the audio file directly in the response body, allowing your agency’s pipeline to process the audio immediately without additional polling steps.

Errors are clearly categorized so your team can debug integration issues quickly. Failed requests do not consume your character balance, ensuring you only pay for usable audio outputs.

Success Response

A 200 OK status indicates the audio was generated successfully. The response body contains the binary audio data in the requested format (mp3, wav, opus, flac, or pcm). No additional JSON payload is required to retrieve the file.

Error Codes

400 Bad Request occurs if the voice is invalid, or the JSON structure is malformed. 401 Unauthorized appears if the API key is missing or incorrect. 429 Too Many Requests signals that you have hit the rate limit of 60 requests per minute (or 10 before the first top-up).

  • 400: Invalid input parameters or character limit exceeded
  • 401: Missing or invalid API key
  • 429: Rate limit exceeded (60 req/min)

Rate Limits

The API enforces a limit of 60 requests per minute per key. If you exceed this, subsequent requests receive a 429 error. New accounts start with a 10 requests per minute limit until the first top-up is processed. Requests are processed sequentially, so high volume may result in queuing delays.

  • Standard limit: 60 requests/minute
  • Initial limit: 10 requests/minute
  • Failed requests are free

SDK Integration

Sound wave illustration for: SDK Integration

The SpeakWise API mirrors the OpenAI speech endpoint structure, allowing agencies to leverage existing OpenAI SDK clients with minimal configuration changes. This compatibility simplifies integration for teams already familiar with standard HTTP clients or the official OpenAI Python library.

OpenAI SDK Setup

Install the standard OpenAI SDK via pip or your preferred package manager. No custom library is required; the official client handles the request formatting and authentication headers correctly for our endpoint.

Base URL Change

Configure the client to point to our infrastructure by updating the base_url parameter. Set the base URL to https://api.t6slotth.com/v1 and use your unique API key for authentication.

  • Base URL: https://api.t6slotth.com/v1
  • Auth Header: Authorization: Bearer tts-...

Python Example

Initialize the client with the new base URL. Pass your text, selected voice, and desired format. The SDK returns the audio binary directly, which you can save or process for your training modules.

  • client = OpenAI(base_url='https://api.t6slotth.com/v1', api_key='tts-...')
  • audio = client.audio.speech.create(model='tts-1', voice='aria', input='Generate training audio.', response_format='mp3')
  • with open('training.mp3', 'wb') as f: f.write(audio.content)

Curl Example

Sound wave illustration for: Curl Example

Use the following curl command to generate speech from your script. This example sends a short training module text to the API, which returns the audio file directly for immediate playback or storage in your LMS.

Basic Request

Send a POST request to the speech endpoint with your model and voice selection. The system processes the input text and returns the audio file in your chosen format, ready for integration into your corporate training workflows.

Headers

Include your API key in the Authorization header using the Bearer token format. Ensure the content type is set to application/json so the API correctly parses your request parameters and voice specifications.

  • Authorization: Bearer tts-your-api-key-here
  • Content-Type: application/json

Response Body

A successful response returns the audio file directly in the body. If synthesis fails, you receive an error JSON object explaining the issue, with no charge applied to your balance for that specific request.

Rate Limits

Sound wave illustration for: Rate Limits

SpeakWise enforces a standard limit of 60 requests per minute per API key. New accounts start with a lower limit of 10 requests per minute until the first top-up is processed.

Requests are processed sequentially, meaning under load, synthesis may wait in a queue. Typical generation speed is roughly real-time, but short phrases may take a few seconds to complete.

Requests Per Minute

Your API key allows 60 requests per minute. This limit applies to the total number of speech generation calls, not character count.

Before your first top-up, new accounts are limited to 10 requests per minute to prevent accidental overuse.

  • Limit: 60 requests/minute (standard)
  • Limit: 10 requests/minute (pre-top-up)

Queue Processing

Requests are processed one after another. If you exceed the per-minute limit or the server is busy, your request may wait in a queue.

Long texts are split into parts, so each part counts as a separate request toward your limit.

Burst Limits

There is no hard burst limit beyond the per-minute cap. However, rapid successive requests may experience slight delays due to queue processing.

For large-scale training content generation, consider spacing out requests to ensure consistent delivery times.

Audio Formats

Sound wave illustration for: Audio Formats

SpeakWise supports multiple audio formats to fit different playback environments. Choose the format that best balances quality, file size, and compatibility for your corporate training modules.

MP3 Usage

MP3 is a common format and offers a balance between file size and audio quality. It is widely supported by most Learning Management Systems (LMS) and web players, making it ideal for general training content.

  • Default choice for web-based training
  • Compresses well for faster downloads

WAV Usage

WAV provides uncompressed audio. Use this format if your production pipeline requires lossless quality.

  • Lossless quality
  • Larger file size

Opus Usage

Opus offers superior compression efficiency, often resulting in smaller files than MP3 at similar perceived quality. It is well-suited for mobile applications or bandwidth-constrained environments where storage space is limited.

  • High compression efficiency
  • Small file size

Listen to the 8 voices

Each sample below was generated by this API from the same sentence.

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 API reference: create speech
  3. openai-python on GitHub
  4. curl documentation
  5. TRON developer hub: TRC-20
  6. MDN: Web Speech API
  7. LibriVox public-domain audiobooks
  8. Python documentation
  9. FFmpeg documentation
  10. Creative Commons Attribution 4.0
  11. Tether (USDT)
  12. openai-node on GitHub

More on this site