API Documentation for Legal Audio Generation

By Juridicore editorial team · Updated 2026-11-19

This documentation guides legal teams through integrating Juridicore’s text-to-speech API for generating auditable audio versions of contracts and briefs. You will find precise instructions for authentication, request formatting, and SDK compatibility, ensuring your workflow handles complex legal terminology with accuracy. Note that the API does not support SSML or custom pronunciation lexicons. The guide covers essential parameters like voice selection, speed, and language codes, along with concrete examples for immediate implementation.

Designed for developers managing high-volume batches, this page details rate limits, error handling, and response formats specific to legal use cases. You will learn how to rotate API keys, manage quotas, and interpret responses from the api.dk7h.cc endpoint. Whether using cURL or the OpenAI SDK, you gain the technical specifics needed to automate document narration without sacrificing compliance or clarity.

API Documentation for Legal Audio Generation

Frequently asked questions

How do I get an API key?

Sign up on the /get-api-key/ page using Google or email plus password. Accounts are per site. The dashboard displays your active key, balance, and usage statistics. You can issue a new key at any time, which immediately invalidates the previous one.

What is the base URL for the API?

The API base URL is https://api.dk7h.cc/v1. Use this endpoint for all requests, including POST /v1/audio/speech, GET /v1/voices, and GET /v1/models. Ensure your requests target this specific domain to authenticate correctly with your Juridicore credentials.

Does the API support the OpenAI Python SDK?

Yes. The request shape matches the OpenAI speech endpoint. You can use the official OpenAI SDKs by changing the base_url to https://api.dk7h.cc/v1 and providing your Juridicore API key. This allows seamless integration into existing Python workflows without custom client code.

What models are available for Hindi?

Both tts-1 and tts-1-hd models support Hindi. These models share the same engine and pricing structure. You can select any of the eight voice presets, as every voice supports all 23 languages, including Hindi, without requiring model-specific configuration.

How do I specify the Hindi language in the request?

Include the optional 'language' field with the ISO code 'hi' in your JSON body. If omitted, the system guesses the language from the script. For Hindi text using Latin script, you must explicitly set the language parameter to ensure correct pronunciation.

What is the maximum input text length?

Each request supports up to 4096 characters. Longer texts must be split into parts of this size and joined afterward. Spaces and punctuation count toward this limit. This ensures consistent processing times and prevents payload size issues during synthesis.

Can I adjust the speed of the audio?

Yes, you can set the 'speed' parameter between 0.25 and 4.0. This allows you to speed up or slow down the narration to fit your document review pace.

What audio formats are supported?

The API supports mp3, wav, opus, flac, and pcm formats. Select the format via the 'response_format' field. MP3 is suitable for general use, while WAV or FLAC offer lossless quality for archival purposes. PCM provides raw audio data for custom processing.

How do I handle rate limits in my code?

The limit is 60 requests per minute per key. Before the first top-up, it is 10 requests per minute. Implement exponential backoff or queueing in your code to handle waits. Requests are processed sequentially, so under load, synthesis may queue.

What happens if the API returns an error?

Failed requests are free. If synthesis fails, the charge is returned in full. Check the response status code and error message to diagnose issues like invalid parameters or network errors. Retry logic should account for the 60 requests per minute limit.

Can I rotate my API key?

Yes, you can issue a new key at any time from your dashboard. The old key stops working immediately when the new one is activated. This ensures secure access management for your legal team without downtime, as you update your configuration.

Is the API key tied to a specific IP?

No, the API key is not tied to a specific IP address. You can use it from any location or server. The key authenticates your account for billing and usage tracking. Ensure you keep your key secure to prevent unauthorized usage.

How do I know if a request was successful?

A successful request returns an HTTP 200 status with the audio file in the response body. Check the status code and verify the audio file is present. Failed requests return an error code and do not incur charges.

Do I need to parse JSON for audio data?

No, the audio file is returned directly in the response body, not as JSON. You receive the raw audio bytes corresponding to your requested format. Parse JSON only if you need to handle error messages or metadata in the response headers.

First request

curl

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

Juridicore uses a single active API key per account, issued via the dashboard. This key authenticates all requests to the text-to-speech endpoint and must be kept secure within your legal infrastructure.

Keys are generated instantly upon account setup. You can revoke and reissue a key at any time via the dashboard; the previous key stops working immediately, ensuring tight control over access for large legal teams.

API Key Generation

