Integrate Our TTS API into Your LMS Quickly

By VoiceCopy Logic editorial team · Updated 2026-11-19

This guide helps LMS administrators integrate reliable text-to-speech into their online courses without complex infrastructure. You will learn how to generate an API key, structure requests, and select voices that match your educational content. The process uses standard HTTP methods, so no custom SDK installation is required for your existing platform.

We cover practical details like handling long lectures by splitting text, managing rate limits for concurrent students, and choosing audio formats for web players. By the end, you will have a working integration that delivers clear, synthetic speech with transparent pricing and straightforward error handling.

Integrate Our TTS API into Your LMS Quickly

Frequently asked questions

What is the base URL for the API?

The API base URL is https://api.hum3d.info/v1. You send POST requests to https://api.hum3d.info/v1/audio/speech. This endpoint accepts JSON bodies containing your text, voice selection, and audio format preferences. It follows the same structure as standard speech endpoints, making integration straightforward for your LMS or course platform.

Does the OpenAI SDK work with your API?

Yes, the official OpenAI SDKs work by changing the base_url to https://api.hum3d.info/v1 and using your site’s key. This allows you to use familiar code structures for integration. You do not need a custom client library, as the request shape matches the standard speech endpoint exactly.

How do I authenticate my requests?

Include an Authorization header with the value Bearer followed by your API key (tts-...). Each account has one active key. You can issue a new key at any time, which immediately stops the old one. Ensure your key is secure and passed with every request to your LMS.

What audio formats are supported?

You can choose from mp3, wav, opus, flac, or pcm formats. Select the response_format field in your request body to specify your preference. This flexibility allows you to optimize file sizes for web delivery or use uncompressed formats for educational materials in your online courses.

Can I send text longer than 4096 characters?

Each request supports up to 4096 characters. For longer texts, split your content into parts of this size and join the resulting audio files. This workflow ensures consistent quality and manageable processing times, which is ideal for generating full course modules or lengthy educational transcripts efficiently.

How do I handle rate limit errors?

The limit is 60 requests per minute per key. If you exceed this, implement retry logic with exponential backoff in your LMS integration. New accounts start with 10 requests per minute. Monitor your usage dashboard to adjust your generation pacing, especially during bulk content creation for course updates.

What happens if the API returns an error?

If synthesis fails, the charge is returned in full. Failed requests do not cost you characters from your balance. Ensure your application handles HTTP error codes appropriately and retries if necessary. This guarantees that your billing remains accurate even if temporary processing issues occur during peak usage times.

Do I need to install extra libraries?

No, you can use the official OpenAI SDK or plain HTTP requests. There is no proprietary SDK required. This means you can integrate using standard tools your developers already know. It reduces dependency overhead and simplifies maintenance within your existing LMS infrastructure or custom course platforms.

Is JSON the only request format?

Yes, the API expects a JSON body for the POST request to /v1/audio/speech. Fields include model, input, voice, response_format, and speed. This standard format ensures compatibility with most modern programming languages and HTTP clients, making it easy to script voice generation directly from your course management system.

How do I specify the language?

Set the optional language field to an ISO code. If omitted, the system guesses the language, defaulting to English for Latin script. For non-English Latin text, always set the language parameter explicitly. This ensures accurate pronunciation across the 23 supported languages, including Arabic, Chinese, and Japanese.

First request

curl

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

Sound wave illustration for: Authentication Setup

Access the /get-api-key/ page to create your account using Google or an email address. Once registered, your unique API key is displayed alongside your current balance and usage statistics.

This key grants immediate access to the TTS engine, allowing you to start generating audio for your online courses within minutes.

Generate Your API Key

Generate Your API Key

Navigate to the /get-api-key/ page to sign up via Google or email. Your key is generated instantly and displayed on the dashboard, ready for immediate use in your LMS integrations.

  • Sign up via Google or email
  • Key displayed immediately on dashboard
  • One active key per account

Bearer Token Usage

Bearer Token Usage

Include your key in the Authorization header as Bearer tts-... for every request. This standard authentication method works seamlessly with the OpenAI SDK by setting the base_url to https://api.hum3d.info/v1.

Ensure your key is kept secure within your LMS environment to prevent unauthorized usage of your character credits.

