Vulavula Logo
Overview

Code Examples

Everything on this page is runnable: quick snippets you can paste into a terminal or script, and complete example applications you can clone and adapt.

Before you start

You'll need an API key from vulavula.lelapa.ai — see Authentication. Every account includes 100 free API calls per month, so you can run all of these examples without a paid plan.

Quick snippets

Transcribe an audio file

Send an audio file and get the transcript back in the same request. Language codes are optional — leave lang_code out and our language ID picks the most probable language. See the Speech-to-Text guide for supported formats and the full response shape.

Code
import requests with open("recording.wav", "rb") as f: response = requests.post( "https://api.lelapa.ai/v1/transcribe/sync", headers={"X-CLIENT-TOKEN": "<YOUR_API_KEY>"}, files={"file": ("recording.wav", f, "audio/wav")}, params={"lang_code": "zul", "diarise": 1}, # optional ) print(response.json()["transcription_text"])

Translate text

Translate between English and a growing set of African languages. All language codes are listed on the Language Support page.

Code
import requests response = requests.post( "https://api.lelapa.ai/v1/translate/process", headers={"X-CLIENT-TOKEN": "<YOUR_API_KEY>"}, json={ "input_text": "Lo musho ubhalwe ngesiZulu.", "source_lang": "zul_Latn", "target_lang": "eng_Latn", }, ) print(response.json()["translation"][0]["translated_text"])

Example applications

Complete, standalone projects from the Lelapa-AI/vulavula-examples repository. Each has its own README with setup and run instructions.

To run them locally:

TerminalCode
git clone https://github.com/Lelapa-AI/vulavula-examples.git cd vulavula-examples

Keep going

  • Need streaming instead of request/response? See the Live API
  • Skip the raw HTTP calls with the Python SDK
  • Browse every endpoint, parameter, and response in the API Reference
  • Join our Discord community to share what you're building & connect with our team
Last modified on