Base URL: https://api.bodhan.ai/v1 · Auth: Authorization: Bearer <your key>
Keys are per model. To rotate one, delete it and make a new one.
The /v1 routes keep the OpenAI request and response shapes, so the SDK you
already use works once its base URL points at Bodhan.
from openai import OpenAI
client = OpenAI(
base_url="https://api.bodhan.ai/v1",
api_key="YOUR_BODHAN_KEY",
)
# Translation
r = client.chat.completions.create(
model="indic-translate",
messages=[{"role": "user", "content": "Good morning"}],
extra_body={"source_language_code": "en", "target_language_code": "te"},
)
# Speech to text
t = client.audio.transcriptions.create(
model="indic-transcribe", file=open("lesson.wav", "rb"),
)
# Document OCR: a page image in, Markdown in reading order out
o = client.chat.completions.create(
model="indic-ocr",
messages=[{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "data:image/png;base64,..."}},
]}],
)
print(o.choices[0].message.content)
For OCR, the reference has the full response
shape and the layout blocks it returns.
Or with curl:
curl https://api.bodhan.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_BODHAN_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"indic-translate","messages":[{"role":"user","content":"Welcome"}],"source_language_code":"en","target_language_code":"hi"}'
Limits
Each key has a requests-per-minute allowance on its model:
| Model |
Requests per minute |
indic-translate |
8 |
indic-transcribe |
8 |
indic-ocr |
4 |
indic-speak |
4 |
Over the allowance you get HTTP 429 with a retry-after header saying how
many seconds until a slot frees up; the window slides. Running out of credit
also returns 429, with a different message. If you need more throughput,
write to support.