Authentication
All requests require a Bearer token in the Authorization header.
Authorization: Bearer YOUR_TOKEN
Endpoints
GET /api/voices List available voices
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| locale | string | No | Filter by locale, e.g. en-US |
| gender | string | No | Male or Female |
Request
GET /api/voices?locale=en-US&gender=Female Authorization: Bearer YOUR_TOKEN
Response 200
[
{
"name": "en-US-AriaNeural",
"friendlyName": "Aria (United States)",
"locale": "en-US",
"gender": "Female",
"status": "GA",
"contentCategories": ["General"],
"voicePersonalities": ["Friendly"]
}
]POST /api/tts Submit a TTS job
Returns immediately with a job ID. Audio is generated asynchronously — poll /api/tts/:jobId for the result.
Request Body (JSON)
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| text | string | Yes | — | Text to synthesize. Max 12,000 characters. |
| voice | string | No | en-US-AriaNeural | Voice name from /api/voices |
| rate | string | No | default | Speaking rate, e.g. +10%, -20% |
| pitch | string | No | default | Pitch, e.g. +5Hz, -10Hz |
| volume | string | No | default | Volume, e.g. +20%, -10% |
Request
POST /api/tts
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"text": "Hello, world!",
"voice": "en-US-GuyNeural",
"rate": "+10%"
}Response 202
{
"jobId": "a3f8c2e1d4b7..."
}Error Responses
400 Missing or empty text field
400 Text exceeds 12,000 characters
401 Unauthorized
GET /api/tts/:jobId Get job status or download audio
Poll this endpoint after submitting a job. Once done, the audio file is returned directly and the job is deleted — it can only be retrieved once.
Processing 200
{
"status": "processing"
}Failed 500
{
"status": "failed"
}Done 200
Content-Type: audio/mpeg <binary audio buffer>
Error Responses
404 Job not found
Example Flow
# 1. Submit job POST https://audio.crikk.com/api/tts → 202 { "jobId": "abc123" } # 2. Poll until done GET https://audio.crikk.com/api/tts/abc123 → 200 { "status": "processing" } GET https://audio.crikk.com/api/tts/abc123 → 200 { "status": "processing" } # 3. Receive audio (job is deleted after this) GET https://audio.crikk.com/api/tts/abc123 → 200 audio/mpeg <binary>