{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF & EPUB to Audiobook – MP3 Chapters, Natural AI Voices",
    "description": "Turn PDF, EPUB, DOCX, TXT or article URLs into an audiobook: one MP3 per chapter or an M4B with chapter marks, plus SRT. Natural open-source AI voices (Kokoro, Apache-2.0), no API key. Chapters from the table of contents, OCR for scans.",
    "version": "0.1",
    "x-build-id": "RVcAFiuqpcmFTaSpO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~pdf-to-audiobook/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-pdf-to-audiobook",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/gazidev~pdf-to-audiobook/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-pdf-to-audiobook",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/gazidev~pdf-to-audiobook/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-pdf-to-audiobook",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "fileUrls": {
            "title": "Document URLs",
            "type": "array",
            "description": "Public links to PDF, EPUB, DOCX, TXT/Markdown files or web articles (HTML). Google Drive, Dropbox and GitHub share links are converted to direct downloads. Each document becomes one audiobook. Only convert documents you have the right to.",
            "default": [
              "https://github.com/IDPF/epub3-samples/releases/download/20230704/wasteland.epub"
            ],
            "items": {
              "type": "string"
            }
          },
          "uploadedFiles": {
            "title": "Or upload files",
            "type": "array",
            "description": "Upload PDF, EPUB, DOCX or TXT files directly."
          },
          "text": {
            "title": "Or paste text",
            "type": "string",
            "description": "Optional plain text or Markdown. Lines like 'Chapter 1' or '# Heading' start new chapters."
          },
          "voice": {
            "title": "Voice",
            "enum": [
              "af_heart",
              "af_bella",
              "af_nicole",
              "af_aoede",
              "af_kore",
              "af_sarah",
              "af_nova",
              "af_sky",
              "af_alloy",
              "af_jessica",
              "af_river",
              "am_michael",
              "am_fenrir",
              "am_puck",
              "am_echo",
              "am_eric",
              "am_liam",
              "am_onyx",
              "am_adam",
              "am_santa",
              "bf_emma",
              "bf_isabella",
              "bf_alice",
              "bf_lily",
              "bm_george",
              "bm_fable",
              "bm_lewis",
              "bm_daniel",
              "ef_dora",
              "em_alex",
              "em_santa",
              "ff_siwis",
              "if_sara",
              "im_nicola",
              "pf_dora",
              "pm_alex",
              "pm_santa",
              "hf_alpha",
              "hf_beta",
              "hm_omega",
              "hm_psi",
              "zf_xiaobei",
              "zf_xiaoni",
              "zf_xiaoxiao",
              "zf_xiaoyi",
              "zm_yunjian",
              "zm_yunxi",
              "zm_yunxia",
              "zm_yunyang"
            ],
            "type": "string",
            "description": "54 natural neural voices. The voice's language is used automatically unless you set Language.",
            "default": "af_heart"
          },
          "language": {
            "title": "Language (pronunciation)",
            "enum": [
              "auto",
              "en-us",
              "en-gb",
              "es",
              "fr",
              "it",
              "pt-br",
              "hi",
              "zh"
            ],
            "type": "string",
            "description": "How the text is read. Usually leave on Auto and pick a voice in your language. You can mix them, e.g. an American voice reading Spanish gives an accent.",
            "default": "auto"
          },
          "speed": {
            "title": "Speed",
            "minimum": 0.5,
            "maximum": 2,
            "type": "number",
            "description": "0.5 = slow, 1.0 = normal, 2.0 = fast. The billed minutes are the minutes of audio produced.",
            "default": 1
          },
          "splitBy": {
            "title": "Split into chapters by",
            "enum": [
              "toc",
              "heading",
              "pages",
              "none"
            ],
            "type": "string",
            "description": "How chapters are found. 'toc' uses the EPUB table of contents or PDF bookmarks, then headings, then pages.",
            "default": "toc"
          },
          "pagesPerChapter": {
            "title": "Pages per chapter (split by pages)",
            "minimum": 1,
            "type": "integer",
            "description": "Used by 'Fixed number of pages' and as the PDF fallback. For non-PDF files one 'page' is about 2,500 characters.",
            "default": 10
          },
          "skipPages": {
            "title": "Skip the first N PDF pages (front matter)",
            "minimum": 0,
            "type": "integer",
            "description": "Cover, copyright and contents pages you do not want read aloud.",
            "default": 0
          },
          "skipChapterTitles": {
            "title": "Skip chapters with these titles",
            "type": "array",
            "description": "Chapters whose title is or starts with one of these words are not converted (case-insensitive).",
            "default": [
              "Contents",
              "Table of Contents",
              "Index",
              "Copyright"
            ],
            "items": {
              "type": "string"
            }
          },
          "skipReferences": {
            "title": "Skip reference lists",
            "type": "boolean",
            "description": "Stop a chapter at a 'References' / 'Bibliography' heading (academic papers, non-fiction).",
            "default": true
          },
          "startChapter": {
            "title": "Start at chapter",
            "minimum": 1,
            "type": "integer",
            "description": "Continue a long book in a later run: start at this chapter number (shown in each row as chapterIndex).",
            "default": 1
          },
          "maxChapters": {
            "title": "Max chapters per document",
            "minimum": 0,
            "type": "integer",
            "description": "0 = all.",
            "default": 0
          },
          "removeHeadersFooters": {
            "title": "Remove running headers, footers and page numbers (PDF)",
            "type": "boolean",
            "description": "Drops lines repeated at the top/bottom of most pages (book title, chapter name) and bare page numbers.",
            "default": true
          },
          "ocr": {
            "title": "OCR scanned PDF pages",
            "type": "boolean",
            "description": "Pages without a text layer are read with Tesseract OCR (charged per page). Text pages are never OCR'd.",
            "default": true
          },
          "ocrLanguage": {
            "title": "OCR language",
            "type": "string",
            "description": "Tesseract language code(s), e.g. 'eng', 'deu', 'eng+fra'. Empty = the voice language."
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Only for password-protected PDFs."
          },
          "output": {
            "title": "Output",
            "enum": [
              "mp3-per-chapter",
              "m4b",
              "single-mp3"
            ],
            "type": "string",
            "description": "Output",
            "default": "mp3-per-chapter"
          },
          "bitrate": {
            "title": "Bitrate",
            "enum": [
              "32",
              "48",
              "64",
              "96",
              "128"
            ],
            "type": "string",
            "description": "Bitrate",
            "default": "64"
          },
          "subtitles": {
            "title": "SRT subtitles",
            "type": "boolean",
            "description": "An SRT file with sentence timestamps for each chapter (and for the whole book with M4B / single MP3).",
            "default": true
          },
          "maxMinutes": {
            "title": "Max minutes of audio per run",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on the audio produced (and billed) in one run; 60 minutes take about 30 minutes at 8 GB memory. The run stops at a sentence boundary; continue with 'Start at chapter'. Your maximum cost per run is respected too.",
            "default": 60
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger downloads are rejected.",
            "default": 100
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}