# Audiobooks (/reference/public-api/audiobooks)

<Steps>
<Step>
### Request it [#request-it]

```bash
curl -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"format":"mp3","speed":1}' \
  https://reader.example/api/v1/documents/DOCUMENT_ID/audiobooks
```

`200` means the matching file is ready. `202` returns its status and ID.
</Step>

<Step>
### Follow it [#follow-it]

Read `GET /api/v1/documents/{id}/audiobooks/{audiobookId}` until `downloadUrl` is present. If generation stops (see [Progress](#progress)), POST again to resume.
</Step>

<Step>
### Deliver it [#deliver-it]

Follow `downloadUrl`, or give a person `webDownloadUrl`, a page that starts the download and offers to sign in or switch account.
</Step>
</Steps>

Repeating a request with the same document version, settings, format, speed and chapter reuses the same audiobook.

## Options [#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 [#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:generate` advances a request by reading it. With `documents:read` alone, reading and lookup only observe.
- An unparsed PDF returns `409 DOCUMENT_PREPARING` with `retryAfterMs`. A POST starts the parse.
- Work held back by admission limits reports `waiting` and 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_UNAVAILABLE` or `PROVIDER_REJECTED` in `generation.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 [#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 [#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`.