Esc to close · ⌘K / Ctrl-K opens search anywhere
One /v1/embeddings endpoint — first-party bge-m3 at ₹1/Mtok stays in India, or bring your own key for OpenAI, Gemini and Cohere embeddings.
/v1/embeddingsAccessBeginner6 min
Retrieval, clustering and semantic search all start with embeddings. BharatRouter serves them through the same OpenAI /v1/embeddings shape — so any client that already calls OpenAI embeddings just points at the gateway and picks a model.
You'll use: the /v1/embeddings endpoint. First-party bge-m3 is multilingual (strong on Indic text) and India-resident.
from openai import OpenAI
client = OpenAI(base_url="https://api.bharatrouter.com/v1", api_key="br-...")
r = client.embeddings.create(
model="bge-m3", # first-party, ₹1/Mtok, India-resident
input=["order not delivered", "where is my package"],
)
vecs = [d.embedding for d in r.data]
print(len(vecs), "vectors of dim", len(vecs[0]))| Model | Provider | Residency | Notes |
|---|---|---|---|
bge-m3 | BharatRouter (first-party) | 🇮🇳 India | Multilingual, ₹1/Mtok — the default |
text-embedding-3-small / -large | OpenAI | Global | BYOK |
gemini-embedding-2 | Global | BYOK | |
embed-v4.0 | Cohere | Global | BYOK |
optimize, data_policy and per-request upstream_key all apply, and a BYOK route falls back to the platform model only for engines BR serves on its own infra.data_policy: "india_only" on and only bge-m3 stays eligible — so a residency-pinned RAG pipeline never sends document text offshore.Pair this with a fallback chain and residency pinning for a fully India-resident RAG stack — see Guarantee no prompt leaves India.
More recipes in the Cookbook, or see the fullAPI reference.