API Documentation for Legal Text Synthesis

By LexiLoom editorial team · Updated 2026-11-18

This documentation provides the technical specifications for the LexiLoom text-to-speech API, designed specifically for indie developers integrating audio synthesis into legal technology applications. You will find precise details on request structures, parameter constraints, and error handling required to process contracts, statutes, and briefs reliably.

The guide covers authentication workflows, OpenAI SDK compatibility, and rate limit behaviors to ensure your integration remains compliant and auditable. All endpoints follow standard JSON formats, allowing you to generate synthetic speech for legal texts with character-level precision and predictable queue processing.

API Documentation for Legal Text Synthesis

Frequently asked questions

How do I get an API key for the TTS reader?

Sign up on the /get-api-key/ page using Google or email plus password. The dashboard displays your active key, balance, trial, characters left, usage and a ready curl example. You can issue a new key at any time; the previous one stops immediately upon rotation.

What is the base URL for the OpenAI SDK?

Configure your SDK's base_url to https://api.777shcasino.com/v1. This endpoint supports the same request shape as the OpenAI speech endpoint, allowing standard SDK integration by simply pointing to this domain with your specific API key.

Can I use the official OpenAI Python SDK?

Yes. The API accepts the same request shape as the OpenAI speech endpoint. You can use the official OpenAI Python SDK by changing the base_url to https://api.777shcasino.com/v1 and providing your LexiLoom API key.

What is the maximum character limit per request?

Each request supports up to 4096 characters in the input field. For longer texts, split the content into parts of this size and join the resulting audio files. Spaces and punctuation count toward this limit.

How do I handle rate limit errors?

The limit is 60 requests per minute per key (10 before the first top-up). Requests process sequentially, so under load, they may queue. Implement exponential backoff in your client to retry after receiving a rate limit error.

Does the API support SSML tags?

No. The API does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. You must manage pacing and emphasis by splitting text into multiple requests or adjusting the speed parameter between 0.25 and 4.0.

What happens if I send an empty input text?

The API processes the request and returns the result. If synthesis fails for any reason, the charge is returned in full, ensuring you are not billed for invalid or empty inputs that do not generate audio.

How do I specify the response format?

Include the response_format field in your JSON body. Valid formats are mp3, wav, opus, flac, and pcm. This parameter determines the audio encoding of the returned file, allowing flexibility for different legal tech playback requirements.

Is streaming audio supported in this API?

No. The API does not support streaming, WebSocket connections, or real-time partial audio. You send text and receive the complete audio file. Requests are processed sequentially, so generation time depends on text length and queue status.

Can I mix voices in a single request?

No. Each request accepts only one voice from the eight presets. To mix voices, send multiple requests with different voice parameters and concatenate the resulting audio files in your application logic.

How do I rotate my API key?

Issue a new key via your account dashboard. The new key becomes active immediately, and the old one stops at once. This ensures seamless rotation without downtime for your legal tech integrations.

What is the default language if not specified?

If the language field is omitted, the system guesses the language from the script. Latin script text defaults to English. For non-English Latin text, explicitly set the language to ensure accurate synthesis.

Are there limits on the speed parameter?

Yes. The speed parameter accepts values between 0.25 and 4.0. This allows you to adjust playback speed for reading contracts or statutes, ensuring the audio matches the desired pacing for your legal applications.

How do I verify a request was successful?

A successful request returns the audio file in the response body. Failed requests are free, with charges returned in full. Check the HTTP status code and response content to confirm synthesis completion and billing accuracy.

First request

curl

curl https://api.777shcasino.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.777shcasino.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.777shcasino.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 and Keys

Sound wave illustration for: Authentication and Keys

Authentication for the LexiLoom TTS API requires a Bearer token included in the HTTP header of every request. This credential grants access to the synthesis endpoint and must be kept secure within your legal tech application's environment.

Bearer Token Format

The token must be passed in the Authorization header using the format Bearer tts-<your-key>.

  • Format: Authorization: Bearer tts-abc123...
  • Header name: Authorization
  • Prefix: Bearer

Key Rotation Process

You can issue a new API key at any time via your dashboard. This allows for secure rotation; the previous key becomes invalid instantly upon creation of the new one.

Single Active Key Rule

Each account maintains only one active key at any given moment. When a new key is generated, the previous key stops working immediately. Ensure your integration handles this transition by updating the header value in your production environment promptly.

  • One active key per account
  • Old key invalidates immediately on new key creation

Endpoint Structure

Sound wave illustration for: Endpoint Structure

The API exposes three primary endpoints for text-to-speech synthesis and configuration. The speech endpoint accepts POST requests to generate audio, while the voices and models endpoints provide configuration details for compliant legal document processing.

Speech POST Request

Send text to POST https://api.777shcasino.com/v1/audio/speech as a JSON body. The request requires a model (tts-1 or tts-1-hd), input text, and voice ID. Include response_format, speed, and optional language. The engine returns an audio file directly.

Voices GET Request

Retrieve available voice presets, supported languages, and audio formats via GET /v1/voices. This endpoint lists the eight available voices (e.g., aria, atlas, milo) and confirms supported output formats like mp3, wav, opus, flac, and pcm.

Models GET Request

Fetch model metadata using GET /v1/models. This confirms the available engine versions (tts-1 and tts-1-hd) which share the same engine and pricing structure for legal text synthesis.

