API Documentation for Text-to-Speech Integration

By JilaKorp Editorial Team · Updated 2026-11-18

This documentation outlines the integration steps for JilaKorp’s text-to-speech API, designed for transport and logistics teams managing multi-lingual announcements. It covers authentication, endpoint structures, and request parameters required to generate audio files for airport, rail, and fleet systems.

Readers will find precise specifications for voice selection, language handling, and rate limits, alongside ready-to-use code examples in cURL, Python, and Node.js. The guide ensures reliable, auditable synthetic voice outputs via a simple HTTP API, compatible with standard OpenAI SDKs.

API Documentation for Text-to-Speech Integration

Frequently asked questions

How do I authenticate with the API?

Include your API key in the request header as Authorization: Bearer tts-.... You receive one active key per account. If you issue a new key, the previous one stops immediately. This ensures strict access control for your transport and logistics infrastructure without requiring complex OAuth flows.

Does the API support SSML tags?

No, the API does not support SSML. You send plain text in the input field. The system processes the text directly without markup interpretation. This keeps the integration simple and reliable for automated announcement systems that do not require granular prosody control via XML tags.

What is the maximum input length?

The maximum input length is 4096 characters per request. Spaces and punctuation count toward this limit. For longer announcements, you must split the text into chunks of up to 4096 characters, generate audio for each, and join the resulting audio files in your application logic.

Can I stream audio in real-time?

No, the API does not support streaming or WebSocket connections. You send a POST request and receive the complete audio file in the response. Requests are processed sequentially, so under load, a request may wait in a queue before synthesis begins and completes.

How do I set the language to Hindi?

Include the language field with the ISO code hi in your JSON request body. Although the system guesses language from the script, explicitly setting it ensures accurate synthesis for Hindi. Any of the eight voices can speak Hindi when this parameter is provided.

What happens if I exceed the rate limit?

The limit is 60 requests per minute per key (10 per minute before the first top-up). Exceeding this may cause delays as requests wait in a queue. Failed requests are free, but successful ones consume your character balance. Monitor your usage to maintain throughput.

Is there a mobile SDK available?

No, there is no official mobile SDK. You can use the official OpenAI SDKs by changing the base_url to https://api.jilikapk.com/v1 and providing your site's key. Alternatively, you can use any standard HTTP client to send JSON requests and receive audio files.

Do I need a custom voice for Hindi?

No, custom voice cloning is not offered. You can use any of the eight preset voices (e.g., Aria, Nova, Felix) to speak Hindi. All voices support all 23 listed languages, including Hindi, without requiring additional configuration or custom training for specific linguistic nuances.

How do I handle long text announcements?

Split your text into parts of up to 4096 characters. Send each part as a separate request to the /v1/audio/speech endpoint. Then, join the returned audio files in your application. This approach ensures compliance with input limits while delivering continuous audio for long announcements.

Are audio files stored after generation?

No, generated audio is returned in the response and not stored by the system. Input text is used only to produce the audio and is not used for training. Request metadata (time, characters, status) is kept for billing purposes only.

Can I use the OpenAI SDK with this API?

Yes, the request shape matches the OpenAI speech endpoint. Use the official OpenAI SDKs by changing the base_url to https://api.jilikapk.com/v1 and using your site's API key. This allows you to leverage existing OpenAI client libraries for integration with your logistics systems.

What is the difference between tts-1 and tts-1-hd?

Both models use the same engine and have the same price. The model field accepts either tts-1 or tts-1-hd. There is no functional or pricing difference between them in this API. You can choose either based on your preference or compatibility requirements.

How do I rotate my API key?

Issue a new key from your account dashboard. When a new key is issued, the old one stops working immediately. This ensures that only the current key is active. You can rotate keys anytime to maintain security without downtime, as long as you update your client configuration.

Is there a webhook for completion notifications?

No, there is no webhook for completion notifications. The API is synchronous; you receive the audio file directly in the response after the request completes. If you need asynchronous processing, you must manage the request lifecycle and polling in your own application logic.

First request

curl

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

The JilaKorp TTS API authenticates every request using a Bearer token. Include your API key in the HTTP header as Authorization: Bearer <key>. The key format is tts- followed by alphanumeric characters.

Bearer Token Format

Bearer Token Format

Send the token in the Authorization header for all endpoints. The system validates the key before processing any speech synthesis or metadata requests.

Key Issuance

Key Issuance

Generate your key on the /get-api-key/ page after signing in via Google or email. Each account receives one active key, displayed alongside your balance and usage metrics.

