YERE
DOCS_INIT // v1.1.0

Developer Documentation

Integrate sovereign African language models directly into your applications via our low-latency, fractionally-billed local compute APIs.

API Authentication

Authenticate requests by sending your key in the header. Generate keys in the Developer Hub. The platform validates tokens server-side in constant time before queuing ML tasks.

HTTP Header
Authorization: Bearer yr_live_your_secret_api_key

Fractional Billing

Yere operates on a strict, mathematically precise usage economy. You are billed fractionally—meaning you only pay for the exact milliseconds of audio or characters of text processed.

ASR Transcription
2.0 CR
Per 60 seconds of audio processed
Text Translation
1.0 CR
Per 1,000 characters translated
Speech Synthesis (TTS)
3.0 CR
Per 1,000 characters voiced
Gemma Chat LLM
0.5 CR
Per 1,000 characters generated
Developer Trust Policy
  • Zero Waste: A 6-second audio clip costs exactly 0.2 CR, not 2.0 CR.
  • Failed Requests: If a network timeout or 500 error occurs, 0 credits are deducted.
  • Minimums: The minimum charge for any successful request is 0.01 CR to prevent floating-point anomalies.
  • Auditability: Every API call generates a transparent receipt in your Developer Ledger.

Audio Transcription

POST /api/transcribe

Accepts binary audio files (mp3, wav, m4a, webm) and runs Whisper inference locally to output highly accurate text. Billed at 2.0 CR per minute of audio payload.

Python
import requests

url = "https://api.yere.ai/api/transcribe"
headers = {"Authorization": "Bearer yr_live_..."}
files = {"file": open("speech.wav", "rb")}
data = {"language": "sw"} # Optional, defaults to "sw"

res = requests.post(url, headers=headers, files=files, data=data)
print(res.json())

Text Translation

POST /api/translate

Translates text using custom-trained M2M-100 adapters for Swahili, Kikuyu, Dholuo, Maasai, Yoruba, Zulu, Somali, and English.

Javascript
const response = await fetch("https://api.yere.ai/api/translate", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer yr_live_..."
  },
  body: JSON.stringify({
    text: "Habari gani rafiki yetu?",
    src_lang: "sw",
    tgt_lang: "en"
  })
});

const result = await response.json();
console.log(result.translated_text);

Speech Synthesis

POST /api/voice

Generates high-fidelity voicing for any language target. Returns a direct binary streaming response of `audio/wav` formatted as 16kHz PCM data.

cURL
curl -X POST https://api.yere.ai/api/voice \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer yr_live_..." \
  -d '{"text": "Welcome to Yere.", "lang": "en"}' \
  --output response_speech.wav

Model Pipeline Chaining

POST /api/chain

Chain Transcribe, Translate, and Synthesize together sequentially without data ever leaving the GPU state. Billed automatically based on the sum of operations performed.

Python
import requests

url = "https://api.yere.ai/api/chain"
headers = {"Authorization": "Bearer yr_live_..."}
files = {"file": open("swahili_audio.wav", "rb")}

# Note: This endpoint expects Multipart Form Data, NOT raw JSON!
data = {
    "project_id": "proj_123", # Links usage to a specific workspace
    "src_lang": "sw",
    "tgt_lang": "en",
    "actions_str": "transcribe,translate,voice",
    "output_form": "both"
}

res = requests.post(url, headers=headers, files=files, data=data)
output = res.json()

print("Translated:", output["text_output"])