API reference
Speech jobs
Create a background speech job, check its status, and download the audio. Jobs take the same request body as POST /v1/tts.
Create a job
POSThttps://aniwaffle.com/v1/tts/jobs
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer awp_... |
Content-Type | Yes | application/json |
Idempotency-Key | Yes | 1–200 characters that identify this request. Resubmitting the same key and body returns the same job. |
The body has the same fields as POST /v1/tts: text, voice_id, output_format, and optionally model, realtime, context_id and partner_session_id.
curl https://aniwaffle.com/v1/tts/jobs \
--header "Authorization: Bearer $ANIWAFFLE_API_KEY" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: chapter-1-rev-3" \
--data '{"text": "Chapter one...", "voice_id": "'"$ANIWAFFLE_VOICE_ID"'", "output_format": "pcm_48000"}'Returns 202 Accepted with a job object and a Location header pointing to the job.
Get a job
GEThttps://aniwaffle.com/v1/tts/jobs/{id}
Returns 200 OK with the job object. Any API key in the workspace can read the job. Poll every few seconds until status is completed, failed or expired.
curl "https://aniwaffle.com/v1/tts/jobs/$JOB_ID" \
--header "Authorization: Bearer $ANIWAFFLE_API_KEY"Download audio
GEThttps://aniwaffle.com/v1/tts/jobs/{id}/audio
Returns 200 OK with the audio as the body and the same headers as POST /v1/tts, plus an ETag. Downloads are free and can be repeated until the job expires.
The endpoint supports a single Range with If-Range to resume an interrupted download, returning 206 Partial Content. See Resume an interrupted download.
curl "https://aniwaffle.com/v1/tts/jobs/$JOB_ID/audio" \
--header "Authorization: Bearer $ANIWAFFLE_API_KEY" \
--output chapter-1.pcmThe job object
{
"id": "JOB_ID",
"request_id": "rq_0f8c2d4e-...",
"status": "completed",
"expires_at": "2026-11-24T09:00:00.000Z",
"status_url": "/v1/tts/jobs/JOB_ID",
"audio_url": "/v1/tts/jobs/JOB_ID/audio"
}| Field | Type | Description |
|---|---|---|
id | string | The job ID. |
request_id | string | The request's ID. Include it when you contact support. |
status | string | queued, running, completed, failed or expired. |
expires_at | string | When the job and its audio expire, 24 hours after submission. |
status_url | string | Path of this job. |
audio_url | string or null | Path of the audio once status is completed; otherwise null. |
error_code | string | synthesis_failed when status is failed. |
Errors
Job endpoints return a JSON body with a code:
| Status | Code | Cause |
|---|---|---|
| 400 | idempotency_key_required | Idempotency-Key is missing or longer than 200 characters. |
| 400 | invalid_request | The body is invalid: a missing or unknown field, text over 20,000 characters, or an unknown model. |
| 401 | — | Missing, invalid or revoked API key. |
| 402 | insufficient_credit | The workspace balance is too low. |
| 404 | batch_not_found | No job with this ID in the workspace. |
| 409 | idempotency_conflict | The key was already used with a different body. |
| 409 | batch_in_progress | The audio isn't ready yet. Retry after Retry-After (2 seconds). |
| 410 | batch_result_unavailable | The job failed or expired. |
| 429 | batch_queue_full | The workspace already has 20 jobs queued or running. Retry after Retry-After (10 seconds). |