Mazdek AI Text-to-Speech (TTS) API

Generate speech from text: native Kurmancî and Soranî voices (1220+) or the multilingual engine (32 languages). Short text: POST /api/tts/generate (synchronous). Long text: POST /api/tts/jobs (async, split and stitched). Live limits: GET /api/tts/limits.

GitHub OpenAPI

Operations 10

GET /api/tts/voices List Kurmancî Voices #
GET /api/tts/samples/{voice_id} Preview Voice Sample #
POST /api/tts/generate Generate Kurmancî Speech #
GET /api/tts/multilingual/voices List Multilingual Voices #
POST /api/tts/stream Stream Speech #
POST /api/tts/jobs Create Long TTS Job #
GET /api/tts/jobs/{tts_job_id} Get TTS Job #
GET /api/tts/jobs/{tts_job_id}/stream TTS Job Progress (SSE) #
POST /api/tts/jobs/{tts_job_id}/cancel Cancel TTS Job #
GET /api/tts/limits TTS Limits #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mazdek-ai:mazdek-ai-text-to-speech-tts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mazdek-ai-text-to-speech-tts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: mazdek AI Text-to-Speech (TTS) API
  version: '2026-11-16'
  description: 'Complete API collection for mazdek AI — Kurdish-first speech recognition, text-to-speech, chat, translation, spell checking, video clips and songs.


    Setup:

    1. Import this collection into Postman

    2. Set the `api_key` variable to your API key (Settings › API › Create API Key)

    3. Optionally change `base_url` if self-hosting


    Auth: `Authorization: Bearer mazdek_sk_…`. Creating a key needs at least $5 of lifetime credit top-ups (or received gifts); up to 10 active keys per account.


    Billing: API-key requests are billed per unit from your credit balance (live rates: GET /api/keys/rates) — never from the plan quota, and with no daily request cap. Your monthly spending limit (Settings › Usage) applies to API keys too. Amounts in error bodies are US cents:

    - 402 PAYMENT_REQUIRED {message, estimatedCost, balance} — the balance can''t cover the request

    - 402 SPENDING_LIMIT {message, estimatedCost, balance, monthlySpent, monthlyLimit} — your own monthly limit is reached


    Rate limits: API keys have their own limits, separate from the app and independent of your plan. Defaults per account (all your keys share them): chat 120 requests/min; speech generate/stream 60/min; speech jobs created 30/min; every other endpoint 600/min; 5 transcription jobs running at once with up to 100 more waiting in your account queue; 5 speech jobs at once. GET /api/keys/limits returns the limits in force for your key; they can be raised per account on request. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. 429 bodies: {code: "RATE_LIMITED", message, limit, retryAfter, resetAt}, {code: "QUEUE_FULL" | "JOB_LIMIT", message, limit, active, retryAfter} — always with a Retry-After header (seconds). A refused request does not count against the limit.


    Transcription queue: submit a whole batch at once. Jobs beyond the running limit are accepted with status "queued" and start in order; GET /api/jobs/:id shows queuePosition while a job waits.


    Webhooks: add webhook_url (https, publicly reachable) to POST /api/jobs, POST /api/jobs/url or POST /api/tts/jobs and we POST a small signed event to it when the job ends: {id, type, created, data: {id, status, …}} with type transcription.completed | transcription.failed | speech.completed | speech.failed. Verify the X-Mazdek-Signature header: "t=,v1=" where v1 = HMAC-SHA256(".") with your signing secret (Settings › API › Webhooks). Answer 2xx within 10 s; otherwise we retry up to 8 times over about 30 minutes. GET /api/keys/webhook-deliveries lists your last 50 deliveries.


    Safe retries: send a unique Idempotency-Key header with any POST. Repeating the request with the same key returns the first answer (header Idempotent-Replayed: true) instead of running — and charging — again. Keys are remembered for 24 hours; the same key with a different body returns 422 IDEMPOTENCY_KEY_REUSED, a repeat while the first is still running returns 409 IDEMPOTENCY_IN_PROGRESS. Audio and streamed answers are not replayed.


    Mixed-language lines: if your recordings can be in more than one language (e.g. a call centre taking Arabic and Soranî calls), send language "auto" with expected_languages "ar,ckb". Detection is then limited to those languages; a recording detected as anything else is transcribed again in the closest listed language.


    OpenAPI: the machine-readable specification is at https://mazdek.ai/openapi.json.


    Models:

    - Kurmancî / Soranî TTS: native Kurdish voices (1220+). Use model: "kurmanci" or "sorani"

    - Kurmancî / Soranî ASR: fine-tuned custom models. Use language: "ku" or "ckb" (Kirmanckî: "zza")

    - Multilingual: 32 languages TTS (model: "multilingual"), 90+ languages ASR'
