{"openapi":"3.1.0","info":{"title":"SmartPDF API","description":"\nВсе операции асинхронные: `POST /v1/pdf/…` возвращает `task_id`, статус — `GET /v1/tasks/{task_id}`.\nАвторизация — заголовок `X-API-Key` с ключом из кабинета (раздел «API и MCP»).\nЗапрос оплачивается с баланса API аккаунта (общий для всех ключей и MCP): 1,25 ₽ за каждые начатые\n10 МБ входа (файл до 10 МБ — 1,25 ₽, 25 МБ — 3,75 ₽; у объединения считается сумма файлов). Тяжёлые\nоперации — ещё и по страницам, берётся большее: распознавание текста (OCR) — 1,25 ₽ за каждые 10 страниц\n(до 100 страниц за раз, больше — `422` без списания), PDF в Word / Excel / PowerPoint / JPG — за каждые\n50 страниц (JPG 300 dpi — за 25). Ставки — `GET /v1/pricing/api` (`page_rates`). На тарифе\nБизнес сначала расходуются 500 включённых обычных запросов месяца. Нет денег на балансе или исчерпан\nлимит ключа — `402` с объяснением, ничего не списано. Ошибка обработки возвращает оплату автоматически.\nОстаток — `GET /v1/api-keys/balance` (`balance`, `spent_month`, `request_price`, `included_remaining`),\nсписанное — `charge` и `charge_units` в `GET /v1/account/operations`. Пополнение, лимиты ключей,\nперевыпуск и удаление — в кабинете (раздел «API и MCP»).\n\n## Вебхуки\n\nПередайте в запросе операции `webhook_url` (только https) — по завершении SmartPDF отправит на него\n`POST` с JSON: `event` (`task.done` / `task.failed`), `task_id`, `operation_type`, `status`, `timestamp`,\n`download_url` и `filename` (для `task.done`, ссылка действует 1 час) или `error_message`.\nИмя результата — `<исходное имя>_smartpdf.<расширение>` (оно же в заголовке `Content-Disposition`).\nОтветьте кодом 2xx; иначе будет ещё 3 попытки (через 10, 30 и 90 секунд). Редиректы не выполняются.\n\nЗаголовки: `X-SmartPDF-Event`, `X-SmartPDF-Delivery` (id операции, одинаков у повторов — по нему\nотсекайте дубли) и `X-SmartPDF-Signature: t=<unix-время>,v1=<подпись>`.\n\n**Проверка подписи.** Секрет — кабинет → «API и MCP» (там же выпускается новый, старый сразу\nперестаёт действовать).\nПодпись — HMAC-SHA256 от строки `<t>.<тело запроса как есть>` в hex. Сравнивайте в постоянном\nвремени и отклоняйте запросы старше 5 минут.\n\n```python\nimport hashlib, hmac, time\n\ndef verify(secret: str, body: bytes, header: str) -> bool:\n    parts = dict(p.split(\"=\", 1) for p in header.split(\",\"))\n    ts = int(parts[\"t\"])\n    if abs(time.time() - ts) > 300:\n        return False\n    expected = hmac.new(secret.encode(), f\"{ts}.\".encode() + body, hashlib.sha256).hexdigest()\n    return hmac.compare_digest(expected, parts[\"v1\"])\n```\n\n```javascript\nconst crypto = require(\"crypto\");\n\nfunction verify(secret, rawBody, header) {\n  const parts = Object.fromEntries(header.split(\",\").map((p) => p.split(\"=\")));\n  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;\n  const expected = crypto.createHmac(\"sha256\", secret).update(`${parts.t}.`).update(rawBody).digest(\"hex\");\n  return expected.length === parts.v1.length &&\n    crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));\n}\n```\n","version":"1.0.0"},"servers":[{"url":"https://api.smartpdf.ru"}],"paths":{"/v1/upload":{"post":{"tags":["upload"],"summary":"Upload File","operationId":"upload_file_v1_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_v1_upload_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/upload/from-task/{task_id}":{"post":{"tags":["upload"],"summary":"Upload From Task","description":"Результат своей операции → новый входной файл («Что дальше» на сайте).\n\nФайл копируется внутри MinIO, как будто его загрузили заново: те же лимит\nразмера по тарифу, лимит загрузок гостя и срок жизни, что у POST /upload.\nСкачиванием не считается — result_expires_at не трогаем. На бесплатном\nтарифе результат после скачивания удаляется уборкой (до 15 мин) — тогда 410.","operationId":"upload_from_task_v1_upload_from_task__task_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/to-word":{"post":{"tags":["operations"],"summary":"Pdf To Word","operationId":"pdf_to_word_v1_pdf_to_word_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfToWordRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/word-to-pdf":{"post":{"tags":["operations"],"summary":"Word To Pdf","operationId":"word_to_pdf_v1_pdf_word_to_pdf_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WordToPdfRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/merge":{"post":{"tags":["operations"],"summary":"Merge Pdf","operationId":"merge_pdf_v1_pdf_merge_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/compress":{"post":{"tags":["operations"],"summary":"Compress Pdf","operationId":"compress_pdf_v1_pdf_compress_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompressRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/sign":{"post":{"tags":["operations"],"summary":"Sign Pdf","operationId":"sign_pdf_v1_pdf_sign_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/jpg-to-pdf":{"post":{"tags":["operations"],"summary":"Jpg To Pdf","operationId":"jpg_to_pdf_v1_pdf_jpg_to_pdf_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JpgToPdfRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/pptx-to-pdf":{"post":{"tags":["operations"],"summary":"Pptx To Pdf","operationId":"pptx_to_pdf_v1_pdf_pptx_to_pdf_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PptxToPdfRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/xlsx-to-pdf":{"post":{"tags":["operations"],"summary":"Xlsx To Pdf","operationId":"xlsx_to_pdf_v1_pdf_xlsx_to_pdf_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XlsxToPdfRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/html-to-pdf":{"post":{"tags":["operations"],"summary":"Html To Pdf","operationId":"html_to_pdf_v1_pdf_html_to_pdf_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HtmlToPdfRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/to-jpg":{"post":{"tags":["operations"],"summary":"Pdf To Jpg","operationId":"pdf_to_jpg_v1_pdf_to_jpg_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfToJpgRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/to-pptx":{"post":{"tags":["operations"],"summary":"Pdf To Pptx","operationId":"pdf_to_pptx_v1_pdf_to_pptx_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfToPptxRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/to-excel":{"post":{"tags":["operations"],"summary":"Pdf To Excel","operationId":"pdf_to_excel_v1_pdf_to_excel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfToExcelRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/split":{"post":{"tags":["operations"],"summary":"Split Pdf","operationId":"split_pdf_v1_pdf_split_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitPdfRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/ocr":{"post":{"tags":["operations"],"summary":"Ocr Pdf","operationId":"ocr_pdf_v1_pdf_ocr_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OcrRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/rotate":{"post":{"tags":["operations"],"summary":"Rotate Pdf","operationId":"rotate_pdf_v1_pdf_rotate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/delete-pages":{"post":{"tags":["operations"],"summary":"Delete Pages","operationId":"delete_pages_v1_pdf_delete_pages_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePagesRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/extract-pages":{"post":{"tags":["operations"],"summary":"Extract Pages","operationId":"extract_pages_v1_pdf_extract_pages_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractPagesRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/reorder-pages":{"post":{"tags":["operations"],"summary":"Reorder Pages","operationId":"reorder_pages_v1_pdf_reorder_pages_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderPagesRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/protect":{"post":{"tags":["operations"],"summary":"Protect Pdf","operationId":"protect_pdf_v1_pdf_protect_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtectRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/unlock":{"post":{"tags":["operations"],"summary":"Unlock Pdf","operationId":"unlock_pdf_v1_pdf_unlock_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnlockRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/watermark":{"post":{"tags":["operations"],"summary":"Watermark Pdf","operationId":"watermark_pdf_v1_pdf_watermark_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatermarkRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/add-page-numbers":{"post":{"tags":["operations"],"summary":"Add Page Numbers","operationId":"add_page_numbers_v1_pdf_add_page_numbers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddPageNumbersRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/to-txt":{"post":{"tags":["operations"],"summary":"Pdf To Txt","operationId":"pdf_to_txt_v1_pdf_to_txt_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfToTxtRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pdf/flatten":{"post":{"tags":["operations"],"summary":"Flatten Pdf","operationId":"flatten_pdf_v1_pdf_flatten_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlattenRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskIdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task Status","operationId":"get_task_status_v1_tasks__task_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}/download":{"get":{"tags":["tasks"],"summary":"Get Download Url","operationId":"get_download_url_v1_tasks__task_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}/file":{"get":{"tags":["tasks"],"summary":"Download File","operationId":"download_file_v1_tasks__task_id__file_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys/balance":{"get":{"tags":["api-keys"],"summary":"Get Balance","description":"Баланс API аккаунта (общий для всех ключей), траты месяца и цена запроса. Доступен и ключом.","operationId":"get_balance_v1_api_keys_balance_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyBalanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pricing":{"get":{"tags":["pricing"],"summary":"Get Public Pricing","operationId":"get_public_pricing_v1_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PriceItem"},"type":"array","title":"Response Get Public Pricing V1 Pricing Get"}}}}}}},"/v1/pricing/api":{"get":{"tags":["pricing"],"summary":"Get Api Pricing","operationId":"get_api_pricing_v1_pricing_api_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiPricing"}}}}}}}},"components":{"schemas":{"AddPageNumbersRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"position":{"type":"string","enum":["bottom-center","bottom-right","top-center","top-right"],"title":"Position","default":"bottom-center"},"start_from":{"type":"integer","minimum":1,"title":"Start From","default":1},"prefix":{"type":"string","title":"Prefix","default":""},"font_size":{"type":"integer","maximum":72,"minimum":6,"title":"Font Size","default":12},"pages":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"string","const":"all"}],"title":"Pages","default":"all"}},"type":"object","required":["file_id"],"title":"AddPageNumbersRequest"},"ApiKeyBalanceResponse":{"properties":{"balance":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Balance"},"spent_month":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Spent Month"},"request_price":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Request Price"},"request_unit_mb":{"type":"integer","title":"Request Unit Mb"},"included_limit":{"type":"integer","title":"Included Limit","default":0},"included_used":{"type":"integer","title":"Included Used","default":0},"included_remaining":{"type":"integer","title":"Included Remaining","default":0},"included_resets_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Included Resets At"}},"type":"object","required":["balance","spent_month","request_price","request_unit_mb"],"title":"ApiKeyBalanceResponse"},"ApiPricing":{"properties":{"request_price":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Request Price"},"request_unit_mb":{"type":"integer","title":"Request Unit Mb"},"topup_min":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Topup Min"},"topup_max":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Topup Max"},"trial":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Trial"},"business_included":{"type":"integer","title":"Business Included"},"bonuses":{"items":{"$ref":"#/components/schemas/TopupBonus"},"type":"array","title":"Bonuses"},"page_rates":{"items":{"$ref":"#/components/schemas/PageRate"},"type":"array","title":"Page Rates"},"ocr_max_pages":{"type":"integer","title":"Ocr Max Pages"}},"type":"object","required":["request_price","request_unit_mb","topup_min","topup_max","trial","business_included","bonuses","page_rates","ocr_max_pages"],"title":"ApiPricing","description":"Условия API/MCP для лендинга и кабинета — одно место вместо копий на фронтенде."},"Body_upload_file_v1_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_file_v1_upload_post"},"CompressRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"level":{"type":"string","enum":["low","medium","high"],"title":"Level","default":"medium"}},"type":"object","required":["file_id"],"title":"CompressRequest"},"DeletePagesRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"pages":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Pages"}},"type":"object","required":["file_id","pages"],"title":"DeletePagesRequest"},"DownloadUrlResponse":{"properties":{"download_url":{"type":"string","title":"Download Url"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"filename":{"type":"string","title":"Filename"}},"type":"object","required":["download_url","expires_at","filename"],"title":"DownloadUrlResponse"},"ExtractPagesRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"pages":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Pages"}},"type":"object","required":["file_id","pages"],"title":"ExtractPagesRequest"},"FlattenRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"}},"type":"object","required":["file_id"],"title":"FlattenRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HtmlToPdfRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Id"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"page_size":{"type":"string","enum":["A4","A3","Letter"],"title":"Page Size","default":"A4"},"orientation":{"type":"string","enum":["portrait","landscape"],"title":"Orientation","default":"portrait"},"margin":{"type":"string","enum":["standard","narrow","none"],"title":"Margin","default":"standard"}},"type":"object","title":"HtmlToPdfRequest"},"JpgToPdfRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_ids":{"items":{"type":"string"},"type":"array","maxItems":10,"minItems":1,"title":"File Ids"},"order":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Order"},"fit":{"type":"string","enum":["auto","portrait","landscape"],"title":"Fit","default":"auto"}},"type":"object","required":["file_ids"],"title":"JpgToPdfRequest"},"MergeRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_ids":{"items":{"type":"string"},"type":"array","minItems":2,"title":"File Ids"},"order":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Order"}},"type":"object","required":["file_ids"],"title":"MergeRequest"},"OcrRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"languages":{"items":{"type":"string","enum":["rus","eng","deu","fra"]},"type":"array","maxItems":4,"minItems":1,"title":"Languages","default":["rus","eng"]}},"type":"object","required":["file_id"],"title":"OcrRequest"},"PageRate":{"properties":{"operation_type":{"type":"string","title":"Operation Type"},"pages_per_unit":{"type":"integer","title":"Pages Per Unit"},"min_dpi":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Dpi"}},"type":"object","required":["operation_type","pages_per_unit"],"title":"PageRate"},"PdfToExcelRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"layout":{"type":"string","enum":["per-table","single-sheet"],"title":"Layout","default":"per-table"}},"type":"object","required":["file_id"],"title":"PdfToExcelRequest"},"PdfToJpgRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"dpi":{"type":"integer","enum":[72,150,300],"title":"Dpi","default":150},"pages":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Pages"}},"type":"object","required":["file_id"],"title":"PdfToJpgRequest"},"PdfToPptxRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"}},"type":"object","required":["file_id"],"title":"PdfToPptxRequest"},"PdfToTxtRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"mode":{"type":"string","enum":["text","words","blocks"],"title":"Mode","default":"text"}},"type":"object","required":["file_id"],"title":"PdfToTxtRequest"},"PdfToWordRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"}},"type":"object","required":["file_id"],"title":"PdfToWordRequest"},"PptxToPdfRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"}},"type":"object","required":["file_id"],"title":"PptxToPdfRequest"},"PriceItem":{"properties":{"key":{"type":"string","title":"Key"},"category":{"type":"string","title":"Category"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount"},"currency":{"type":"string","title":"Currency"}},"type":"object","required":["key","category","amount","currency"],"title":"PriceItem"},"ProtectRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"user_password":{"type":"string","minLength":1,"title":"User Password"},"owner_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Password"}},"type":"object","required":["file_id","user_password"],"title":"ProtectRequest"},"ReorderPagesRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"new_order":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"New Order"}},"type":"object","required":["file_id","new_order"],"title":"ReorderPagesRequest"},"RotateRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"pages":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"string","const":"all"}],"title":"Pages","default":"all"},"angle":{"type":"integer","enum":[90,180,270],"title":"Angle","default":90}},"type":"object","required":["file_id"],"title":"RotateRequest"},"SignRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"signature_data":{"type":"string","maxLength":3000000,"minLength":1,"title":"Signature Data"},"page":{"type":"integer","minimum":1,"title":"Page","default":1},"x":{"type":"number","maximum":1,"minimum":0,"title":"X","default":0.1},"y":{"type":"number","maximum":1,"minimum":0,"title":"Y","default":0.85},"width":{"type":"number","maximum":1,"exclusiveMinimum":0,"title":"Width","default":0.2},"height":{"type":"number","maximum":1,"exclusiveMinimum":0,"title":"Height","default":0.05}},"type":"object","required":["file_id","signature_data"],"title":"SignRequest"},"SplitPdfRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"mode":{"type":"string","enum":["every-page","ranges","half"],"title":"Mode","default":"every-page"},"ranges":{"anyOf":[{"items":{"prefixItems":[{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":2,"minItems":2},"type":"array"},{"type":"null"}],"title":"Ranges"}},"type":"object","required":["file_id"],"title":"SplitPdfRequest"},"TaskIdResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"}},"type":"object","required":["task_id"],"title":"TaskIdResponse"},"TaskStatusResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"},"status":{"type":"string","title":"Status"},"progress":{"type":"integer","title":"Progress","default":0},"estimated_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Estimated Seconds"},"input_file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input File Size"},"output_file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output File Size"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"}},"type":"object","required":["task_id","status"],"title":"TaskStatusResponse"},"TopupBonus":{"properties":{"from_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"From Amount"},"percent":{"type":"integer","title":"Percent"}},"type":"object","required":["from_amount","percent"],"title":"TopupBonus"},"UnlockRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"password":{"type":"string","minLength":1,"title":"Password"}},"type":"object","required":["file_id","password"],"title":"UnlockRequest"},"UploadResponse":{"properties":{"file_id":{"type":"string","title":"File Id"},"filename":{"type":"string","title":"Filename"},"size":{"type":"integer","title":"Size"}},"type":"object","required":["file_id","filename","size"],"title":"UploadResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WatermarkRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"image_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image File Id"},"font_size":{"type":"integer","maximum":200,"minimum":8,"title":"Font Size","default":48},"color":{"type":"string","title":"Color","default":"#FF0000"},"opacity":{"type":"number","maximum":1,"minimum":0,"title":"Opacity","default":0.3},"angle":{"type":"number","maximum":180,"minimum":-180,"title":"Angle","default":45},"position":{"type":"string","enum":["center","tile","top-left","top-right","bottom-left","bottom-right"],"title":"Position","default":"center"},"pages":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"string","const":"all"}],"title":"Pages","default":"all"},"scale":{"type":"number","maximum":2,"minimum":0.1,"title":"Scale","default":0.3}},"type":"object","required":["file_id"],"title":"WatermarkRequest"},"WordToPdfRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"}},"type":"object","required":["file_id"],"title":"WordToPdfRequest"},"XlsxToPdfRequest":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"https-адрес для уведомления о завершении; подпись — заголовок X-SmartPDF-Signature (см. описание API)"},"file_id":{"type":"string","title":"File Id"}},"type":"object","required":["file_id"],"title":"XlsxToPdfRequest"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}