API Key Generation

Sign in to your Juridicore dashboard to view your current key. It begins with tts-. One key is active per account, simplifying credential management for distributed legal departments without requiring complex IAM setups.

Bearer Token Usage

Bearer Token Usage

Include the key in the HTTP header as Authorization: Bearer tts-.... The API validates this token for every POST /v1/audio/speech request. Ensure the token is transmitted over HTTPS to protect sensitive legal text payloads during transit.

Key Rotation

Generate a new key from the dashboard at any time. The old key is invalidated immediately upon creation of the new one. This allows for zero-downtime rotation in your CI/CD pipelines or internal legal tech stacks without manual sync delays.

Quickstart with cURL

Sound wave illustration for: Quickstart with cURL

Generate legal audio directly from the command line. The following cURL command demonstrates a standard synthesis request for a contract excerpt, specifying the model, voice, and output format.

Basic Request Example

Execute this command to receive an MP3 file. Replace YOUR_API_KEY with your key from /get-api-key/.

  • ```bash
  • curl -X POST https://api.dk7h.cc/v1/audio/speech \
  • -H "Authorization: Bearer YOUR_API_KEY" \
  • -H "Content-Type: application/json" \
  • -d '{"model": "tts-1", "input": "The party of the first part agrees...", "voice": "sage", "response_format": "mp3"}' \
  • --output contract.mp3"
  • ```

Headers and Body

The request uses standard JSON. Include the Authorization header with your bearer token. The body defines the text (up to 4096 characters), the tts-1 or tts-1-hd model, and a voice preset like sage for instructional tone.

Response Handling

A successful response returns the audio binary directly. Save this output to a file. Failed requests return an error JSON and incur no charge.

Integration with OpenAI SDK

Sound wave illustration for: Integration with OpenAI SDK

The Juridicore API maintains full compatibility with the official OpenAI SDKs by mirroring the request shape of the OpenAI speech endpoint. This allows legal engineering teams to integrate TTS generation into existing Python or Node.js workflows with minimal code changes, simply by adjusting the base URL.

Authentication remains consistent with standard Bearer token practices. Your API key, issued upon account creation, is passed in the Authorization header, ensuring secure and auditable access for your legal tech stack.

Base URL Configuration

To direct requests to Juridicore’s TTS engine, override the default OpenAI base URL in your SDK client configuration. Set the base URL to https://api.dk7h.cc/v1. This single change routes all subsequent POST /v1/audio/speech calls to the correct endpoint without altering the rest of your code structure.

SDK Compatibility

The API supports the standard OpenAI Python and Node.js SDKs. Since the request payload structure is identical, you can use the same Speech object and parameters. This eliminates the need for custom HTTP clients or complex JSON serialization for standard legal document processing pipelines.

Code Examples

  • Initialize client with base_url="https://api.dk7h.cc/v1" and api_key="tts-..."
  • Use openai.Audio.speech.create() with standard model, input, and voice parameters
  • Receive binary audio data directly in the response body for immediate file saving

Request Parameters

Sound wave illustration for: Request Parameters

Configure the core synthesis behavior using specific parameters. The API accepts model, input, voice, response_format, speed, and an optional language code in the JSON request body sent to the speech endpoint.

Model Selection

Select tts-1 for standard processing or tts-1-hd for higher fidelity. Both models use the same engine and pricing structure, allowing you to choose based on quality needs without cost variation.

Voice Selection

Choose from eight presets. Use atlas for neutral news-style reading or milo for conversational briefs. Each voice supports all 23 languages, ensuring consistent tone across multinational contracts.

Speed and Language

Adjust speed between 0.25 and 4.0 to control generation rate. Set the language parameter explicitly (e.g., en, de) for non-English Latin text to prevent incorrect script guessing.

Response Formats

Sound wave illustration for: Response Formats

The API returns synthesized audio as binary data in the HTTP response body. Supported formats include MP3, WAV, OPUS, FLAC, and PCM. Choose the format that best fits your storage and playback requirements.

Audio Formats

Select your preferred output via the response_format parameter. MP3 is efficient for web delivery, while WAV and FLAC provide lossless quality for archival legal records. PCM is available for raw data processing.

Binary Response

The response body contains the raw audio bytes directly. There is no JSON wrapper for successful requests. Ensure your client handles binary data streams correctly without interpreting them as text.

Error Responses

