Docs / Language and text
Small LLM (English) API
Summarise, classify, extract to JSON and rewrite English text with a small open model, and an OpenAI-compatible chat.
A small language model (Qwen 2.5 1.5B Instruct, Apache-2.0) that runs on this server, for narrow tasks where its answer is forced into shape: a summary, a label from your list, fields as JSON that match your schema, a rewrite. And /v1/chat/completions in OpenAI's format, so code and tools written for that API work by changing the base URL to https://api.dharun.dev/v1. English only: it was measured and is not good enough in Hindi or Tamil. It can be wrong; check what matters. Nothing you send is logged or kept. Needs a free API key; each key has 100,000 tokens a day (prompt and answer).
https://api.dharun.devNo key needed for most600 units a minute, 3000 with a free keyThis page as MarkdownSummarise English text
POST/v1/llm/summarise
Send {text, style, words}: style paragraph (default), bullets or headline; words the length, 10 to 300 (default 60). Up to 12,000 characters. Answers {summary, style, truncated, usage}.
Send: A JSON document as below.
Needs a free API key, sent as Authorization: Bearer <key> or X-API-Key, from the start. With a key: 500 model requests and 100,000 tokens a day.
What you send here is never written to the log, and the answer is not cached.
curl
curl -H "Content-Type: application/json" --data '{"text": "The Reserve Bank of India kept the repo rate unchanged at 5.5 per cent on Wednesday. The Monetary Policy Committee voted unanimously and said inflation was within the target band, while growth stayed strong.", "style": "headline"}' "https://api.dharun.dev/v1/llm/summarise?utm_medium=docs"JavaScript
const response = await fetch("https://api.dharun.dev/v1/llm/summarise?utm_medium=docs", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({"text": "The Reserve Bank of India kept the repo rate unchanged at 5.5 per cent on Wednesday. The Monetary Policy Committee voted unanimously and said inflation was within the target band, while growth stayed strong.", "style": "headline"}),
});
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);Python
import requests
response = requests.post("https://api.dharun.dev/v1/llm/summarise?utm_medium=docs", data="{\"text\": \"The Reserve Bank of India kept the repo rate unchanged at 5.5 per cent on Wednesday. The Monetary Policy Committee voted unanimously and said inflation was within the target band, while growth stayed strong.\", \"style\": \"headline\"}", headers={"Content-Type": "application/json"}, timeout=60)
body = response.json()
if not response.ok:
raise RuntimeError(body["error"]["message"])
print(body["data"])invoice.json
{"text": "The Reserve Bank of India kept the repo rate unchanged at 5.5 per cent on Wednesday. The Monetary Policy Committee voted unanimously and said inflation was within the target band, while growth stayed strong.", "style": "headline"}Try it here
Change the values and send the request from your browser. Needs JavaScript.
Pick a label for a text from your list
POST/v1/llm/classify
Send {text, labels, multi, instructions}: 2 to 30 labels; the answer is always one of them (label), or with multi true every one that fits (labels). instructions may say what the labels mean.
Send: A JSON document as below.
Needs a free API key, sent as Authorization: Bearer <key> or X-API-Key, from the start. With a key: 500 model requests and 100,000 tokens a day.
What you send here is never written to the log, and the answer is not cached.
curl
curl -H "Content-Type: application/json" --data '{"text": "The delivery came two days late and the box was torn.", "labels": ["positive", "negative", "neutral"]}' "https://api.dharun.dev/v1/llm/classify?utm_medium=docs"JavaScript
const response = await fetch("https://api.dharun.dev/v1/llm/classify?utm_medium=docs", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({"text": "The delivery came two days late and the box was torn.", "labels": ["positive", "negative", "neutral"]}),
});
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);Python
import requests
response = requests.post("https://api.dharun.dev/v1/llm/classify?utm_medium=docs", data="{\"text\": \"The delivery came two days late and the box was torn.\", \"labels\": [\"positive\", \"negative\", \"neutral\"]}", headers={"Content-Type": "application/json"}, timeout=60)
body = response.json()
if not response.ok:
raise RuntimeError(body["error"]["message"])
print(body["data"])invoice.json
{"text": "The delivery came two days late and the box was torn.", "labels": ["positive", "negative", "neutral"]}Try it here
Change the values and send the request from your browser. Needs JavaScript.
Extract fields from text as JSON
POST/v1/llm/extract
Send {text, fields} (up to 40 names, each answered as a string) or {text, schema} (a JSON Schema of type object, up to 8 KB). The answer's data always matches the schema: decoding is constrained to it. Anything the text does not say comes back empty.
Send: A JSON document as below.
Needs a free API key, sent as Authorization: Bearer <key> or X-API-Key, from the start. With a key: 500 model requests and 100,000 tokens a day.
What you send here is never written to the log, and the answer is not cached.
curl
curl -H "Content-Type: application/json" --data '{"text": "Hi, I am Ravi Kumar from Coimbatore, call me on 98765 43210 about the 2 BHK flat.", "fields": ["name", "city", "phone", "requirement"]}' "https://api.dharun.dev/v1/llm/extract?utm_medium=docs"JavaScript
const response = await fetch("https://api.dharun.dev/v1/llm/extract?utm_medium=docs", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({"text": "Hi, I am Ravi Kumar from Coimbatore, call me on 98765 43210 about the 2 BHK flat.", "fields": ["name", "city", "phone", "requirement"]}),
});
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);Python
import requests
response = requests.post("https://api.dharun.dev/v1/llm/extract?utm_medium=docs", data="{\"text\": \"Hi, I am Ravi Kumar from Coimbatore, call me on 98765 43210 about the 2 BHK flat.\", \"fields\": [\"name\", \"city\", \"phone\", \"requirement\"]}", headers={"Content-Type": "application/json"}, timeout=60)
body = response.json()
if not response.ok:
raise RuntimeError(body["error"]["message"])
print(body["data"])invoice.json
{"text": "Hi, I am Ravi Kumar from Coimbatore, call me on 98765 43210 about the 2 BHK flat.", "fields": ["name", "city", "phone", "requirement"]}Try it here
Change the values and send the request from your browser. Needs JavaScript.
Rewrite text in another tone
POST/v1/llm/rewrite
Send {text, style}: style formal, simple, polite, shorter, friendly or grammar (the default: fix grammar and spelling only). Up to 4,000 characters.
Send: A JSON document as below.
Needs a free API key, sent as Authorization: Bearer <key> or X-API-Key, from the start. With a key: 500 model requests and 100,000 tokens a day.
What you send here is never written to the log, and the answer is not cached.
curl
curl -H "Content-Type: application/json" --data '{"text": "pls send the documents asap we are waiting since monday", "style": "polite"}' "https://api.dharun.dev/v1/llm/rewrite?utm_medium=docs"JavaScript
const response = await fetch("https://api.dharun.dev/v1/llm/rewrite?utm_medium=docs", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({"text": "pls send the documents asap we are waiting since monday", "style": "polite"}),
});
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);Python
import requests
response = requests.post("https://api.dharun.dev/v1/llm/rewrite?utm_medium=docs", data="{\"text\": \"pls send the documents asap we are waiting since monday\", \"style\": \"polite\"}", headers={"Content-Type": "application/json"}, timeout=60)
body = response.json()
if not response.ok:
raise RuntimeError(body["error"]["message"])
print(body["data"])invoice.json
{"text": "pls send the documents asap we are waiting since monday", "style": "polite"}Try it here
Change the values and send the request from your browser. Needs JavaScript.
Chat, OpenAI-compatible
POST/v1/chat/completions
OpenAI's chat completions request and answer (not this API's envelope): messages, max_tokens up to 1,024 (default 512), temperature, top_p, stop, seed, response_format (json_object or json_schema) and stream (server-sent events). The window is 4,096 tokens; messages up to 16,000 characters. No tools, images or audio. Any model name is accepted.
Send: A JSON document as below.
The answer is in OpenAI's own JSON shape, not this API's { data, meta } envelope; errors are JSON as everywhere else.
Needs a free API key, sent as Authorization: Bearer <key> or X-API-Key, from the start. With a key: 500 model requests and 100,000 tokens a day.
What you send here is never written to the log, and the answer is not cached.
curl
curl -H "Content-Type: application/json" --data '{"model": "qwen2.5-1.5b-instruct", "messages": [{"role": "user", "content": "Write a two-line welcome message for a food delivery app."}], "max_tokens": 80}' -o out.png "https://api.dharun.dev/v1/chat/completions?utm_medium=docs"JavaScript
const response = await fetch("https://api.dharun.dev/v1/chat/completions?utm_medium=docs", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: "{\"model\": \"qwen2.5-1.5b-instruct\", \"messages\": [{\"role\": \"user\", \"content\": \"Write a two-line welcome message for a food delivery app.\"}], \"max_tokens\": 80}",
});
if (!response.ok) throw new Error((await response.json()).error.message);
const file = await response.blob();Python
import requests
response = requests.post("https://api.dharun.dev/v1/chat/completions?utm_medium=docs", data="{\"model\": \"qwen2.5-1.5b-instruct\", \"messages\": [{\"role\": \"user\", \"content\": \"Write a two-line welcome message for a food delivery app.\"}], \"max_tokens\": 80}", headers={"Content-Type": "application/json"}, timeout=60)
if not response.ok:
raise RuntimeError(response.json()["error"]["message"])
open("out.png", "wb").write(response.content)invoice.json
{"model": "qwen2.5-1.5b-instruct", "messages": [{"role": "user", "content": "Write a two-line welcome message for a food delivery app."}], "max_tokens": 80}Try it here
Change the values and send the request from your browser. Needs JavaScript.
The model list, for OpenAI clients
GET/v1/models
OpenAI's model list with the one model, for clients that ask before they chat.
The answer is in OpenAI's own JSON shape, not this API's { data, meta } envelope; errors are JSON as everywhere else.
curl
curl -o out.png "https://api.dharun.dev/v1/models?utm_medium=docs"Python
import requests
response = requests.get("https://api.dharun.dev/v1/models?utm_medium=docs", timeout=60)
response.raise_for_status()
open("out.png", "wb").write(response.content)Try it here
Change the values and send the request from your browser. Needs JavaScript.
Data source
Qwen2.5-1.5B-Instruct (4-bit GGUF, Q4_K_M), qwen2.5-1.5b-instruct-q4_k_m@91cad51. Retrieved 2026-11-12T17:29:28Z. Licence: Apache-2.0. Text generated by Qwen2.5-1.5B-Instruct (Qwen team, Alibaba Cloud), Apache-2.0, run with llama.cpp (MIT).
Guides
Using an AI assistant? Connect the MCP server and it can call this API by itself. Want every endpoint on one bench? Open the playground.