Docs / Language and text

Speech API

Speech to text, text to speech in Hindi, Telugu, Malayalam and English, and noise removal.

Turn a recording into text (and subtitles) with Whisper, turn text into natural speech with Piper voices, or clean background noise from a recording with DeepFilterNet. Each voice keeps the licence of the recordings it learnt from: /v1/tts/voices lists them, and two Hindi voices are for non-commercial use only. There is no Tamil, Kannada, Bengali, Gujarati or Marathi voice yet. Nothing you send is kept or logged.

Base URL https://api.dharun.devNo key needed for most600 units a minute, 3000 with a free keyThis page as Markdown

Speech to text, with subtitles

POST/v1/stt

Send a recording (MP3, WAV, Ogg, M4A, WebM, video files too) and get the text with timed segments, as JSON, SRT or WebVTT subtitles, or plain text. Whisper small recognises about a hundred languages, Indian ones included; it is good on clear English and fair on Indian languages. task=translate gives English text whatever was spoken. The first five minutes are heard. Options go in the query string, or as form fields when the file is sent as multipart/form-data.

Send: An audio or video file, up to 10 MB. Post the file as the request body, or as multipart/form-data. Try it with this sample.

Model endpoint: it will need a free API key, sent as Authorization: Bearer <key> or X-API-Key. Until the date on API keys it answers without one and says so in the X-Key-Notice header. With a key: 500 model requests a day.

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

ParameterDescription
languagequeryauto (default) or the language spoken: en, hi, ta, te, kn, ml, mr, bn, gu, pa, ur, as, ne, sa, sd, or, ar, fr, de, es, zh, ja. Naming it helps on short clips.
taskquerytranscribe (default) writes what was said; translate writes it in English. One of: transcribe, translate.
formatqueryDefault json. One of: json, srt, vtt, text.

curl

# a sample to try: https://api.dharun.dev/samples/speech.mp3
curl -F "[email protected]" "https://api.dharun.dev/v1/stt?utm_medium=docs"

JavaScript

// input is an <input type="file"> element
const form = new FormData();
form.append("file", input.files[0]);
const response = await fetch("https://api.dharun.dev/v1/stt?utm_medium=docs", { method: "POST", body: form });
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

files = [("file", open("speech.mp3", "rb"))]
response = requests.post("https://api.dharun.dev/v1/stt?utm_medium=docs", files=files, timeout=90)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Text to speech

GET/v1/ttsPOST

Returns the audio itself; X-Voice and X-Voice-Licence headers name the voice and its licence. Up to 3,000 characters; split longer text. Write the text in its own script: Hindi in Devanagari, Telugu in Telugu, Malayalam in Malayalam.

Also takes POST: The text to speak. Send it as text/plain, or as JSON {"text": "..."} with the other options beside it, up to 256 KB.

The answer returns the audio itself; errors are JSON as everywhere else.

Model endpoint: it will need a free API key, sent as Authorization: Bearer <key> or X-API-Key. Until the date on API keys it answers without one and says so in the X-Key-Notice header. With a key: 500 model requests a day.

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

ParameterDescription
textqueryWhat to say (or POST it).
voicequeryA voice ID from /v1/tts/voices, or a language (hi, te, ml, en, en-GB) for its first voice that may be used commercially. Default en.
formatqueryDefault mp3. One of: mp3, ogg, wav.
speedquery0.5 to 2. Default 1.

curl

curl -o speech.mp3 "https://api.dharun.dev/v1/tts?text=Namaste%2C%20welcome%20to%20India%20API.&voice=en_GB-cori-medium&utm_medium=docs"

Python

import requests

response = requests.get("https://api.dharun.dev/v1/tts?text=Namaste%2C%20welcome%20to%20India%20API.&voice=en_GB-cori-medium&utm_medium=docs", timeout=60)
response.raise_for_status()
open("speech.mp3", "wb").write(response.content)

HTML

<audio controls src="https://api.dharun.dev/v1/tts?text=Namaste%2C%20welcome%20to%20India%20API.&amp;voice=en_GB-cori-medium&amp;utm_medium=docs"></audio>
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Voices

GET/v1/tts/voices

Every voice with its language, speaker, licence and the credit the licence asks for.

curl

curl "https://api.dharun.dev/v1/tts/voices?utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/tts/voices?utm_medium=docs");
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/tts/voices?utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Response, with lists and long text shortened

