⚡ New — Kimi K3 is live: bring your own Moonshot key →
Documentation

Audio — speech

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.

▶ Try the Audio playground

Speech to text

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=json

Fields: file and model are required; language,prompt, temperature and response_format are optional.response_format controls the reply shape:

response_formatReply
json (default){ "text": "..." }
textPlain text body (text/plain).
verbose_jsonFull 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)

Text to speech

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.mp3

Notes

  • Streaming. Transcription supports stream=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.
  • Bidirectional streaming (WebSocket). For the lowest latency — speaking textas it is generated (e.g. piping LLM tokens) — connect a WebSocket towss://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).
  • Routed & failed-over. Audio is a routed modality like chat: first-party Parakeet/Kokoro on the platform key plus your BYOK vendors (OpenAI, Groq, Sarvam, ElevenLabs). Use 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).
  • Pricing is on the catalog: ASR ₹0.5/minute, TTS ₹50 per 1M characters.
  • Both endpoints take a standard API key — see API keys & limits.