Audiobooks
Generate, follow, stop, resume and delete audiobooks.
Request it
curl -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
--data '{"format":"mp3","speed":1}' \
https://reader.example/api/v1/documents/DOCUMENT_ID/audiobooks200 means the matching file is ready. 202 returns its status and ID.
Follow it
Read GET /api/v1/documents/{id}/audiobooks/{audiobookId} until downloadUrl is present. If generation stops (see Progress), POST again to resume.
Deliver it
Follow downloadUrl, or give a person webDownloadUrl, a page that starts the download and offers to sign in or switch account.
Repeating a request with the same document version, settings, format, speed and chapter reuses the same audiobook.
Options
| Field | Effect |
|---|---|
format | mp3 (default) or m4b |
speed | Speed of the finished file, 0.5 to 3, rounded to two decimals |
modelSpeed | Speed the model speaks at, 0.5 to 3. Changes the generated audio. |
provider, model | Any enabled provider and a model the instance allows |
voice | A voice of that provider and model, including clone: voices |
retrySkipped | true retries skipped whole-book segments |
chapter | A zero-based chapter to assemble from settled audio. Starts no generation, and cannot be stopped. |
Saved voices and options apply only to the saved provider and model; any other choice starts from that provider's defaults. The saved voice speed applies to any model that has one.
A disabled or unknown provider, or a voice it does not list, returns 400. A provider that cannot be reached to check the voice returns 503.
Progress
- Signed-in whole-book requests continue after the tab closes. Guest requests advance only on the guest's own requests.
- Only a caller with
audio:generateadvances a request by reading it. Withdocuments:readalone, reading and lookup only observe. - An unparsed PDF returns
409 DOCUMENT_PREPARINGwithretryAfterMs. A POST starts the parse. - Work held back by admission limits reports
waitingand can recover on a later read. - Usage-limited, failed or interrupted generation needs a new POST to resume.
- If the provider fails several segments in a row, generation stops with
PROVIDER_UNAVAILABLEorPROVIDER_REJECTEDingeneration.issue. POST again once it is back.
A request stays addressable for seven days after its last POST, and until it has finished or been cancelled. After that GET returns 404, but the audio and file remain: a new POST with the same settings finds them.
The specification also covers operation SSE streams, which last up to 300 seconds. Reconnect as needed, or poll.
List
GET /api/v1/documents/{id}/audiobooks lists the most recently requested first, 20 to a page (limit up to 50). Listing only observes. Each names its provider, model, voice, modelSpeed and requestedAt.
Stop or delete
| Cancel | Delete | |
|---|---|---|
| Call | POST .../{audiobookId}/cancel | DELETE .../{audiobookId} |
| Scope | audio:generate | documents:write |
| Finished file | Kept | Removed |
| Generated audio | Kept | Kept |
| To get it back | POST again to resume | POST again; only missing audio is generated |
Formats and speeds of the same settings share one generation run. Cancelling stops the run, and with it the other whole-book requests on it. Deleting stops only a run nothing else shares.
While a file is being built, DELETE returns 409 AUDIOBOOK_BUILDING.