{
  "data": [
    {
      "id": "en_US-ljspeech-medium",
      "language": "en-US",
      "name": "English (US)",
      "speaker": "LJ",
      "licence": "Public domain (LJ Speech)",
      "licence_url": "https://keithito.com/LJ-Speech-Dataset/",
      "attribution": "Trained on the LJ Speech dataset by Keith Ito, in the public domain.",
      "non_commercial": false
    },
    {
      "id": "en_GB-cori-medium",
      "language": "en-GB",
      "name": "English (UK)",
      "speaker": "Cori",
      "licence": "Public domain (LibriVox)",
      "licence_url": "https://librivox.org/pages/public-domain/",
      "attribution": "Trained on public-domain LibriVox recordings read by Cori Samuel.",
      "non_commercial": false
    },
    {
      "id": "hi_IN-rohan-medium",
      "language": "hi-IN",
      "name": "Hindi",
      "speaker": "Rohan",
      "licence": "IIT Madras Indic TTS licence: royalty-free, may be redistributed, notice kept",
      "licence_url": "https://www.iitm.ac.in/donlab/indictts/downloads/license.pdf",
      "attribution": "Trained on the Indic TTS database of IIT Madras. COPYRIGHT 2016 TTS Consortium, TDIL, Meity represented by Hema A Murthy & S Umesh, DEPARTMENT OF Computer Scien…",
      "non_commercial": false
    }
  ],
  "meta": {
    "total": 10,
    "source": {
      "name": "Piper voices",
      "url": "https://huggingface.co/rhasspy/piper-voices",
      "licence": "Each voice keeps its training data's licence, named with every answer",
      "version": "piper-voices@c10ece1a/10",
      "retrieved": "2026-10-14T20:48:57Z",
      "attribution": "Speech by Piper (MIT) with voices from rhasspy/piper-voices."
    },
    "note": "Piper has no Tamil, Kannada, Bengali, Gujarati or working Marathi voice yet. Voices marked non_commercial may not be used for commercial work."
  }
}

Remove background noise

POST/v1/audio/denoise

Send a recording (MP3, WAV, Ogg, M4A, WebM, video files too) and get it back with fans, traffic and hum lowered, as mono 48 kHz. The first five minutes are cleaned. Options go in the query string, or as form fields when the file is sent as multipart/form-data.

Send: An audio or video file, up to 10 MB. Post the file as the request body, or as multipart/form-data. Try it with this sample.

The answer returns the audio itself; errors are JSON as everywhere else.

Model endpoint: it will need a free API key, sent as Authorization: Bearer <key> or X-API-Key. Until the date on API keys it answers without one and says so in the X-Key-Notice header. With a key: 500 model requests a day.

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

ParameterDescription
formatqueryDefault mp3. One of: mp3, ogg, wav.
limitqueryThe most noise is lowered by, in decibels, 6 to 100. Lower values sound more natural. Default 100.

curl

# a sample to try: https://api.dharun.dev/samples/noisy.mp3
curl -F "[email protected]" -o clean.mp3 "https://api.dharun.dev/v1/audio/denoise?utm_medium=docs"

JavaScript

// input is an <input type="file"> element
const form = new FormData();
form.append("file", input.files[0]);
const response = await fetch("https://api.dharun.dev/v1/audio/denoise?utm_medium=docs", { method: "POST", body: form });
if (!response.ok) throw new Error((await response.json()).error.message);
const file = await response.blob();

Python

import requests

files = [("file", open("noisy.mp3", "rb"))]
response = requests.post("https://api.dharun.dev/v1/audio/denoise?utm_medium=docs", files=files, timeout=90)
if not response.ok:
    raise RuntimeError(response.json()["error"]["message"])
open("clean.mp3", "wb").write(response.content)
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Data source

Piper voices, piper-voices@c10ece1a/10. Retrieved 2026-10-14T20:48:57Z. Licence: Each voice keeps its training data's licence, named with every answer. Speech by Piper (MIT) with voices from rhasspy/piper-voices.

Whisper small (5-bit, whisper.cpp), whisper-small-q5_1@5359861. Retrieved 2026-10-15T12:28:44Z. Licence: MIT. Speech recognition by OpenAI Whisper small (MIT), run with whisper.cpp (MIT).

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.