Frequently asked questions
How do I get my API key?
Sign up on the /get-api-key/ page using Google or email plus password. The dashboard displays your active API key, balance, and usage statistics. Each account holds one active key; issuing a new one immediately invalidates the previous key.
What is the base URL for the API?
The API base URL is https://api.shb800.info/v1. Use this endpoint for all requests, including POST for speech generation and GET for retrieving voices and models. The standard speech endpoint is https://api.shb800.info/v1/audio/speech.
Can I use the OpenAI Python SDK?
Yes. The API accepts the same request shape as the OpenAI speech endpoint. Configure your OpenAI SDK by setting the base_url to https://api.shb800.info/v1 and providing your LegalVoice API key in the Authorization header.
What is the maximum text length?
Each request supports up to 4096 characters of input text. For documents exceeding this limit, split the text into smaller parts, generate audio for each segment, and join the resulting audio files to create the final output.
How do I specify a language?
Include the optional 'language' field with an ISO code in your request body. If omitted, the system guesses the language, defaulting to English for Latin-script text. Explicitly setting it ensures accuracy for non-English languages like Spanish or German.
Does the API support SSML?
No. The API does not support SSML markup, phoneme dictionaries, or custom pronunciation lexicons. You must provide plain text input. The system handles basic punctuation and spacing automatically within the character limit.
What happens if I exceed rate limits?
The limit is 60 requests per minute per key. If you exceed this, requests may queue and wait for processing. New accounts start with a 10 requests per minute limit until the first top-up is completed.
Can I stream the audio response?
No. The API does not support streaming, WebSockets, or real-time partial audio. You receive the complete audio file in the response after synthesis finishes. Requests are processed sequentially, so latency depends on queue length and text length.
Is the API key case-sensitive?
Yes. Ensure you copy the exact string from your dashboard. The key format begins with 'tts-' followed by alphanumeric characters.
How do I rotate my API key?
Issue a new API key from your dashboard at any time. The new key becomes active immediately, and the previous key stops working at once. This allows seamless rotation without interrupting ongoing services if managed correctly.
What is the tts-1-hd model?
The 'tts-1-hd' model uses the same engine and pricing as 'tts-1'. Both models are available for selection in the 'model' field. There is no price difference between the standard and high-definition model options.
Do I need a specific encoding for input?
No specific encoding is required for the input text field. You can send standard UTF-8 encoded JSON strings. Spaces and punctuation count toward the character limit and are included in the audio generation.
How do I handle large documents?
Split documents into chunks of up to 4096 characters. Generate audio for each chunk individually using the API, then concatenate the resulting audio files. This ensures reliable processing and avoids exceeding the per-request character limit.
Is there a webhook for completion?
No. The API does not provide webhooks for notification. You must wait for the synchronous response. Request metadata is kept for billing, but no asynchronous completion events are sent to external endpoints.
First request
curl
curl https://api.shb800.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.mp3Python (openai)
from openai import OpenAI
client = OpenAI(base_url="https://api.shb800.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.shb800.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 | |
|---|---|
aria | female |
nova | female |
luna | female |
sage | female |
felix | male |
milo | male |
atlas | male |
orion | male |
| language | |
|---|---|
ar | العربية |
zh | 中文 |
da | Dansk |
nl | Nederlands |
en | English |
fi | Suomi |
fr | Français |
de | Deutsch |
el | Ελληνικά |
he | עברית |
hi | हिन्दी |
it | Italiano |
ja | 日本語 |
ko | 한국어 |
ms | Bahasa Melayu |
no | Norsk |
pl | Polski |
pt | Português |
ru | Русский |
es | Español |
sw | Kiswahili |
sv | Svenska |
tr | Türkçe |
Authentication
Access the LegalVoice API by including your unique API key in the Authorization header of every request. Pass the key as a Bearer token: Authorization: Bearer tts-.... This single key authenticates all requests to the endpoint https://api.shb800.info/v1 and is tied to your account’s billing balance and usage limits.
Each account holds one active key at any given time. Issuing a new key immediately invalidates the previous one, ensuring that only the most current credential grants access. This simplifies permission management for legal teams without requiring complex role-based access controls.
Bearer token usage
Include your API key in the Authorization header using the Bearer scheme. The format is Authorization: Bearer tts-<your-key>. This standard authentication method works with the official OpenAI SDKs by setting the base_url to https://api.shb800.info/v1. Ensure the key is sent in every request to generate audio or retrieve voice lists.
The key grants full access to your account’s resources, including character usage and balance. Keep it secure within your application’s environment variables or secret management system. It does not expire automatically but becomes inactive if rotated.
- Format:
Authorization: Bearer tts-... - Send with every API request
- Works with standard HTTP clients
Single active key
Your account maintains exactly one active API key. When you generate a new key from the dashboard, the old key stops working immediately. This prevents parallel usage with stale credentials and simplifies troubleshooting if a key is compromised.
This design ensures that all usage charges and rate limits are tracked against a single credential. There is no need to manage multiple keys for different environments or team members unless you rotate them.
- Only one key active at a time
- Old keys stop instantly upon rotation
- Simplifies access control
Key rotation process
Rotate your key anytime from the /get-api-key/ dashboard page. The new key takes effect immediately, invalidating the previous one. This is useful after a potential security breach or when distributing credentials to new team members.
Since there is only one active key, plan rotations during low-traffic periods if your legal workflows are running continuously. The transition is instant, so ensure your applications are updated to use the new key before the old one is revoked.
- Rotate via dashboard
- Instant invalidation of old key
- Recommended for security updates
Endpoints Overview
The API exposes three primary endpoints for legal audio generation. The primary endpoint accepts text and parameters to produce audio files. Two metadata endpoints provide available voices and model specifications without generating audio.
All endpoints require a Bearer token for authentication. Requests follow a consistent JSON structure, compatible with standard HTTP clients and the OpenAI SDKs by adjusting the base URL.
POST /v1/audio/speech
This endpoint processes text input and returns an audio file. It accepts a JSON body containing the text, voice selection, format, and speed parameters. The maximum input length is 4096 characters per request.
For longer legal documents, split the text into chunks and concatenate the resulting audio files. The service returns the audio in the requested format, such as MP3, WAV, or FLAC.
- Supports tts-1 and tts-1-hd models
- Accepts MP3, WAV, OPUS, FLAC, and PCM formats
- Handles up to 4096 characters per request
GET /v1/voices
Returns a list of available voice presets, their languages, and supported formats. Use this endpoint to verify which voices are active and compatible with your document type before generating audio.
Each voice has a unique ID used in the speech endpoint. The list includes eight presets suitable for legal narration, from clear narrators to deep documentary styles.
- Lists all 8 voice presets
- Shows supported languages and formats
- Provides voice IDs for API calls
GET /v1/models
Returns the available TTS models and their specifications. This endpoint helps you verify model availability and pricing tiers. It confirms the two engine options: tts-1 and tts-1-hd.
Use this endpoint to ensure your integration uses the correct model identifiers. Both models share the same pricing structure and character count limits.
- Lists tts-1 and tts-1-hd models
- Shows model status and details
- Confirms pricing tiers
Request Parameters
The API accepts two model identifiers, tts-1 and tts-1-hd, which utilize the identical synthesis engine and pricing tier. You may select either parameter without affecting the audio quality or cost per character, allowing your legal teams to maintain consistent billing logic regardless of the specific model string used in the request payload.
Model selection
Both tts-1 and tts-1-hd map to the same underlying engine. Use tts-1-hd for clarity if your codebase distinguishes between standard and high-definition tiers, though the output fidelity and character count remain identical for both values.
Input text length
Each request supports up to 4,096 characters, including spaces and punctuation. For longer legal briefs or contracts, split the document into chunks of this size and concatenate the resulting audio files. Text exceeding this limit will return an error, requiring your application to handle segmentation.
- Maximum 4,096 characters per request
- Spaces and punctuation count toward the limit
- Split long documents and join audio outputs
Voice preset ID
Select one of eight voice presets such as atlas for neutral news delivery or sage for calm instructional tones. The language field is optional; if omitted, the system guesses the language from the script, defaulting to English for Latin text. Specify the ISO code explicitly for non-English languages to ensure accuracy.
- Use
atlasfor neutral, news-style narration - Use
sagefor calm, instructional tones - Set
languageISO code for non-English text
Response Formats
The API returns audio as binary data in the response body, allowing direct file saving. Choose MP3 for compact storage or WAV for lossless quality suitable for archival. PCM provides raw uncompressed samples for immediate playback integration.
MP3 binary output
The API does not specify a default format; the client must explicitly request a format (mp3, wav, opus, flac, or pcm) in the request body. It is ideal for storing large volumes of generated legal documents where storage efficiency matters.
WAV high fidelity
Select WAV for lossless audio preservation. This format ensures the highest fidelity for professional briefs and case files where audio clarity is critical for review.
PCM raw audio
PCM returns uncompressed raw audio samples. Use this format if your downstream pipeline requires direct sample access without decoding overhead.
Rate Limits
Synthesis capacity is capped at 60 requests per minute per active key. This limit applies to all endpoints and ensures stable processing for legal teams processing high volumes of briefs or case files without overwhelming the service.
60 requests per minute
Each API key allows up to 60 concurrent synthesis requests within a rolling minute window. If you exceed this threshold, subsequent requests will receive a rate limit error until the window resets.
10 requests before top-up
New accounts without a top-up are limited to 10 requests per minute. This restriction ensures that free trial users can test the API without consuming excessive resources before adding USDT credit.
Queue behavior
Requests are processed sequentially. Under heavy load, a request may wait in a queue before synthesis begins. Short phrases typically take a few seconds, while longer texts generate at roughly real-time speed.
Failed requests do not consume your character limit or incur charges, but they may still count toward your rate limit window depending on the timing of the failure.

Error Handling
When processing legal documents, API responses include standard HTTP status codes to indicate success or failure. A 200 OK response confirms the audio file is ready for download. Any non-2xx code indicates a specific error condition that requires attention before retrying.
HTTP status codes
Use 400 Bad Request for malformed JSON or missing fields. Use 401 Unauthorized if the Bearer token is invalid or expired. Use 429 Too Many Requests when exceeding the rate limit of 60 requests per minute.
Invalid voice ID
If the specified voice preset does not exist or is incompatible with the selected language, the API returns a 400 error. Ensure the voice ID matches one of the eight available presets listed in the voices endpoint.
Text length errors
Input text exceeding 4096 characters results in a 400 error. Split long briefs or contracts into smaller chunks before sending. Ensure each chunk respects the character limit to avoid synthesis failure and wasted credits.
OpenAI SDK Integration
Use the official OpenAI SDKs by overriding the base URL to point to our API endpoint. This allows you to keep your existing integration logic while leveraging our specialized legal voice presets for document audio generation.
Base URL configuration
Set your client's base URL to https://api.shb800.info/v1. Pass your API key via the Authorization: Bearer header. The request body shape remains identical to the standard OpenAI speech endpoint, ensuring seamless compatibility with your current codebase.
Python SDK example
Initialize the client with your key and custom base URL. Pass the text input, desired voice preset (e.g., 'atlas' for neutral news style), and output format. The SDK handles the JSON serialization and binary response parsing automatically.
Node.js SDK example
Configure the OpenAI Node.js client with the API key and base URL. Invoke the audio.speech.create method with your legal text and voice parameters. The response returns the complete audio file (as a blob or binary data) for immediate playback or storage.
Curl Example
Use curl to test the LegalVoice API directly from your terminal. The following examples demonstrate how to generate audio for legal briefs, adjust playback speed for rapid review, and specify languages for international case files.
Basic speech request
Send a standard POST request to the speech endpoint. Replace YOUR_API_KEY with your key and text with your document content.
- curl -X POST https://api.shb800.info/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "The defendant shall pay...", "voice": "atlas"}'
Custom speed setting
Adjust the speed parameter (0.25–4.0) to fit your workflow. Faster speeds aid quick scanning, while slower rates improve comprehension of complex legal terms.
- curl -X POST https://api.shb800.info/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"model": "tts-1", "input": "Clause 4.2 applies...", "voice": "sage", "speed": 1.5}'
Language code usage
Explicitly set the language parameter for non-English texts to ensure accurate pronunciation. This prevents the system from defaulting to English for Latin-script texts.
- curl -X POST https://api.shb800.info/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"model": "tts-1", "input": "Der Kläger beantragt...", "voice": "nova", "language": "de"}'
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Ensure the voice matches the gravity of the content; a light tone may undermine a serious motion, while a heavy tone may bore a simple status report.
23 languages
Any voice speaks any of these languages.