servers:
- url: https://api.mazdek.ai
security:
- bearerAuth: []
tags:
- name: Text-to-Speech (TTS)
  description: 'Generate speech from text: native Kurmancî and Soranî voices (1220+) or the multilingual engine (32 languages). Short text: POST /api/tts/generate (synchronous). Long text: POST /api/tts/jobs (async, split and stitched). Live limits: GET /api/tts/limits.'
paths:
  /api/tts/voices:
    get:
      operationId: listKurmanciVoices
      tags:
      - Text-to-Speech (TTS)
      summary: List Kurmancî Voices
      description: 'List and filter the Kurmancî TTS voices (filters: category, gender, age; lang = description language; model=sorani for the Soranî catalog). Returns voice ids, names, categories, genders and descriptions.


        Voice ids are public aliases like `kvbt75jxh9`. Legacy ids such as `kmr-female-1` are still accepted as input.'
      parameters:
      - name: lang
        in: query
        required: false
        description: 'Language for voice descriptions: en, ku, tr, ar, ckb'
        schema:
          type: string
        example: en
      - name: category
        in: query
        required: false
        description: 'Filter: Advertisement, Characters Animation, Conversational, Entertainment TV, Informative Educational, Narrative Story, Social Media'
        schema:
          type: string
      - name: gender
        in: query
        required: false
        description: 'Filter: male, female'
        schema:
          type: string
      - name: age
        in: query
        required: false
        description: 'Filter: Young, Middle Aged, Old'
        schema:
          type: string
      responses:
        '200':
          description: Success — 1220 voices
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
              example:
                voices:
                - id: kvbt75jxh9
                  name: Agirî
                  gender: male
                  category: Advertisement
                  age: Middle Aged
                  type: extended
                  is_top: true
                  is_featured: false
                  description: Smooth Confident and Persuasive
                - id: kvczc5npf4
                  name: Adar
                  gender: female
                  category: Advertisement
                  age: Middle Aged
                  type: extended
                  is_top: false
                  is_featured: false
                  description: Engaging Convincing and Smiley
                count: 1220
                categories:
                - Advertisement
                - Characters Animation
                - Conversational
                - Entertainment TV
                - Informative Educational
                - Narrative Story
                - Social Media
                source: database
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/Unavailable'
  /api/tts/samples/{voice_id}:
    get:
      operationId: previewVoiceSample
      tags:
      - Text-to-Speech (TTS)
      summary: Preview Voice Sample
      description: 'Listen to a voice sample before generating speech. Returns WAV audio.


        Replace `kvbt75jxh9` with any voice id from the voices list.'
      parameters:
      - name: voice_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success — WAV audio
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/Unavailable'
  /api/tts/generate:
    post:
      operationId: generateKurmanciSpeech
      tags:
      - Text-to-Speech (TTS)
      summary: Generate Kurmancî Speech
      description: 'Generate Kurdish speech with the native Kurmancî (or Soranî) TTS model. Synchronous: the response is the audio itself.


        Parameters:

        - text (required): text to synthesize — max 3,000 chars per synchronous Kurmancî/Soranî call (kurdishSyncMaxChars in GET /api/tts/limits). Longer text: POST /api/tts/jobs

        - model: "kurmanci" (default) | "sorani" | "multilingual". If omitted, language "ckb" selects sorani

        - voice_id: voice id from /api/tts/voices (default voice if omitted)

        - settings.speed: 0.5–2.0 (default 1.0)


        Returns: audio/wav binary data'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            examples:
              generateKurmanciSpeech:
                summary: Generate Kurmancî Speech
                value:
                  text: Rojbaş! Navê min Agirî ye. Ez ji mazdek AI im.
                  model: kurmanci
                  voice_id: kvbt75jxh9
                  settings:
                    speed: 1
              generateMultilingualSpeech:
                summary: Generate Multilingual Speech
                value:
                  text: Hello world! This is a test.
                  model: multilingual
                  voice_id: 933563129e564b19a115bedd57b7406a
                  language: en
                  settings:
                    speed: 1
                    emotion: happy
      responses:
        '200':
          description: Success — WAV audio
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/IdempotencyInProgress'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/Unavailable'
  /api/tts/multilingual/voices:
    get:
      operationId: listMultilingualVoices
      tags:
      - Text-to-Speech (TTS)
      summary: List Multilingual Voices
      description: 'List available multilingual voices (filter with ?language=). `supportedLanguages` lists the 32 languages the multilingual engine voices — Kurdish is not among them.


        For Kurdish voices, use GET /api/tts/voices instead.'
      parameters:
      - name: language
        in: query
        required: false
        description: 'Filter by language: en, ar, tr, de, fr, es, etc.'
        schema:
          type: string
        example: en
      responses:
        '200':
          description: Success
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
              example:
                success: true
                voices:
                - id: 933563129e564b19a115bedd57b7406a
                  name: Energetic Male
                  gender: male
                  language: en
                  description: A youthful and energetic male voice with a clear, professional American accent…
                  tags:
                  - social_media
                  - young
                  - male
                  sampleUrl: https://api.mazdek.ai/api/tts/multilingual/voices/933563129e564b19a115bedd57b7406a/preview
                count: 200
                byLanguage:
                  en:
                  - …
                supportedLanguages:
                - code: en
                  name: English
                - …
                curated: false
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/Unavailable'
  /api/tts/stream:
    post:
      operationId: streamSpeech
      tags:
      - Text-to-Speech (TTS)
      summary: Stream Speech
      description: 'Same body as /api/tts/generate (text, model, voice_id, language, settings). Without `progressive` the response is ONE complete audio body.


        With "progressive": true (Kurmancî/Soranî) the text is split at sentence boundaries and the response is NDJSON: one line per chunk {seq, total, format, audio (base64)}, then {done: true, total}. Usage is metered per delivered chunk.


        Rate limit: 20/min (shared with /generate).'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              text: Rojbaş! Ev nivîsek dirêj e. Her hevok wekî perçeyek tê şandin.
              model: kurmanci
              voice_id: kvbt75jxh9
              progressive: true
      responses:
        '200':
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/IdempotencyInProgress'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/Unavailable'
  /api/tts/jobs:
    post:
      operationId: createLongTTSJob
      tags:
      - Text-to-Speech (TTS)
      summary: Create Long TTS Job
      description: 'Async TTS for long text: the text is split, synthesized and stitched into one file. Billed from credit for API keys.


        Parameters: text (required, max 5,000 chars per job) and the same voice_id, model, language, settings as /api/tts/generate. With an API key up to 5 jobs can be queued or running at once per account (GET /api/keys/limits). Optional webhook_url: an https:// address called when the job ends.


        Poll GET /api/tts/jobs/:id (or SSE GET /api/tts/jobs/:id/stream); cancel with POST /api/tts/jobs/:id/cancel.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              text: Nivîsek dirêj… (heta 5,000 tîp)
              model: kurmanci
              voice_id: kvbt75jxh9
      responses:
        '200':
          description: Job Created
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
              example:
                success: true
                data:
                  id: ttsjob-…
                  status: queued
                  charCount: 4200
                  chunkCount: 9
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/IdempotencyInProgress'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/Unavailable'
  /api/tts/jobs/{tts_job_id}:
    get:
      operationId: getTTSJob
      tags:
      - Text-to-Speech (TTS)
      summary: Get TTS Job
      description: 'Job status + progress. status: queued | processing | completed | failed | cancelled. When completed, result.audioUrl is a signed download link valid for 1 hour.'
      parameters:
      - name: tts_job_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Completed
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
              example:
                success: true
                data:
                  id: ttsjob-…
                  status: completed
                  progress:
                    percent: 100
                    step: completed
                  charCount: 4200
                  result:
                    generationId: …
                    duration: 291.4
                    mimeType: audio/wav
                    audioUrl: https://… (valid for 1 hour)
                  error: null
                  errorCode: null
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/Unavailable'
  /api/tts/jobs/{tts_job_id}/stream:
    get:
      operationId: tTSJobProgressSSE
      tags:
      - Text-to-Speech (TTS)
      summary: TTS Job Progress (SSE)
      description: Server-Sent Events with the job's progress until it completes, fails or is cancelled.
      parameters:
      - name: tts_job_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            text/event-stream:
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/Unavailable'
  /api/tts/jobs/{tts_job_id}/cancel:
    post:
      operationId: cancelTTSJob
      tags:
      - Text-to-Speech (TTS)
      summary: Cancel TTS Job
      description: Cancel a queued or running TTS job.
      parameters:
      - name: tts_job_id
        in: path
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/IdempotencyKey'
      responses:
        '200':
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/IdempotencyInProgress'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/Unavailable'
  /api/tts/limits:
    get:
      operationId: tTSLimits
      tags:
      - Text-to-Speech (TTS)
      summary: TTS Limits
      description: 'Live per-request limits: maxChars (UI cap), planMaxChars (your plan''s cap, when signed in), apiMaxChars (API-key cap), kurdishSyncMaxChars (what one synchronous Kurmancî/Soranî /generate call accepts) and asyncEndpoint.'
      responses:
        '200':
          description: Success
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success'
              example:
                success: true
                maxChars: 5000
                planMaxChars: null
                apiMaxChars: 5000
                kurdishSyncMaxChars: 3000
                asyncEndpoint: POST /api/tts/jobs
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/Unavailable'
webhooks:
  jobEnded:
    post:
      summary: A job that carried webhook_url ended
      description: 'Sent to the webhook_url of POST /api/jobs, POST /api/jobs/url or POST /api/tts/jobs. Signed: X-Mazdek-Signature is `t=,v1=` with v1 = HMAC-SHA256(`.`) keyed with the account''s signing secret. Answer 2xx within 10 seconds; otherwise the delivery is retried up to 8 times over about 30 minutes.'
      parameters:
      - name: X-Mazdek-Signature
        in: header
        required: true
        schema:
          type: string
      - name: X-Mazdek-Event
        in: header
        required: true
        schema:
          type: string
      - name: X-Mazdek-Delivery
        in: header
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEvent'
            example:
              id: 5b1f0c0e-6d0a-4c57-9f0e-1c2f6f0b7a11
              type: transcription.completed
              created: 1763299998
              data:
                id: a1b2c3d4
                status: completed
                durationSeconds: 184.2
                language: ku
      responses:
        '200':
          description: Any 2xx acknowledges the event
      tags:
      - Text-to-Speech (TTS)
