India API

Docs › Language and text

Embeddings and reranking API

Vectors for semantic search in Indian languages and English, and a reranker to order results.

For retrieval (RAG) and search without an API key: turn text into 384 numbers with multilingual-e5-small, so texts that mean the same land close together across about a hundred languages, Hindi, Tamil and the other Indian languages among them; then let bge-reranker-v2-m3 read the query with each candidate and order them. Nothing you send is kept or logged.

Base URL https://api.dharun.devNo API key600 requests a minuteThis page as Markdown

Text embeddings

GET/v1/embedPOST

Up to 64 texts a request (GET: one or more text parameters; POST: JSON {"texts": [...], "type": ...}). Each comes back as 384 numbers scaled to length 1, so a dot product is the cosine similarity. Embed questions with type=query and the documents searched with type=passage, as the model was trained. Each text is read up to 512 tokens.

Also takes POST: JSON: {"texts": ["..."], "type": "query" or "passage"}, or {"text": "..."}. Send it as text/plain, or as JSON {"text": "..."} with the other options beside it, up to 256 KB.

What you send here is never written to the log, and the answer is not cached.

ParameterDescription
textqueryA text; repeat for several (or POST them).
typequeryquery (default) for questions, passage for the documents searched. One of: query, passage.

curl

curl "https://api.dharun.dev/v1/embed?type=query&text=How+do+I+renew+my+passport%3F"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/embed?type=query&text=How+do+I+renew+my+passport%3F");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/embed?type=query&text=How+do+I+renew+my+passport%3F", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])

Response, with lists and long text shortened

{
  "data": {
    "model": "multilingual-e5-small",
    "type": "query",
    "dimensions": 384,
    "embeddings": [
      [
        0.056168,
        -0.053384,
        -0.02612
      ]
    ],
    "tokens": [
      14
    ],
    "truncated": []
  },
  "meta": {
    "source": {
      "name": "multilingual-e5-small (int8)",
      "url": "https://huggingface.co/intfloat/multilingual-e5-small",
      "licence": "MIT",
      "version": "multilingual-e5-small@614241f",
      "retrieved": "2026-10-15T12:28:44Z",
      "attribution": "Embeddings by multilingual-e5-small (Wang et al., Multilingual E5 Text Embeddings, 2024), MIT."
    },
    "note": "Each embedding is normalised to length 1, so the dot product of two is their cosine similarity. Embed questions with type=query and the documents searched with …"
  }
}

Rerank documents for a query

GET/v1/rerankPOST

Scores how well each document answers the query, from 0 to 1, and returns them best first with their place in the request. Up to 100 documents of up to 8,000 characters; each pair is read up to 512 tokens. GET takes query and repeated document parameters; POST takes JSON.

Also takes POST: JSON: {"query": "...", "documents": ["...", "..."], "top": 3}. Send it as text/plain, or as JSON {"text": "..."} with the other options beside it, up to 256 KB.

What you send here is never written to the log, and the answer is not cached.

ParameterDescription
queryquery, requiredThe question, up to 2,000 characters.
documentqueryA candidate; repeat for each (or POST them).
topqueryReturn only the best few. Default all.

curl

curl "https://api.dharun.dev/v1/rerank?query=capital+of+Tamil+Nadu&document=Chennai+is+the+capital+of+Tamil+Nadu.&document=Mumbai+is+the+financial+capital+of+India."

JavaScript

const response = await fetch("https://api.dharun.dev/v1/rerank?query=capital+of+Tamil+Nadu&document=Chennai+is+the+capital+of+Tamil+Nadu.&document=Mumbai+is+the+financial+capital+of+India.");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/rerank?query=capital+of+Tamil+Nadu&document=Chennai+is+the+capital+of+Tamil+Nadu.&document=Mumbai+is+the+financial+capital+of+India.", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])

Data source

multilingual-e5-small (int8), multilingual-e5-small@614241f. Retrieved 2026-10-15T12:28:44Z. Licence: MIT. Embeddings by multilingual-e5-small (Wang et al., Multilingual E5 Text Embeddings, 2024), MIT.

Using an AI assistant? Connect the MCP server and it can call this API by itself.