{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kurdishtts-com/json-schema/kurdishtts-com-tts-request-schema.json",
  "title": "TtsRequest",
  "x-generated": "2026-11-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kurdishtts-com-openapi.json#/components/schemas/TtsRequest",
  "type": "object",
  "required": [
    "text",
    "speaker_id"
  ],
  "properties": {
    "text": {
      "type": "string",
      "description": "Text to synthesize. Max 500 chars on the free plan, 5000 on paid plans.",
      "maxLength": 5000
    },
    "speaker_id": {
      "type": "string",
      "description": "Voice id from /api/get-speakers, e.g. `sorani_85` or `kurmanji_6` in the default v3 group. The dialect is derived from the prefix. Groups share no IDs — pass the same `model_version` here and to /api/get-speakers. Free plans render only sorani_85, sorani_214, kurmanji_6, kurmanji_12 on v3 (sorani_1, sorani_986, kurmanji_236, kurmanji_233 on v4), plus badini_story_m and badini_narrator_f on v5 — the only v5 ids a free key may render."
    },
    "dialect": {
      "type": "string",
      "enum": [
        "sorani",
        "kurmanji",
        "badini"
      ],
      "description": "Reading language. Inferred from the speaker_id prefix when it has one, so send it only for the Cast and Studio speakers, which have none. A Cast or Studio speaker paired with badini is refused with a 400."
    },
    "model_version": {
      "type": "string",
      "enum": [
        "v3",
        "v4",
        "v5"
      ],
      "default": "v3",
      "description": "Speaker group the speaker_id is resolved in; not a model or engine choice. Every value renders on V5. The v5 group requires a paid API plan, except the two free Badini voices; its Cast and Studio speakers require a plan bought for the API. A badini_ id always resolves on v5 whatever you send here, because it exists in no other group."
    },
    "include_timestamps": {
      "type": "boolean",
      "default": false,
      "description": "When true, return JSON with base64 audio + word-level timestamps instead of audio/wav."
    },
    "format": {
      "type": "string",
      "enum": [
        "wav",
        "opus",
        "mp3"
      ],
      "default": "wav",
      "description": "Container for the binary audio response. `wav` = 24 kHz PCM WAV; `opus` = Ogg/Opus at 24 kHz (`audio/ogg`, roughly 10–15× smaller than WAV, ideal for mobile data); `mp3` = 24 kHz MP3 (`audio/mpeg`). Ignored when `include_timestamps` is true — that response is JSON with base64 PCM."
    },
    "speed": {
      "type": "number",
      "minimum": 0.25,
      "maximum": 4.0,
      "description": "Playback speed, industry convention (higher = faster). Clamped to 0.25–4.0."
    },
    "temperature": {
      "type": "number",
      "description": "Optional generation control forwarded to V5. Omit for the engine default; mutually exclusive with `stability`."
    },
    "stability": {
      "type": "number",
      "description": "Optional compatibility control; mutually exclusive with `temperature`."
    },
    "top_p": {
      "type": "number",
      "description": "Optional advanced generation control forwarded to V5."
    },
    "repetition_penalty": {
      "type": "number",
      "description": "Optional advanced generation control forwarded to V5."
    },
    "seed": {
      "type": "integer",
      "description": "Optional reproducibility control."
    },
    "pitch": {
      "type": "number",
      "description": "Post-processing pitch shift."
    },
    "silence_trim": {
      "type": "boolean",
      "description": "Post-processing: trim leading/trailing silence."
    },
    "chunk_max_seconds": {
      "type": "number",
      "description": "Optional maximum seconds per synthesis chunk."
    },
    "sentence_silence_ms": {
      "type": "integer",
      "description": "Optional silence inserted between sentences, in milliseconds."
    }
  }
}