Errors return a JSON object with a code and message field. Failed synthesis requests are free, and charges are reversed if applicable. Always check the HTTP status code to distinguish between client and server errors.

Response Formats

Rate Limits and Quotas

Sound wave illustration for: Rate Limits and Quotas

Rate limits are enforced per API key, not per account or IP. This ensures fair usage across all clients sharing the same key and prevents a single high-volume job from blocking others. Limits reset on a rolling one-minute window, providing predictable throughput for batch processing contracts or briefs.

Requests Per Minute

Standard accounts are limited to 60 requests per minute. Each request can process up to 4,096 characters. For large documents, split the text into chunks and process them sequentially or in parallel, keeping within the 60-request cap.

  • Limit: 60 requests/minute/key
  • Max input: 4,096 characters per request
  • Requests are processed sequentially under load

Pre-Payment Limits

New accounts without a top-up are restricted to 10 requests per minute. This limit applies until the first USDT transfer is confirmed. Once credited, the limit increases to the standard 60 requests per minute immediately.

  • Base limit: 10 requests/minute
  • Increases to 60 after first top-up
  • No minimum spend required

Handling Throttling

If you exceed the limit, the API returns a 429 Too Many Requests error. Implement exponential backoff in your integration to retry after a short delay. Avoid sending bursts of requests; spread them evenly to maintain steady audio generation.

  • Status code: 429
  • Recommended: Exponential backoff
  • Avoid burst requests

Error Codes

Sound wave illustration for: Error Codes

Understanding error responses ensures your legal audio generation pipeline remains robust. The API returns standard HTTP status codes to indicate the state of your request, allowing your system to distinguish between client mistakes and transient server issues.

Common Errors

A 400 Bad Request indicates invalid JSON, missing required fields, or text exceeding the 4,096-character limit. A 401 Unauthorized error occurs if the Bearer token is missing or invalid. A 429 Too Many Requests signals that you have exceeded your per-minute quota.

  • 400: Invalid input or character limit exceeded
  • 401: Invalid or missing API key
  • 429: Rate limit exceeded

Rate Limit Errors

New accounts start with a limit of 10 requests per minute. After the first top-up, this increases to 60 requests per minute. Exceeding these limits results in a 429 status code. Failed requests do not consume credits.

  • 10 req/min before first top-up
  • 60 req/min after top-up
  • Failed requests count toward limits

Retry Strategy

For 429 errors, implement exponential backoff. Wait for the duration specified in the Retry-After header if provided, otherwise start with a short delay and double it on each subsequent attempt. Avoid retrying 400 or 401 errors without adjusting the request parameters.

  • Use exponential backoff for 429 errors
  • Check Retry-After header
  • Do not retry 400/401 without changes

Voices and Languages

Sound wave illustration for: Voices and Languages

Juridicore’s TTS API supports 23 languages, including Hindi, with eight distinct voice presets. Any voice can articulate any supported language, ensuring consistent audio quality across diverse legal jurisdictions and international briefs. This flexibility allows legal teams to standardize their audio output regardless of the source document's language.

Available Voices

Eight presets cover various tones. Use atlas for neutral news-style readings, aria for clear narration, or milo for conversational briefings. Each voice is derived from licensed recordings, providing a professional baseline for contract reviews.

  • atlas (neutral, news)
  • aria (warm, clear narrator)
  • milo (friendly, conversational)
  • nova (bright, upbeat)
  • sage (calm, instructional)
  • luna (soft, storytelling)

Language Support

The API handles 23 languages, including English, German, French, and Spanish. If the language field is omitted, the system guesses the language from the script, defaulting to English for Latin text. For non-English Latin-script documents, explicitly set the language parameter to avoid misidentification.

  • Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Turkish

Hindi Specifics

Hindi is fully supported with high accuracy. When processing Hindi legal texts, set the language parameter to hi to ensure correct pronunciation and intonation. Any of the eight voices can render Hindi text, allowing you to select the tone that best fits your firm’s style guide.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Voices can speak any supported language regardless of the voice's origin.

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. LibriTTS-R corpus (OpenSLR 141)
  3. LibriTTS-R paper (arXiv 2305.18802)
  4. Python documentation
  5. openai-node on GitHub
  6. FFmpeg documentation
  7. TRON developer hub: TRC-20
  8. Tether (USDT)
  9. Node.js documentation
  10. Creative Commons Attribution 4.0
  11. MDN: Web Speech API
  12. curl documentation

More on this site