API Reference
Integrate Morlivo translation and transcription into your application with a few lines of code.
https://api.morlivo.ai
Auth: Authorization: Bearer mrl_...
Authentication
All API requests require a Bearer token. Get your API key from the dashboard under Settings.
Authorization: Bearer mrl_your_api_key_here
API keys start with mrl_. Keep them secret. Rotate them from the dashboard if compromised.
/v1/translate
Translate text from one language to another. Source language is auto-detected if omitted.
Request body JSON
| Field | Type | Required | Description |
|---|---|---|---|
text | string | yes | Text to translate |
target_language | string | yes | ISO 639-1 code (e.g. es, fr, de) |
source_language | string | no | Auto-detected if omitted |
project_id | integer | no | Apply project glossary and style |
formality | string | no | Register: formal, informal, or default |
Response 200
| Field | Type | Description |
|---|---|---|
translated_text | string | The translated text |
source_language | string | Detected or provided source language |
target_language | string | Target language code |
confidence | float | Quality score 0.0 - 1.0 |
validation | object | Quality validation results |
Examples
curl -X POST https://api.morlivo.ai/api/v1/translate \
-H "Authorization: Bearer mrl_your_key" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, world!",
"target_language": "es"
}'
import httpx
resp = httpx.post(
"https://api.morlivo.ai/api/v1/translate",
headers={"Authorization": "Bearer mrl_your_key"},
json={
"text": "Hello, world!",
"target_language": "es",
},
)
data = resp.json()
print(data["translated_text"])
# → "¡Hola, mundo!"
const resp = await fetch(
"https://api.morlivo.ai/api/v1/translate",
{
method: "POST",
headers: {
"Authorization": "Bearer mrl_your_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Hello, world!",
target_language: "es",
}),
}
);
const data = await resp.json();
console.log(data.translated_text);
// → "¡Hola, mundo!"
{
"translated_text": "¡Hola, mundo!",
"source_language": "en",
"target_language": "es",
"confidence": 0.98,
"validation": {
"length_ratio": 1.08,
"language_match": true,
"passed": true
}
}
/v1/transcribe
Transcribe an audio or video file to text. Supports up to 100 MB.
Request body multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
file | file | yes | Audio/video file (mp3, wav, mp4, webm, etc.) |
language | string | no | ISO code, auto-detected if omitted |
project_id | integer | no | Link to a project for tracking |
response_format | string | no | Output format: json, verbose_json, text, srt, vtt |
punctuate | boolean | no | Include punctuation (default true) |
Response 200
| Field | Type | Description |
|---|---|---|
text | string | Full transcribed text |
language | string | Detected language |
duration_seconds | float | Audio duration |
confidence | float | Quality score 0.0 - 1.0 |
language_confidence | float | Confidence of auto-detected language (null if language was specified) |
segments | array | Timestamped segments |
validation | object | Quality checks |
Examples
curl -X POST https://api.morlivo.ai/api/v1/transcribe \
-H "Authorization: Bearer mrl_your_key" \
-F "file=@meeting.mp3" \
-F "language=en"
import httpx
with open("meeting.mp3", "rb") as f:
resp = httpx.post(
"https://api.morlivo.ai/api/v1/transcribe",
headers={"Authorization": "Bearer mrl_your_key"},
files={"file": ("meeting.mp3", f, "audio/mpeg")},
data={"language": "en"},
)
data = resp.json()
print(data["text"])
{
"text": "Welcome everyone to today's meeting...",
"language": "en",
"duration_seconds": 342.5,
"confidence": 0.95,
"language_confidence": 0.95,
"segments": [
{"start": 0.0, "end": 3.2, "text": "Welcome everyone"},
{"start": 3.2, "end": 6.8, "text": "to today's meeting."}
],
"validation": {
"words_per_minute": 148,
"repetition_detected": false,
"passed": true
}
}
/v1/live/transcribe
Stream audio in real-time and receive live transcription results.
Connection
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | yes | API key as query parameter |
language | string | no | Source language hint (e.g. en, fr). Auto-detected if omitted. |
Protocol
Binary PCM audio frames (16-bit, 16kHz mono)
JSON messages with type field: transcript (partial/final text), status (session events), error
Messages received
| Field | Type | Description |
|---|---|---|
type | string | "transcript" | "status" | "error" |
text | string | Transcribed text (on transcript messages) |
is_final | boolean | True when segment is complete |
language | string | Detected language code |
Examples
const ws = new WebSocket(
"wss://live.morlivo.ai/v1/live/transcribe?token=mrl_your_key&language=en"
);
navigator.mediaDevices.getUserMedia({ audio: true })
.then(stream => {
const ctx = new AudioContext({ sampleRate: 16000 });
const source = ctx.createMediaStreamSource(stream);
const processor = ctx.createScriptProcessor(4096, 1, 1);
source.connect(processor);
processor.connect(ctx.destination);
processor.onaudioprocess = (e) => {
const pcm = e.inputBuffer.getChannelData(0);
const int16 = new Int16Array(pcm.length);
for (let i = 0; i < pcm.length; i++)
int16[i] = Math.max(-1, Math.min(1, pcm[i])) * 0x7FFF;
ws.send(int16.buffer);
};
});
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.type === "transcript") {
console.log(msg.is_final ? "FINAL:" : "partial:", msg.text);
}
};
import asyncio, json, websockets
async def live_transcribe():
uri = "wss://live.morlivo.ai/v1/live/transcribe?token=mrl_your_key"
async with websockets.connect(uri) as ws:
# Send audio chunks (PCM 16-bit 16kHz mono)
with open("audio.pcm", "rb") as f:
while chunk := f.read(4096):
await ws.send(chunk)
msg = json.loads(await ws.recv())
if msg["type"] == "transcript":
print(msg["text"], end="\r" if not msg["is_final"] else "\n")
asyncio.run(live_transcribe())
// Session started
{"type": "status", "message": "session_started"}
// Partial transcript (still speaking)
{"type": "transcript", "text": "Hello every", "is_final": false}
// Final transcript (segment complete)
{"type": "transcript", "text": "Hello everyone, welcome to the meeting.",
"is_final": true, "language": "en"}
// Session ended
{"type": "status", "message": "session_ended",
"duration_seconds": 45.2}
/v1/live/translate
Stream audio in one language and receive translated text in another language in real-time. Supports speech-to-text translation with automatic language detection.
Connection
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | yes | API key as query parameter |
target_language | string | yes | Language for output text (e.g. en, es, fr) |
source_language | string | no | Source audio language. Auto-detected if omitted. |
Protocol
Binary PCM audio frames (16-bit, 16kHz mono)
JSON messages with translated text in target_language. Includes both transcript of original speech and translated output.
Messages received
| Field | Type | Description |
|---|---|---|
type | string | "transcript" | "status" | "error" |
text | string | Translated text in target language |
is_final | boolean | True when segment is complete |
source_language | string | Detected source language |
target_language | string | Target language code |
Examples
const ws = new WebSocket(
"wss://live.morlivo.ai/v1/live/translate" +
"?token=mrl_your_key&target_language=es&source_language=en"
);
// Stream microphone audio (same setup as live transcribe)
// ...
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.type === "transcript" && msg.is_final) {
console.log(`[${msg.source_language} → ${msg.target_language}]`);
console.log(msg.text);
}
};
import asyncio, json, websockets
async def live_translate():
uri = (
"wss://live.morlivo.ai/v1/live/translate"
"?token=mrl_your_key"
"&source_language=fr&target_language=en"
)
async with websockets.connect(uri) as ws:
with open("french_audio.pcm", "rb") as f:
while chunk := f.read(4096):
await ws.send(chunk)
msg = json.loads(await ws.recv())
if msg["type"] == "transcript" and msg["is_final"]:
print(f"Translation: {msg['text']}")
asyncio.run(live_translate())
// Partial translation
{"type": "transcript", "text": "Hello every",
"is_final": false, "source_language": "fr", "target_language": "en"}
// Final translated segment
{"type": "transcript",
"text": "Hello everyone, welcome to the meeting.",
"is_final": true,
"source_language": "fr", "target_language": "en"}
// Session summary
{"type": "status", "message": "session_ended",
"duration_seconds": 120.5}
/v1/live/rooms
Create a multi-participant translation room. Each participant speaks their own language and receives translated text from other participants.
Request body JSON
| Field | Type | Required | Description |
|---|---|---|---|
languages | object | yes | Participant ID to language mapping |
bridge_language | string | no | Hub language, default en |
max_participants | int | no | Max participants 2-10, default 10 |
mode | string | no | interpreter or inline |
Response 200
| Field | Type | Description |
|---|---|---|
room_id | string | Unique room identifier |
status | string | Room status |
languages | object | Participant ID to language mapping |
bridge_language | string | Hub language used for translation |
mode | string | Translation mode |
max_participants | int | Maximum number of participants |
Examples
curl -X POST https://api.morlivo.ai/api/v1/live/rooms \
-H "Authorization: Bearer mrl_your_key" \
-H "Content-Type: application/json" \
-d '{
"languages": {"alice": "en", "bob": "fr", "carlos": "es"},
"bridge_language": "en",
"mode": "interpreter"
}'
{
"room_id": "room_abc123",
"status": "active",
"languages": {"alice": "en", "bob": "fr", "carlos": "es"},
"bridge_language": "en",
"mode": "interpreter",
"max_participants": 10
}
/v1/live/speech/{room_id}
Connect a participant to a room for real-time speech translation.
Connection
| Parameter | Type | Required | Description |
|---|---|---|---|
room_id | string | yes | Room ID from create room response (path param) |
participant | string | yes | Participant ID (query param) |
token | string | yes | API key as query parameter |
Example
const ws = new WebSocket(
"wss://live.morlivo.ai/v1/live/speech/room_abc123" +
"?token=mrl_your_key&participant=alice"
);
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.type === "transcript" && msg.is_final) {
console.log(`[${msg.source_language} → ${msg.target_language}]`);
console.log(msg.text);
}
};
/v1/live/rooms/{room_id}/participants
Add a participant to an existing room after creation.
Request body JSON
| Field | Type | Required | Description |
|---|---|---|---|
participant_id | string | yes | Unique participant identifier |
language | string | yes | Participant's language code |
Example
curl -X POST https://api.morlivo.ai/api/v1/live/rooms/room_abc123/participants \
-H "Authorization: Bearer mrl_your_key" \
-H "Content-Type: application/json" \
-d '{
"participant_id": "diana",
"language": "de"
}'
/v1/languages
List all supported languages with locale, name, and availability status.
Response 200
| Field | Type | Description |
|---|---|---|
languages | array | List of supported languages |
languages[].locale | string | Locale code e.g. fr-CA |
languages[].name | string | English name |
languages[].native_name | string | Native name |
languages[].country | string | Country/region |
languages[].status | string | ga or beta |
Example
curl https://api.morlivo.ai/api/v1/languages \
-H "Authorization: Bearer mrl_your_key"
{
"languages": [
{"locale": "en-US", "name": "English", "native_name": "English", "country": "United States", "status": "ga"},
{"locale": "fr-CA", "name": "French", "native_name": "Français", "country": "Canada", "status": "ga"},
{"locale": "sw-KE", "name": "Swahili", "native_name": "Kiswahili", "country": "Kenya", "status": "beta"}
]
}
/v1/health
Check API status and database health. No authentication required.
Response 200
| Field | Type | Description |
|---|---|---|
status | string | healthy or degraded |
Example
curl https://api.morlivo.ai/api/v1/health
{
"status": "healthy"
}
Compatibility Endpoints
Already using another provider? Change one URL and keep your existing code. These endpoints mirror the request and response formats of major translation and transcription APIs.
DeepL
TranslationPOST /api/compat/deepl/v2/translate
Drop-in replacement for api-free.deepl.com
Google Cloud Translation
TranslationPOST /api/compat/google/v3/projects/{"{p}"}/locations/{"{l}"}:translateText
Drop-in replacement for translation.googleapis.com
AWS Translate
TranslationPOST /api/compat/aws/translate
Drop-in replacement for translate.amazonaws.com
OpenAI Whisper
TranscriptionPOST /api/compat/openai/v1/audio/transcriptions
Drop-in replacement for api.openai.com
Deepgram
TranscriptionPOST /api/compat/deepgram/v1/listen
Drop-in replacement for api.deepgram.com
Compatibility endpoints accept the same request format and return the same response structure as the original provider. Refer to each provider's documentation for their request/response schemas.
Errors
All errors return a JSON object with a detail field.
| Code | Meaning | When it happens |
|---|---|---|
| 400 | Bad Request | Missing required fields, empty text, unsupported file type |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | API key valid but insufficient permissions or quota exceeded |
| 413 | Payload Too Large | File exceeds 100 MB upload limit |
| 429 | Rate Limited | Too many requests. Retry with exponential backoff. |
| 500 | Internal Error | Unexpected server error. Contact support if it persists. |
| 503 | Service Unavailable | AI model temporarily unavailable (circuit breaker open). Retry shortly. |
{
"detail": "Field 'text' must not be empty."
}
PII Redaction
Add PII redaction to any translation or transcription request. Specify which entity types to detect and redact.
Request body JSON
| Field | Type | Required | Description |
|---|---|---|---|
text | string | yes | Text to translate |
source_language | string | no | Auto-detected if omitted |
target_language | string | yes | ISO 639-1 code (e.g. es, fr, de) |
redact | string[] | no | Entity types to redact (e.g. email, phone, name) |
Response 200
| Field | Type | Description |
|---|---|---|
translated_text | string | Translated text with PII redacted |
source_language | string | Detected or provided source language |
target_language | string | Target language code |
confidence | float | Quality score 0.0 - 1.0 |
redactions | array | List of redactions applied (type and replacement) |
Examples
curl -X POST https://api.morlivo.ai/api/v1/translate \
-H "Authorization: Bearer mrl_your_key" \
-H "Content-Type: application/json" \
-d '{
"text": "Contact John Smith at john@example.com or 555-123-4567",
"source_language": "en",
"target_language": "fr",
"redact": ["email", "phone", "name"]
}'
import httpx
resp = httpx.post(
"https://api.morlivo.ai/api/v1/translate",
headers={"Authorization": "Bearer mrl_your_key"},
json={
"text": "Contact John Smith at john@example.com or 555-123-4567",
"source_language": "en",
"target_language": "fr",
"redact": ["email", "phone", "name"],
},
)
data = resp.json()
print(data["translated_text"])
# → "Contactez [NAME_REDACTED] à [EMAIL_REDACTED] ou [PHONE_REDACTED]"
const resp = await fetch(
"https://api.morlivo.ai/api/v1/translate",
{
method: "POST",
headers: {
"Authorization": "Bearer mrl_your_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Contact John Smith at john@example.com or 555-123-4567",
source_language: "en",
target_language: "fr",
redact: ["email", "phone", "name"],
}),
}
);
const data = await resp.json();
console.log(data.translated_text);
// → "Contactez [NAME_REDACTED] à [EMAIL_REDACTED] ou [PHONE_REDACTED]"
{
"translated_text": "Contactez [NAME_REDACTED] à [EMAIL_REDACTED] ou [PHONE_REDACTED]",
"source_language": "en",
"target_language": "fr",
"confidence": 0.95,
"redactions": [
{"type": "name", "replacement": "[NAME_REDACTED]"},
{"type": "email", "replacement": "[EMAIL_REDACTED]"},
{"type": "phone", "replacement": "[PHONE_REDACTED]"}
]
}
Supported Entity Types
| Entity | Description | Detection |
|---|---|---|
email |
Email addresses | Pattern-based (included) |
phone |
Phone numbers | Pattern-based (included) |
ssn |
Social Security numbers | Pattern-based (included) |
credit_card |
Credit card numbers | Pattern-based (included) |
ip_address |
IP addresses | Pattern-based (included) |
name |
Person names | AI-powered (additional cost) |
address |
Physical addresses | AI-powered (additional cost) |
medical |
Medical information | AI-powered (additional cost) |
Format-based entities (email, phone, SSN, credit card, IP) are detected using pattern matching at no additional cost. Contextual entities (name, address, medical) use AI-powered detection and incur a small additional charge per request.
Ready to integrate?
Create a free account to get your API key and start translating.