Key Rotation

Issue a new key at any time via the dashboard. The previous key becomes invalid immediately upon generation of the new one, ensuring strict access control for your logistics team.

Note that key changes are instant. Ensure your integration updates the header value promptly to avoid 401 errors during announcements.

Endpoint Overview

Sound wave illustration for: Endpoint Overview

The core synthesis endpoint accepts text and returns audio files. Metadata endpoints list available voices, models, and format options for system integration.

All endpoints require Bearer authentication. Use the OpenAI SDK or standard HTTP libraries for requests.

POST /v1/audio/speech

Send text to generate audio. The API returns an audio file in the requested format. Input is limited to 4096 characters per request.

  • Endpoint: POST https://api.jilikapk.com/v1/audio/speech
  • Returns: Audio file (mp3, wav, opus, flac, pcm)
  • Auth: Bearer token required

GET /v1/voices

Retrieve the list of 8 available voice presets. Use this endpoint to identify voice IDs for synthesis requests.

  • Endpoint: GET https://api.jilikapk.com/v1/voices
  • Returns: List of voices, languages, and formats
  • Use: Select voice ID for POST requests

GET /v1/models

List available models. Currently supports "tts-1" and "tts-1-hd", which share the same engine and pricing.

  • Endpoint: GET https://api.jilikapk.com/v1/models
  • Returns: Available model identifiers
  • Note: Both models use the same engine

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts plain text input with a strict maximum of 4096 characters per request. Spaces and punctuation are counted toward this limit. For announcements exceeding this length, split the text into segments and concatenate the resulting audio files.

Input Text Limit

Each request processes up to 4096 characters. Exceeding this limit returns an error. Split long multi-lingual announcements into multiple requests to ensure successful synthesis.

Voice Selection

Select from eight preset voices optimized for clear announcement delivery. Male voices include atlas for neutral news or milo for conversational updates. Female voices offer aria for narration or luna for storytelling. Each voice supports all 23 supported languages without modification.

  • atlas: neutral, news-style delivery
  • milos: friendly, conversational tone
  • aria: warm, clear narration
  • luna: soft, storytelling style

Response Formats

Specify the output audio format via the response_format field. Supported formats include mp3, wav, opus, flac, and pcm. Choose mp3 or opus for efficient storage and transmission. Use wav or flac for lossless quality in legacy systems. PCM provides raw uncompressed data for direct playback integration.

Language Configuration

Sound wave illustration for: Language Configuration

To ensure accurate synthetic voice output for multi-lingual transport announcements, specify the target language using an ISO 639-1 code in the request body. This is critical when the input text uses Latin script but is not English, as the system defaults to English for Latin characters.

ISO Code Specification

Pass the language field (e.g., "de" for German, "fr" for French) to override default detection. Supported languages include Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, and Turkish. Any of the 8 voice presets can speak any of these languages.

  • Supported: Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Turkish.
  • Not supported: Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, Bengali.

Auto-Detection Logic

If the language field is omitted, the API guesses the language from the text script. Text in Latin script defaults to English. For non-English Latin-script text (e.g., a Dutch announcement), you must explicitly set the language parameter to avoid incorrect pronunciation.

Hindi Script Handling

Devanagari script (used for Hindi) is correctly identified without an explicit language parameter. However, for consistency in large-scale logistics systems, we recommend explicitly passing "hi" to ensure deterministic behavior across all announcement queues.

Speed & Formatting

Sound wave illustration for: Speed & Formatting

Adjust voice pacing to match operational tempo using the speed parameter, which accepts values between 0.25 and 4.0. This allows precise synchronization of announcements across large transport networks, ensuring clarity in noisy environments without altering the selected voice preset.

Speed Multiplier Range

Set the speed field in your request body to control playback rate. Values below 1.0 slow the delivery, while values above 1.0 accelerate it. This is critical for ensuring legibility in high-traffic rail or airport terminals where background noise may obscure standard-paced speech.

Audio Format Options

Select the output format using the response_format parameter. Supported formats include mp3, wav, opus, flac, and pcm. Choose MP3 for efficient bandwidth usage in fleet management systems, or WAV for high-fidelity playback in station PA systems where lossless quality is required for consistent audio standards.

  • mp3: Optimized for network efficiency
  • wav: Uncompressed for high-quality playback
  • opus: Efficient compressed format
  • flac: Lossless compressed audio

PCM Raw Data