Key Rotation Process

You can issue a new API key at any time from your dashboard. The previous key stops working immediately, ensuring tight control over access if a key is compromised.

This process is instant, requiring no downtime for your active course integrations.

First API Request

Sound wave illustration for: First API Request

To generate speech, send a POST request to https://api.hum3d.info/v1/audio/speech. The API accepts standard JSON payloads and returns audio files directly, making integration straightforward for LMS administrators using simple scripts or no-code tools.

The endpoint mirrors the OpenAI speech structure, allowing you to use familiar SDKs by simply adjusting the base URL. Below is a minimal example using cURL to synthesize a short instructional phrase.

cURL Example Code

Use this command to test the API. Replace YOUR_API_KEY with your credential from /get-api-key/. The response will return the audio file directly in the body.

  • curl -X POST https://api.hum3d.info/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Welcome to Module 1.", "voice": "nova", "response_format": "mp3"}'

JSON Body Structure

The request body is a JSON object containing the text to be spoken and configuration options. Fields like voice and speed are optional but recommended for consistent output.

The input field holds your course text, capped at 4096 characters. The model field accepts either "tts-1" or "tts-1-hd" for identical pricing and engine quality.

Required Parameters

Only model and input are strictly required. However, specifying voice ensures predictable tone for your educational content. If language is omitted, the system guesses from the script, defaulting to English for Latin text.

  • model: "tts-1" or "tts-1-hd"
  • input: The text string (max 4096 chars)
  • voice: One of 8 presets (e.g., nova, atlas)
  • response_format: mp3, wav, opus, flac, or pcm

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

Leverage the official OpenAI Python or JavaScript SDKs by simply overriding the default API base URL. Point the client configuration to https://api.hum3d.info/v1 instead of OpenAI’s endpoint. This allows you to use standard library methods for speech generation without rewriting your integration logic.

Change Base URL

Configure your SDK client with the new base URL: https://api.hum3d.info/v1. Pass your tts-... key via the standard Authorization: Bearer header. The request structure remains identical to the OpenAI speech endpoint, ensuring immediate compatibility with existing codebases.

Standard SDK Compatibility

Use standard methods like client.audio.speech.create(). Pass parameters such as model, input, voice, and response_format exactly as documented. The SDK handles JSON serialization and HTTP transport, reducing boilerplate code for LMS integrations.

Language Support in SDK

Include the language parameter (e.g., "de" for German) in your SDK call to ensure accurate pronunciation. If omitted, the API guesses the language, defaulting to English for Latin scripts. Explicitly setting the code prevents mispronunciation in multilingual courses.

Audio Formats

Sound wave illustration for: Audio Formats

Select the output format that best fits your LMS player and distribution needs. The API supports five distinct audio formats, allowing you to balance file size, compatibility, and quality.

MP3 for Web Players

MP3 is the standard choice for embedding audio directly into course modules. Its compressed nature ensures fast loading times for students, while maintaining broad compatibility across all modern browsers and mobile devices.

WAV for High Quality

Choose WAV for uncompressed audio. This format is suitable for downloadable course materials or professional presentations where file size is less critical than perfect fidelity.

OPUS, FLAC, and PCM Options

Use OPUS for highly efficient streaming with small file sizes. FLAC offers lossless compression for archival purposes, preserving every detail without increasing file weight significantly. PCM provides raw, uncompressed audio data for specialized audio processing pipelines.

  • OPUS: Best for low-bandwidth streaming
  • FLAC: Lossless compression for archives
  • PCM: Raw data for processing

Voice Selection

Sound wave illustration for: Voice Selection

Select a voice that matches your course’s pedagogical style. Choose from eight distinct presets designed for clear, instructional delivery without artificial emotion tags.

List Available Voices

Our API offers eight preset voices: Aria, Nova, Luna, and Sage for female tones; Felix, Milo, Atlas, and Orion for male tones.

  • Aria: warm, clear narrator
  • Nova: bright, upbeat
  • Luna: soft, storytelling
  • Sage: calm, instructional
  • Felix: energetic, promo
  • Milo: friendly, conversational
  • Atlas: neutral, news
  • Orion: deep, documentary

Voice Preset Descriptions