components:
  headers:
    X-RateLimit-Limit:
      description: Requests allowed in the current window
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix seconds when the window resets
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests left in the current window
      schema:
        type: integer
    Retry-After:
      description: Seconds to wait before sending the request again
      schema:
        type: integer
  responses:
    IdempotencyInProgress:
      description: IDEMPOTENCY_IN_PROGRESS — the first request with this Idempotency-Key is still running
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: PAYMENT_REQUIRED (balance too low) or SPENDING_LIMIT (monthly limit reached)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: Temporarily busy or under maintenance
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, invalid or revoked API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unprocessable:
      description: IDEMPOTENCY_KEY_REUSED (same key, different request) or TRANSLATION_REFUSED
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: API_SERVICE_UNAVAILABLE (no API price for this service) or FORBIDDEN
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: RATE_LIMITED, QUEUE_FULL (transcription queue full) or JOB_LIMIT (too many speech jobs)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
  schemas:
    Success:
      type: object
      required:
      - success
      properties:
        success:
          const: true
        data: {}
      additionalProperties: true
    WebhookEvent:
      type: object
      required:
      - id
      - type
      - created
      - data
      properties:
        id:
          type: string
          format: uuid
          description: Delivery id — use it to ignore repeats
        type:
          type: string
          enum:
          - transcription.completed
          - transcription.failed
          - speech.completed
          - speech.failed
        created:
          type: integer
          description: Unix seconds the event happened
        data:
          type: object
          required:
          - id
          - status
          properties:
            id:
              type: string
              description: Job id
            status:
              type: string
              enum:
              - completed
              - failed
            durationSeconds:
              type: number
            language:
              type: string
              description: transcription.completed
            generationId:
              type: string
              description: speech.completed
            errorCode:
              type: string
              description: '*.failed'
    Error:
      type: object
      required:
      - success
      - error
      properties:
        success:
          const: false
        error:
          description: An object with a machine-readable code; a few older endpoints answer with a plain message string.
          oneOf:
          - type: string
          - type: object
            required:
            - code
            properties:
              code:
                type: string
                examples:
                - RATE_LIMITED
                - QUEUE_FULL
                - PAYMENT_REQUIRED
              message:
                type: string
              limit:
                type: integer
              active:
                type: integer
              retryAfter:
                type: integer
                description: Seconds
              resetAt:
                type: string
                format: date-time
              estimatedCost:
                type: number
                description: US cents
              balance:
                type: number
                description: US cents
            additionalProperties: true
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: 'Unique string (1–255 printable ASCII characters). A repeat of the same request with the same key returns the first answer (header Idempotent-Replayed: true) instead of running again. Remembered for 24 hours per account. Audio and streamed answers are not replayed.'
      schema:
        type: string
        maxLength: 255
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key: Authorization: Bearer mazdek_sk_…'