Use PCM for raw, uncompressed audio data, ideal for direct integration with hardware audio interfaces or legacy transport announcement systems. This format bypasses compression artifacts, ensuring the synthetic voice output remains consistent with the source engine’s raw generation. Note that PCM files are larger, so plan storage accordingly for large-scale deployments.

Speed & Formatting

Rate Limits

Sound wave illustration for: Rate Limits

The API enforces a standard rate limit of 60 requests per minute per key for active accounts. This capacity is sufficient for most batch processing workflows, though long texts may require splitting into 4096-character chunks, which counts as multiple requests.

60 Requests Per Minute

Each API key allows up to 60 requests per minute. Since each request handles up to 4096 characters, this limit applies per key. Ensure your integration respects this ceiling to avoid rejection.

Initial 10 RPM Limit

New accounts start with a lower limit of 10 requests per minute. This restricts usage until the first top-up is processed. Once a minimum $5 USDT transfer is confirmed, the limit increases to the standard 60 RPM.

Queue Behavior

Requests are processed sequentially. Under heavy load, a request may wait in a queue before synthesis begins. Short phrases may take a few seconds to generate, while longer texts approach real-time speed.

Error Handling

Sound wave illustration for: Error Handling

Reliable audio generation for transport announcements requires precise error handling. This section outlines how the API signals failures and how your system should respond to maintain consistent fleet or station communication workflows.

HTTP Status Codes

The API returns standard HTTP status codes to indicate request success or failure. A 200 OK response confirms audio generation. Use 4xx codes for client errors, such as invalid API keys or unsupported parameters.

Retry Logic

Implement exponential backoff for transient 5xx server errors. Do not retry immediately, as requests are processed sequentially. If a queue builds under load, wait progressively longer between attempts to avoid overwhelming the endpoint.

Character Limit Errors

Each request accepts up to 4096 characters. Exceeding this limit returns a 400 error. Split longer announcements into chunks, generate audio for each, and concatenate the files in your application logic before playback.

Code Examples

Sound wave illustration for: Code Examples

The following examples demonstrate direct integration with the JilaKorp TTS API using standard HTTP requests and the OpenAI-compatible SDKs. Each snippet targets the https://api.jilikapk.com/v1 base URL, ensuring compatibility with existing transport management workflows without requiring custom client libraries.

Code blocks below show minimal requests for generating MP3 audio from text input. Adjust the model, voice, and input fields according to your announcement requirements. Note that the response format must be explicitly defined in the payload to avoid default behavior issues.

Curl Command

Use this command to generate an MP3 file directly from the terminal. Replace YOUR_API_KEY with your bearer token from the dashboard.

```bash curl -X POST https://api.jilikapk.com/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "voice": "sage", "input": "Gate 5 is now open.", "response_format": "mp3"}' \ -o announcement.mp3 ```

  • Ensure the API key has sufficient balance before execution.
  • The output file is saved as announcement.mp3 in the current directory.

OpenAI SDK Python

Install the official OpenAI SDK and configure the base URL to point to JilaKorp’s endpoint. This approach is suitable for backend services processing announcement queues.

```python from openai import OpenAI client = OpenAI( base_url="https://api.jilikapk.com/v1", api_key="YOUR_API_KEY" ) audio = client.audio.speech.create( model="tts-1", voice="sage", input="Gate 5 is now open.", response_format="mp3" ) audio.stream_to_file("announcement.mp3") ```

  • Set base_url to the JilaKorp API endpoint.
  • Specify response_format to ensure consistent audio output.

OpenAI SDK Node.js

For Node.js environments, initialize the client with the same base URL structure. This example streams the audio directly to a file for immediate playback in fleet management systems.

```javascript import OpenAI from 'openai'; const client = new OpenAI({ baseURL: 'https://api.jilikapk.com/v1', apiKey: 'YOUR_API_KEY' }); const audio = await client.audio.speech.create({ model: "tts-1", voice: "sage", input: "Gate 5 is now open.", response_format: "mp3" }); await audio.streamToFile('announcement.mp3'); ```

  • Use the streamToFile method for efficient memory usage.
  • Ensure the openai package version is compatible with the SDK interface.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. No complex infrastructure, no proprietary SDKs to install, and no custom voice cloning contracts to manage.

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. openai-node on GitHub
  4. LibriVox public-domain audiobooks
  5. openai-python on GitHub
  6. Creative Commons Attribution 4.0
  7. Python documentation
  8. ISO 639 language codes
  9. FFmpeg documentation
  10. Node.js documentation
  11. IETF RFC 7845: Ogg Opus
  12. TRON developer hub: TRC-20

More on this site