Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: mazdek AI Speech-to-Text (ASR) 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: Speech-to-Text (ASR)
description: 'Transcribe audio/video with fine-tuned Kurmancî/Soranî models or the multilingual model (90+ languages).
Pipeline: Upload → Vocal Separation → Noise Reduction → Transcription → Translation (optional)
Limits: upload up to 100 MB per file; hard ceiling 3 hours of audio per file; with an API key 5 jobs run at once and up to 100 more wait in your account queue (GET /api/keys/limits). Add webhook_url to be called when a job ends instead of polling. Results are kept for 24 hours.'
paths:
/api/jobs:
post:
operationId: transcribeKurmanciAudio
tags:
- Speech-to-Text (ASR)
summary: Transcribe Kurmancî Audio
description: 'Upload audio and transcribe it with the fine-tuned Kurmancî ASR model (multipart/form-data).
The job runs asynchronously. Poll GET /api/jobs/:id (or SSE GET /api/jobs/:id/stream) for results.
Form fields:
- file (required)
- language: default "ku"; "auto" detects the language
- translate: "true" to translate after transcription
- target_language: translation target (default "en")
- clean_audio: vocal separation + noise reduction, on by default ("false" disables)
- auto_optimize: on by default ("false" disables)
- trim_start / trim_end: seconds, transcribe only a part of the file
Language codes that use the Kurmancî model: ku, kmr, kurmanji, kurmanci, kirmancki, zazaki, zza, kiu, dimli'
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
description: Audio/video file (MP3, WAV, M4A, OGG, FLAC, WebM, MP4 — max 100 MB, 3 h)
language:
type: string
example: ku
description: 'Language: ku (Kurmancî) — uses fine-tuned Kurdish model'
expected_languages:
type: string
example: ar,ckb
description: 'Optional, with language "auto": comma-separated languages the recording may be in, e.g. "ar,ckb" (max 5). Detection is limited to them; a recording detected as anything else is transcribed again in the closest listed language. One code = that language is used.'
clean_audio:
type: string
example: 'true'
description: Vocal separation + noise reduction (default true; "false" disables)
translate:
type: string
description: Set to 'true' to enable translation after transcription
target_language:
type: string
example: en
description: Translation target language code
auto_optimize:
type: string
example: 'true'
description: Automatic optimization (default true; "false" disables)
trim_start:
type: string
example: '0'
description: Start offset in seconds
trim_end:
type: string
example: '60'
description: End offset in seconds
webhook_url:
type: string
example: https://example.com/hooks/mazdek
description: Optional https:// address called when the job ends (signed, see collection description)
required:
- file
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: abc12345
status: queued
filename: interview.mp3
language: ku
translate: false
targetLanguage: en
cleanAudio: true
autoOptimize: true
createdAt: '2026-10-09T12:00:00.000Z'
'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/jobs/url:
post:
operationId: transcribeFromURL
tags:
- Speech-to-Text (ASR)
summary: Transcribe from URL
description: 'Transcribe audio from a URL (YouTube, direct audio links, etc.). JSON body.
Parameters: url (required), language (default "ku"), translate (boolean), targetLanguage (camelCase here, default "en"), clean_audio, auto_optimize (booleans, default true), trim_start / trim_end (seconds), webhook_url (optional https:// address called when the job ends).
expected_languages (array or comma-separated string): Optional, with language "auto": comma-separated languages the recording may be in, e.g. "ar,ckb" (max 5). Detection is limited to them; a recording detected as anything else is transcribed again in the closest listed language. One code = that language is used.'
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: true
example:
url: https://www.youtube.com/watch?v=example
language: ku
translate: true
targetLanguage: en
clean_audio: true
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: url12345
status: queued
filename: Video title
language: ku
sourceType: url
createdAt: '2026-10-09T12:00:00.000Z'
'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/jobs/{job_id}:
get:
operationId: getJobStatusResults
tags:
- Speech-to-Text (ASR)
summary: Get Job Status & Results
description: 'Poll this endpoint to get the transcription result. The transcript is in data.result.text.
Status flow: queued → processing → completed / failed. While a job waits for one of your running slots the answer also carries queuePosition (1 = next). Results are kept for 24 hours.
For real-time progress, use SSE: GET /api/jobs/:id/stream'
parameters:
- name: 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: abc12345
status: completed
filename: interview.mp3
language: ku
translate: true
targetLanguage: en
result:
text: Silav, navê min Bager e.
segments:
- start: 0
end: 2.1
text: Silav,
- start: 2.1
end: 4.8
text: navê min Bager e.
language: ku
duration: 4.8
translation: Hello, my name is Bager.
createdAt: '2026-10-09T12:00:00.000Z'
'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'
delete:
operationId: deleteJob
tags:
- Speech-to-Text (ASR)
summary: Delete Job
description: Delete a job and its result.
parameters:
- name: 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:
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'
'429':
$ref: '#/components/responses/TooManyRequests'
'503':
$ref: '#/components/responses/Unavailable'
/api/jobs/{job_id}/stream:
get:
operationId: jobProgressSSE
tags:
- Speech-to-Text (ASR)
summary: Job Progress (SSE)
description: Server-Sent Events with progress updates for one job until it completes or fails (alternative to polling GET /api/jobs/:id).
parameters:
- name: 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/jobs/precheck:
post:
operationId: precheckUpload
tags:
- Speech-to-Text (ASR)
summary: Precheck Upload
description: 'Optional: check a file against your limits before uploading. Body: fileSizeBytes (required), mimeType, fileName, durationSeconds. Advisory only — the real check runs on the uploaded file.'
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: true
example:
fileSizeBytes: 4800000
mimeType: audio/mpeg
fileName: interview.mp3
durationSeconds: 300
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
estimatedDurationSeconds: 300
durationIsMeasured: true
perFileLimitSeconds: 10800
'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/jobs/active:
get:
operationId: activeJobs
tags:
- Speech-to-Text (ASR)
summary: Active Jobs
description: Your queued and running transcription jobs, with maxConcurrent (jobs running at once) and, for API keys, maxQueued (jobs that may wait behind them).
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'
'429':
$ref: '#/components/responses/TooManyRequests'
'503':
$ref: '#/components/responses/Unavailable'
/api/jobs/{job_id}/cancel:
post:
operationId: cancelJob
tags:
- Speech-to-Text (ASR)
summary: Cancel Job
description: Cancel a queued or running job.
parameters:
- name: 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'
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
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_…'