Each voice is synthesized from licensed recordings (LibriTTS-R) to ensure consistent quality. No voice cloning is involved; you are selecting from fixed, high-fidelity presets.

Language Code Configuration

Specify the language parameter (e.g., 'en', 'de', 'fr') to ensure accurate pronunciation. Without it, Latin-script text defaults to English.

Voice Selection

Error Handling

Sound wave illustration for: Error Handling

The API returns standard HTTP status codes to indicate request outcomes. A 400 error typically signals invalid input, such as exceeding the 4096-character limit or using an unsupported voice preset. A 401 error indicates an expired or incorrect API key, requiring you to verify your credentials in the dashboard.

Implement simple retry logic for transient network issues or 5xx server errors. Avoid aggressive retry loops, as requests are processed sequentially; under load, you may experience queue delays. Exponential backoff is recommended to prevent overwhelming the endpoint during high-traffic periods.

Common HTTP Errors

Use the response body to identify specific issues like invalid JSON structure or missing required fields. Always log the request details for support inquiries, as we do not store the audio content itself, only metadata for billing purposes.

Retry Logic

Retry only on 429 (Rate Limit) and 5xx errors. Do not retry on 400 or 401 errors, as these will fail repeatedly until the input or key is corrected. Remember that requests are processed one after another, so patience is key.

Failed Request Refunds

If synthesis fails due to server-side errors, the charge is returned in full. You are not billed for failed requests, ensuring you only pay for successful audio generation. Check your balance in the dashboard to confirm credit returns.

Rate Limits

Sound wave illustration for: Rate Limits

Rate limits ensure stable performance for your LMS integration. Each API key is capped at 60 requests per minute. This allows consistent audio generation for course materials without overwhelming the server.

New accounts start with a stricter limit of 10 requests per minute. This initial cap remains until you add funds to your balance. Once you top up, the limit increases to the standard 60 RPM.

60 Requests Per Minute

Each key supports 60 requests per minute. This is sufficient for most course creation workflows. Monitor your usage via the dashboard to stay within limits.

  • Standard limit applies after top-up
  • One active key per account
  • Limits are calculated per minute

Initial Limit of 10 RPM

New accounts begin with 10 requests per minute. This ensures stability during the trial phase. The limit increases automatically after your first top-up.

  • Applies to new accounts
  • Increases after first top-up
  • No manual upgrade needed

Queue Behavior Under Load

Requests are processed sequentially. Under heavy load, additional requests may wait in a queue. This ensures fair resource distribution. Generation time is roughly real-time on long texts, so plan your integration accordingly.

  • Sequential processing
  • Queuing under load
  • Real-time generation speed

Text Splitting Strategy

Sound wave illustration for: Text Splitting Strategy

When generating audio for extended course modules or lengthy textbook chapters, the input text must not exceed 4,096 characters per request. This constraint applies to the raw character count, including spaces and punctuation, ensuring consistent processing performance across your LMS integration.

4096 Character Limit

Each API call accepts a maximum of 4,096 characters. If your lecture transcript or educational material exceeds this length, you must split the text into smaller chunks before sending them to the endpoint. This ensures that every request is processed efficiently without truncation.

Joining Audio Files

Once you split your text, send each chunk as a separate request. The API returns individual audio files for each segment. Your application should then concatenate these files in order to reconstruct the full audio track for the learner.

Managing Long Lectures

For long-form content, implement a client-side splitter that respects character boundaries. Generate audio for each part sequentially or in parallel, then merge the results. This approach maintains audio continuity while adhering to the per-request character limit.

  • Split text at natural pauses or sentence ends to avoid awkward audio cuts.
  • Ensure your LMS player can seamlessly play concatenated audio segments.
  • Track character usage to manage your balance.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Ensure your LMS allows custom HTML injection in lesson pages.

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. ISO 639 language codes
  3. W3C WAI: making audio and video accessible
  4. LibriTTS-R corpus (OpenSLR 141)
  5. FFmpeg documentation
  6. Creative Commons Attribution 4.0
  7. openai-python on GitHub
  8. LibriTTS-R paper (arXiv 2305.18802)
  9. LibriVox public-domain audiobooks
  10. Node.js documentation
  11. curl documentation
  12. OpenAI API reference: create speech

More on this site