Skip to main content

Palabra API Overview

Real-time speech translation

Add Palabra's world-class translation to your app in minutes with our intuitive API and ready-made client libraries

import asyncio
import time
from palabra_ai import Palabra, Transcript, Audio

CHUNK_MS = 320 # ~320 ms of PCM (s16le, 24 kHz, mono)

async def main():
palabra = Palabra()

async with palabra.translation(source="en", targets=["es"]) as session:

async def send_audio():
next_send = time.monotonic()
while chunk := await audio_buffer.get(): # your audio source
await session.send_audio(chunk)
next_send += CHUNK_MS / 1000
await asyncio.sleep(max(0, next_send - time.monotonic()))
await session.end(eos_timeout=4)

sender = asyncio.create_task(send_audio())

async for event in session:
match event:
case Transcript():
print(event)
case Audio():
play(event.pcm)

await sender

asyncio.run(main())
Python Palabra SDK

Overview

The Palabra API enables real-time speech translation across multiple languages, helping your users communicate clearly and efficiently. With easy integration for both client- and server-side apps, Palabra fits seamlessly into any business workflow.

Features

Live Demo

Supported Languages

The Palabra API supports a wide range of languages for speech recognition and translation, as listed below:

Loading...

View the full language table for detailed language codes and additional information.

Next steps

API Clients

Palabra API