Convert Kurdish Text to Speech in Your App

This tutorial takes you from zero to a playable Kurdish WAV file in about ten lines of code. It works for both Sorani (Arabic script) and Kurmanji (Latin script), using the same HTTP API that powers kurdishtts.com — no SDK required, any language that can make an HTTP request works.

Step 1 — Get a free TTS API key

Create a free account at kurdishtts.com and generate a TTS key in Settings → API. The free tier includes 20,000 characters — billing is per character of input text. Keep the key server-side; never ship it in client code.

Step 2 — Make the request

One POST to /api/tts-proxy with your text and a voice id. The response body is the WAV audio. curl:

curl -X POST https://www.kurdishtts.com/api/tts-proxy \
  -H "x-api-key: YOUR_TTS_KEY" \
  -H "content-type: application/json" \
  -d '{"text": "سڵاو، چۆنی؟", "speaker_id": "sorani_85"}' \
  --output hello.wav

Python:

import requests

resp = requests.post(
    "https://www.kurdishtts.com/api/tts-proxy",
    headers={"x-api-key": "YOUR_TTS_KEY"},
    json={"text": "سڵاو، چۆنی؟", "speaker_id": "sorani_85"},
)
resp.raise_for_status()

with open("hello.wav", "wb") as f:
    f.write(resp.content)
print("Saved hello.wav")

JavaScript (Node 18+):

import { writeFile } from "node:fs/promises";

const resp = await fetch("https://www.kurdishtts.com/api/tts-proxy", {
  method: "POST",
  headers: {
    "x-api-key": process.env.KURDISHTTS_TTS_KEY,
    "content-type": "application/json",
  },
  body: JSON.stringify({ text: "سڵاو، چۆنی؟", speaker_id: "sorani_85" }),
});
if (!resp.ok) throw new Error(await resp.text());

await writeFile("hello.wav", Buffer.from(await resp.arrayBuffer()));
console.log("Saved hello.wav");

Play hello.wav — you should hear «سڵاو، چۆنی؟» (“Hello, how are you?”) in a natural Sorani voice.

Step 3 — Pick a voice

The voice catalog is public — no key needed. Dialect is derived from the id prefix (sorani_ / kurmanji_):

curl "https://www.kurdishtts.com/api/get-speakers?model_version=v3"

On the free tier use sorani_85, sorani_214, kurmanji_6 or kurmanji_12. Paid plans unlock the full library — up to 664 voices on the v4 model (pass "model_version": "v4").

Useful options & limits

  • speed (0.25–4, higher = faster) and include_timestamps (returns JSON with word-level timings + base64 audio) — full parameters in the API reference.
  • Max text per request: 500 characters free, 5,000 on paid plans. When the quota runs out the API returns 403 with an upgrade link — see pricing.
  • Building with an AI agent instead of code? Connect the MCP server to Claude.