Endpoint Structure

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts text input up to 4096 characters per request, where spaces and punctuation count toward the limit. For longer legal documents, split the text into chunks and join the resulting audio files sequentially. Input is not used for training.

Model Selection

Select "tts-1" or "tts-1-hd" for the same engine and pricing. The choice does not affect cost, which remains $10 per 1 million characters.

Input Text Limit

Each request supports a maximum of 4096 characters. Exceeding this limit triggers an error. Use chunking for statutes or contracts longer than the limit.

Voice ID Specification

Choose from eight presets: aria, nova, luna, sage (female); felix, milo, atlas, orion (male). Any voice supports all 23 languages. Set the language parameter explicitly for non-English Latin text to ensure accurate synthesis.

  • aria: warm, clear narrator
  • nova: bright, upbeat
  • atlas: neutral, news
  • orion: deep, documentary

Response Formats

Sound wave illustration for: Response Formats

The API returns synthesized audio directly in the response body, allowing seamless integration into legal tech workflows. You may request the output in MP3, WAV, OPUS, FLAC, or PCM formats to suit your storage and playback infrastructure.

Each generated file contains an inaudible watermark identifying it as synthetic speech.

Audio File Return

Audio data is returned immediately upon successful synthesis. The format matches your response_format request parameter.

Generated audio is not stored on our servers; it is delivered directly in the response for immediate use.

  • Supported formats: mp3, wav, opus, flac, pcm

Metadata Inclusion

Standard HTTP headers provide context for the returned audio file, including content type and character count used for billing.

Request metadata such as timestamp and status is retained for auditing but not included in the audio payload.

Error JSON Structure

On failure, the API returns a JSON object detailing the error, ensuring your application can handle issues programmatically.

Failed requests are free: if synthesis fails, the charge is returned in full.

Rate Limits and Queues

Sound wave illustration for: Rate Limits and Queues

LexiLoom enforces strict rate limits to ensure stable synthesis for legal document processing. Each API key is capped at 60 requests per minute under standard conditions.

60 Requests Per Minute

The standard rate limit is 60 requests per minute per active key. This ceiling prevents resource contention during high-volume document reading tasks. Exceeding this limit returns a 429 Too Many Requests error, requiring immediate backoff.

Initial 10 RPM Limit

New accounts without a top-up are restricted to 10 requests per minute. This lower threshold applies until the first payment is confirmed.

Queue Processing Order

Requests are processed sequentially within the available capacity. Under load, additional requests enter a queue and are executed in strict arrival order. Longer texts may experience slight delays due to real-time synthesis speed, approximately 25 characters per second.

Rate Limits and Queues

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

LexiLoom’s API mirrors the OpenAI speech endpoint structure, allowing developers to reuse existing integration code with minimal adjustments. By overriding the base URL, your application routes requests to our infrastructure while maintaining standard request shapes and response formats.

Base URL Override

Set the base URL to https://api.777shcasino.com/v1 in your SDK configuration. This directs all speech synthesis requests to the correct endpoint without modifying the core logic.

SDK Compatibility

The official OpenAI SDKs work directly with this configuration.

Header Configuration

Include your API key in the Authorization header as a Bearer token. Ensure the key format matches the standard pattern used in the dashboard.

Error Handling

Sound wave illustration for: Error Handling

The API returns standard HTTP status codes to indicate request outcomes. A 200 OK status confirms successful synthesis, while 4xx codes indicate client errors such as authentication failures or invalid parameters. Responses include a JSON body with a specific error code and a human-readable message for debugging.

Common HTTP Errors

Use 401 Unauthorized when the Bearer token is missing or invalid. Use 429 Too Many Requests if you exceed the 60 requests per minute limit.

Character Limit Exceeded

The input field accepts up to 4096 characters. Requests exceeding this limit return a 400 Bad Request error. Split longer legal texts into segments before sending to ensure compliance with the single-request constraint.

Invalid Voice ID

The system only accepts eight specific voice presets. Providing an unrecognized voice ID results in a 400 error. Consult the /v1/voices endpoint to verify available IDs before integration.

Error Handling

Curl Example for Legal Text

Sound wave illustration for: Curl Example for Legal Text

Use cURL to verify API connectivity and generate audio for statutory text. The following command demonstrates a standard synthesis request using the tts-1 model, targeting a concise legal clause.

Basic Synthesis Command

The base URL is https://api.777shcasino.com/v1. Replace YOUR_API_KEY with your active token. The input text must not exceed 4096 characters. This command sends a POST request to /v1/audio/speech.

MP3 Format Selection

Specify response_format as mp3 for broad compatibility. The API returns the audio file directly in the response body.

Speed Parameter Usage

Adjust the speed parameter between 0.25 and 4.0. A speed of 1.0 represents natural reading pace. Increasing speed reduces generation time but may affect clarity for dense legal terminology.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Review your contracts carefully to protect your creative vision and ensure fair compensation for your hard work.

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. MDN: Web Speech API
  3. LibriTTS-R paper (arXiv 2305.18802)
  4. Python documentation
  5. openai-node on GitHub
  6. LibriTTS-R corpus (OpenSLR 141)
  7. W3C WAI: making audio and video accessible
  8. Tether (USDT)
  9. openai-python on GitHub
  10. curl documentation
  11. ISO 639 language codes
  12. TRON developer hub: TRC-20

More on this site