Esc to close · ⌘K / Ctrl-K opens search anywhere
BharatRouter serves audio the same way it serves chat: one API key, the OpenAI wire format, INR pricing. Both audio models are first-party andIndia-resident — served on the platform key, no BYOK needed: transcription with Parakeet, synthesis with Kokoro. The route that served the request is echoed in the x-br-provider response header.
POST /v1/audio/transcriptions — OpenAI-compatible multipart upload. Modelparakeet. Audio file up to 25 MB(mp3/wav/m4a/webm and the usual formats). Billed at ₹0.5 / minute of audio at per-second granularity (1 second minimum).
curl https://api.bharatrouter.com/v1/audio/transcriptions \
-H "Authorization: Bearer br-..." \
-F [email protected] \
-F model=parakeet \
-F response_format=jsonFields: file and model are required; language,prompt, temperature and response_format are optional.response_format controls the reply shape:
| response_format | Reply |
|---|---|
json (default) | { "text": "..." } |
text | Plain text body (text/plain). |
verbose_json | Full object with text, language, duration and segments. |
from openai import OpenAI
client = OpenAI(base_url="https://api.bharatrouter.com/v1", api_key="br-...")
with open("call.mp3", "rb") as f:
r = client.audio.transcriptions.create(model="parakeet", file=f)
print(r.text)POST /v1/audio/speech — JSON body. Model kokoro, multilingual voices incl. Hindi. Billed at ₹50 per 1 million input characters. The reply is raw audio bytes; response_format selects the container (mp3 default, plus wav, opus,flac).
curl https://api.bharatrouter.com/v1/audio/speech \
-H "Authorization: Bearer br-..." -H "Content-Type: application/json" \
-d '{
"model": "kokoro",
"input": "India runs on BharatRouter.",
"response_format": "mp3"
}' --output hello.mp3stream=true (multipart field) and returns Server-Sent Events — transcript.text.delta partials then a final transcript.text.done. Speech supports "stream": true (JSON field): audio is sent over chunked transfer as it synthesises (ElevenLabs /stream, OpenAI/Kokoro) so you start playback before the full clip lands. Sarvam's REST TTS buffers the whole clip and returns x-br-stream: buffered so you know the difference.wss://api.bharatrouter.com/v1/audio/speech/stream. Config goes in the query (?model=eleven-tts&voice=…&language=hi); auth via the usual key header, or?access_token= from a browser. Send JSON frames{"type":"text","text":"…"} (repeatable), {"type":"flush"}, then{"type":"end"}; the server streams back binary audio frames as they synthesise and a final {"type":"done","chars":N}. Backed by ElevenLabs (BYOK) — the one vendor with true text-in streaming; for Kokoro/OpenAI/Sarvam use HTTP stream:trueabove. Errors are explicit {"type":"error","message":…} frames (no silent fallback).model: "asr"/"tts" with optimize and let it pick + fail over across providers, or pin a concrete model. A failover substitute keeps an equivalent voice profile. The same metering and credit debits apply (trial keys stay free; BYOK calls bill on your provider key).