AniwaffleDocsHomeStudio

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

HeaderRequiredValue
AuthorizationYesBearer awp_...
Content-TypeYesapplication/json
Idempotency-KeyYes1–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
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
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
curl "https://aniwaffle.com/v1/tts/jobs/$JOB_ID/audio" \
  --header "Authorization: Bearer $ANIWAFFLE_API_KEY" \
  --output chapter-1.pcm

The job object

json
{
  "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"
}
FieldTypeDescription
idstringThe job ID.
request_idstringThe request's ID. Include it when you contact support.
statusstringqueued, running, completed, failed or expired.
expires_atstringWhen the job and its audio expire, 24 hours after submission.
status_urlstringPath of this job.
audio_urlstring or nullPath of the audio once status is completed; otherwise null.
error_codestringsynthesis_failed when status is failed.

Errors

Job endpoints return a JSON body with a code:

StatusCodeCause
400idempotency_key_requiredIdempotency-Key is missing or longer than 200 characters.
400invalid_requestThe body is invalid: a missing or unknown field, text over 20,000 characters, or an unknown model.
401—Missing, invalid or revoked API key.
402insufficient_creditThe workspace balance is too low.
404batch_not_foundNo job with this ID in the workspace.
409idempotency_conflictThe key was already used with a different body.
409batch_in_progressThe audio isn't ready yet. Retry after Retry-After (2 seconds).
410batch_result_unavailableThe job failed or expired.
429batch_queue_fullThe workspace already has 20 jobs queued or running. Retry after Retry-After (10 seconds).

Contact our team

Tell us about your character and what you’d like to build.