/api/v1/meAccount, limits and usage
Returns the plan behind the key, the limits that apply to you (file size, pages, rate limit, daily jobs) and what you have used so far. A good first call to test a new key.
Success: 200 — The account object.
The Filezaro API is a REST API with JSON answers. Base address: https://filezaro.com/api/v1. Working with a file takes three calls: announce the file and upload its bytes, start a job, then read the result. Jobs run in the background, so there are no timeouts, even for large files.
The API is part of the Pro plan. A machine-readable description is available as OpenAPI 3.0.
Create a key in Dashboard → API keys and send it with every request:
Authorization: Bearer fz_live_...X-API-Key: fz_live_... is accepted as well. Keys are never read from the URL. A key is shown once when it is created; we store only a fingerprint. Revoking a key stops it immediately. The key acts as your account: its files, jobs and limits are yours. If your Pro plan ends, the API stops working until Pro is active again.
Try it: curl https://filezaro.com/api/v1/me -H "Authorization: Bearer $FILEZARO_API_KEY"
The same five steps in three languages. Replace the key with yours.
export FILEZARO_API_KEY="fz_live_..." # your key (Dashboard → API keys)
BASE="https://filezaro.com/api/v1"
# 1) Announce the file and get an upload address
curl -s -X POST "$BASE/files" \
-H "Authorization: Bearer $FILEZARO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filename":"report.pdf","contentType":"application/pdf","sizeBytes":482113}'
# -> {"id":"clx...","upload":{"url":"https://...","headers":{"Content-Type":"application/pdf"}}, ...}
# 2) Upload the bytes (same Content-Type as announced)
curl -X PUT "<upload.url from step 1>" \
-H "Content-Type: application/pdf" \
--data-binary @report.pdf
# 3) Start the job (the Idempotency-Key makes a retry safe)
curl -s -X POST "$BASE/jobs" \
-H "Authorization: Bearer $FILEZARO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"tool":"compress-pdf","fileId":"<id from step 1>","options":{"mode":"level","level":"recommended"}}'
# -> 202 {"id":"clj...","status":"queued", ...}
# 4) Ask for the status until it says "completed" (or "failed")
curl -s "$BASE/jobs/<job id>" -H "Authorization: Bearer $FILEZARO_API_KEY"
# 5) Download the result (-L follows the redirect)
curl -L -o report-compressed.pdf "$BASE/jobs/<job id>/download" \
-H "Authorization: Bearer $FILEZARO_API_KEY"// Node.js 18+ (built-in fetch). Run on your SERVER, never in a browser.
import { readFile, writeFile } from "node:fs/promises"
import { randomUUID } from "node:crypto"
const BASE = "https://filezaro.com/api/v1"
const KEY = process.env.FILEZARO_API_KEY
async function api(path, init = {}) {
const res = await fetch(BASE + path, {
...init,
headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json", ...init.headers },
})
if (res.status === 429) {
const wait = Number(res.headers.get("Retry-After") ?? 1)
await new Promise((r) => setTimeout(r, wait * 1000))
return api(path, init) // wait and retry
}
const body = res.status === 204 ? null : await res.json()
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message} (${body.error.requestId})`)
return body
}
const bytes = await readFile("report.pdf")
// 1) announce + 2) upload
const file = await api("/files", {
method: "POST",
body: JSON.stringify({ filename: "report.pdf", contentType: "application/pdf", sizeBytes: bytes.length }),
})
const put = await fetch(file.upload.url, { method: "PUT", headers: file.upload.headers, body: bytes })
if (!put.ok) throw new Error("Upload failed: " + put.status)
// 3) start the job
let job = await api("/jobs", {
method: "POST",
headers: { "Idempotency-Key": randomUUID() },
body: JSON.stringify({ tool: "compress-pdf", fileId: file.id, options: { mode: "level", level: "recommended" } }),
})
// 4) wait
while (job.status === "queued" || job.status === "processing") {
await new Promise((r) => setTimeout(r, 2000))
job = await api(`/jobs/${job.id}`)
}
if (job.status !== "completed") throw new Error(job.error?.message ?? job.status)
// 5) download
const result = await fetch(job.result.file.download.url)
await writeFile(job.result.file.name, Buffer.from(await result.arrayBuffer()))
console.log("Saved", job.result.file.name)# Python 3.9+ (pip install requests)
import os, time, uuid, requests
BASE = "https://filezaro.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['FILEZARO_API_KEY']}"}
def api(method, path, **kwargs):
while True:
r = requests.request(method, BASE + path, headers={**HEADERS, **kwargs.pop("headers", {})}, **kwargs)
if r.status_code == 429: # rate limited: wait, then retry
time.sleep(int(r.headers.get("Retry-After", 1)))
continue
body = r.json()
if not r.ok:
e = body["error"]
raise RuntimeError(f"{e['code']}: {e['message']} ({e['requestId']})")
return body
data = open("report.pdf", "rb").read()
# 1) announce + 2) upload
f = api("POST", "/files", json={"filename": "report.pdf", "contentType": "application/pdf", "sizeBytes": len(data)})
requests.put(f["upload"]["url"], data=data, headers=f["upload"]["headers"]).raise_for_status()
# 3) start the job
job = api("POST", "/jobs", headers={"Idempotency-Key": str(uuid.uuid4())},
json={"tool": "compress-pdf", "fileId": f["id"], "options": {"mode": "level", "level": "recommended"}})
# 4) wait
while job["status"] in ("queued", "processing"):
time.sleep(2)
job = api("GET", f"/jobs/{job['id']}")
if job["status"] != "completed":
raise RuntimeError(job.get("error", {}).get("message", job["status"]))
# 5) download
out = requests.get(job["result"]["file"]["download"]["url"])
open(job["result"]["file"]["name"], "wb").write(out.content)A finished job looks like this:
{
"id": "clx9k2m4a0001abcd",
"object": "job",
"tool": "compress-pdf",
"status": "completed",
"createdAt": "2026-11-17T09:30:12.000Z",
"updatedAt": "2026-11-17T09:30:19.000Z",
"fileIds": ["clx9k2l9z0000abcd"],
"options": { "mode": "level", "level": "recommended" },
"error": null,
"result": {
"file": {
"name": "report-compressed.pdf",
"size": 190342,
"contentType": "application/pdf",
"download": { "url": "https://…", "expiresInSeconds": 600 }
},
"text": null,
"hasText": false,
"info": { "achievedBytes": 190342, "originalBytes": 482113 }
}
}Job status: queued → processing → completed, or failed (see error.message), cancelled, expired (the result was deleted after its retention period). Poll every 1–3 seconds; most jobs finish in seconds.
POST /files returns upload.url, valid 15 minutes. Send the bytes with PUT and exactly the Content-Type you announced.result.file.download.url is valid 10 minutes; ask the job again for a fresh one. GET /jobs/{id}/download redirects to it.Idempotency-Key: <unique text> on POST /jobs. The same key returns the same job (status 200, header Idempotent-Replayed: true) instead of creating another. Reusing a key for a different request is an error.data, hasMore and nextCursor. Pass nextCursor as cursor to get the next page.X-Request-Id header (also in error bodies). Quote it when you contact support.DELETE /jobs/{id}./jobs shows jobs created through the API. Jobs you started on the website are in your dashboard history.| Limit | Pro | What happens when reached |
|---|---|---|
| Requests per minute | 120 | 429 rate_limited with Retry-After |
| Jobs per 24 hours (rolling) | 1,000 | 429 quota_exceeded with Retry-After |
| Jobs running at the same time | 10 | 429 too_many_active_jobs |
| File size, pages, storage | Same as Pro on the website | See GET /me → limits |
Limits count for the whole account, not per key. Every answer carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix seconds). Failed jobs do not use up the daily limit. Too many requests with a wrong key from one address are also answered with 429.
/api/v1/meReturns the plan behind the key, the limits that apply to you (file size, pages, rate limit, daily jobs) and what you have used so far. A good first call to test a new key.
Success: 200 — The account object.
/api/v1/toolsno key neededEvery tool with its accepted file types, options (names, types, allowed values, defaults) and an example request. No API key needed.
Success: 200 — A list of tool objects.
/api/v1/tools/{id}no key neededOne tool, e.g. `compress-pdf`. No API key needed.
Success: 200 — A tool object. Typical errors: not_found
/api/v1/filesStep 1 of every job. Tell us the file name, type and size; you get back a file id and a one-time `upload.url`. Send the file bytes there with `PUT` and the same `Content-Type` header. The bytes go straight to storage, not through our servers.
| Body field | Type | Description |
|---|---|---|
filename* | string | File name, up to 255 characters (any language). |
contentType* | string | image/png, image/jpeg, image/webp, application/pdf, text/plain, text/markdown, text/html or the .docx type. |
sizeBytes* | integer | Exact size of the file in bytes (at most your plan's limit). |
Success: 201 — A file object with `upload` (method, url, headers). Typical errors: payload_too_large, storage_full, unsupported_media_type
/api/v1/files/{id}Returns the file and `uploaded: true` once the bytes have arrived in storage.
Success: 200 — A file object. Typical errors: not_found, file_expired
/api/v1/jobsStep 2. Runs one tool on files you uploaded. Single-file tools take `fileId`; Merge PDF and Images to PDF take `fileIds` (in the order you want). The job runs in the background: you get `202 Accepted` and poll `GET /jobs/{id}`. Send an `Idempotency-Key` header to make retries safe.
| Body field | Type | Description |
|---|---|---|
tool* | string | A tool id from GET /tools, e.g. compress-pdf. |
fileId | string | Input file (single-file tools). |
fileIds | string[] | Input files in order (Merge PDF, Images to PDF). |
options | object | Tool options. Unknown option names are rejected. |
Success: 202 — A job object with status `queued` (200 when an Idempotency-Key replays an earlier job). Typical errors: invalid_request, not_found, file_not_uploaded, file_expired, unsupported_media_type, too_many_active_jobs, quota_exceeded, idempotency_key_reused
/api/v1/jobsYour API jobs, newest first, in pages. Pass `nextCursor` from one answer as `cursor` of the next request.
| Query parameter | Type | Description |
|---|---|---|
limit | integer | 1–100, default 20. |
cursor | string | `nextCursor` of the previous page. |
status | string | queued, processing, completed, failed, cancelled or expired. |
tool | string | Only jobs of this tool. |
Success: 200 — A list: `data`, `hasMore`, `nextCursor`.
/api/v1/jobs/{id}Status and result. When `status` is `completed`, `result.file.download.url` is a fresh address valid for 10 minutes; text results (OCR, AI summary) are in `result.text`.
Success: 200 — A job object. Typical errors: not_found
/api/v1/jobs/{id}/downloadRedirects (302) to a 10-minute download address — use `curl -L`. Text-only results (OCR) are returned as a UTF-8 .txt file.
Success: 302 — Redirect to the file (or 200 with the text). Typical errors: not_found, conflict, file_expired
/api/v1/jobs/{id}Removes the result and, when nothing else uses it, the uploaded original. Frees cloud storage. A running job cannot be deleted.
Success: 200 — `{ id, object: "job", deleted: true }`. Typical errors: not_found, conflict
/api/v1/openapi.jsonno key neededThe whole API as an OpenAPI 3.0 file. Import it into Postman or Insomnia, or generate a client library from it. No API key needed.
Success: 200 — An OpenAPI 3.0 document.
Use the tool id as "tool" in POST /jobs. Options not listed here are rejected; options you leave out use their default. The live version of this list is GET /tools.
jpg-to-pngConvert an image to PNG.
Input: one file in "fileId" — image/png, image/jpeg, image/webp
Result: A PNG image.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
backgroundColor | string | Fill colour for transparent areas, as "#RRGGBB" (matters when the result cannot be transparent, e.g. JPG). |
Fixed by this tool: {"targetFormat":"png"}
{
"tool": "jpg-to-png",
"fileId": "<file id>",
"options": {}
}png-to-jpgConvert an image to JPG.
Input: one file in "fileId" — image/png, image/jpeg, image/webp
Result: A JPG image.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
backgroundColor | string | Fill colour for transparent areas, as "#RRGGBB" (matters when the result cannot be transparent, e.g. JPG). |
Fixed by this tool: {"targetFormat":"jpg"}
{
"tool": "png-to-jpg",
"fileId": "<file id>",
"options": {
"backgroundColor": "#ffffff"
}
}webp-converterConvert an image to or from WebP.
Input: one file in "fileId" — image/png, image/jpeg, image/webp
Result: An image in the chosen format.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
targetFormat* | string | one of png, jpg, webp | The format of the result. |
backgroundColor | string | Fill colour for transparent areas, as "#RRGGBB" (matters when the result cannot be transparent, e.g. JPG). |
{
"tool": "webp-converter",
"fileId": "<file id>",
"options": {
"targetFormat": "webp"
}
}compress-imageMake an image smaller, by quality or down to a target file size.
Input: one file in "fileId" — image/png, image/jpeg, image/webp
Result: The compressed image (same format family).
| Option | Type | Allowed / default | Description |
|---|---|---|---|
mode* | string | one of quality, target-size | "quality" uses `quality`; "target-size" shrinks the image to about `targetBytes`. |
quality | integer | 1–100 (required when mode is "quality") | Quality, 1 (smallest) to 100 (best). |
targetBytes | integer | 1024–209715200 (required when mode is "target-size") | Wanted size in bytes (e.g. 102400 = 100 KB). |
{
"tool": "compress-image",
"fileId": "<file id>",
"options": {
"mode": "quality",
"quality": 75
}
}resize-imageResize an image to exact dimensions or by percentage.
Input: one file in "fileId" — image/png, image/jpeg, image/webp
Result: The resized image. At least one of width, height or percentage is required.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
width | integer | 1–10000 | New width in pixels. |
height | integer | 1–10000 | New height in pixels. |
percentage | number | 1–100 | Scale to this percent of the original size. |
maintainAspectRatio | boolean | default true | Keep the proportions when only one of width/height is used. |
format | string | one of png, jpg, webp | Also convert to this format (default: keep the format). |
{
"tool": "resize-image",
"fileId": "<file id>",
"options": {
"width": 800,
"maintainAspectRatio": true
}
}image-to-textRead the text in a picture (OCR).
Input: one file in "fileId" — image/png, image/jpeg, image/webp
Result: The text, in `result.text`. GET /jobs/{id}/download returns it as a .txt file.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
language | string | default auto | Reading language. Leave it out (or "auto") and the language is detected from the picture — Bengali, Hindi, Arabic, Chinese, Russian and many more, even several scripts on one page. To force it, send Tesseract codes joined with "+", e.g. "ben" or "ben+eng" (up to 4). |
{
"tool": "image-to-text",
"fileId": "<file id>",
"options": {}
}remove-backgroundRemove the background of an image.
Input: one file in "fileId" — image/png, image/jpeg, image/webp
Result: A PNG with a transparent background.
No options.
{
"tool": "remove-background",
"fileId": "<file id>",
"options": {}
}remove-metadataStrip EXIF / GPS and other metadata from an image.
Input: one file in "fileId" — image/png, image/jpeg, image/webp
Result: The image without metadata.
No options.
{
"tool": "remove-metadata",
"fileId": "<file id>",
"options": {}
}pdf-to-textExtract the text of a PDF (scanned or damaged pages are read with OCR).
Input: one file in "fileId" — application/pdf
Result: A UTF-8 .txt file.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
preserveLayout | boolean | default false | Try to keep the columns/spacing of the page. |
{
"tool": "pdf-to-text",
"fileId": "<file id>",
"options": {
"preserveLayout": false
}
}pdf-to-imagesRender PDF pages as images.
Input: one file in "fileId" — application/pdf
Result: One image, or a .zip when there are several pages.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
format | string | one of png, jpg; default png | Image format. |
dpi | integer | one of 72, 100, 150, 200, 300; default 150 | Resolution in pixels per inch. |
pages | string | default all | Pages to render: "all" or a list such as "1-3,5,8-". |
{
"tool": "pdf-to-images",
"fileId": "<file id>",
"options": {
"format": "png",
"dpi": 150,
"pages": "1-3"
}
}images-to-pdfCombine several images into one PDF (in the order of `fileIds`).
Input: several files in "fileIds" (at least 1, in the order you want) — image/png, image/jpeg, image/webp
Result: One PDF.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
pageSize | string | one of fit, a4, letter; default a4 | "fit" makes every page as big as its image. |
orientation | string | one of auto, portrait, landscape; default auto | Page orientation. |
margin | string | one of none, small, medium; default small | Page margin. |
{
"tool": "images-to-pdf",
"fileIds": [
"<file id>",
"<file id>"
],
"options": {
"pageSize": "a4",
"orientation": "auto",
"margin": "small"
}
}pdf-to-wordConvert a PDF to an editable Word (.docx) document.
Input: one file in "fileId" — application/pdf
Result: A .docx file. Fidelity is never perfect for complex layouts.
No options.
{
"tool": "pdf-to-word",
"fileId": "<file id>",
"options": {}
}merge-pdfCombine several PDFs into one (in the order of `fileIds`).
Input: several files in "fileIds" (at least 2, in the order you want) — application/pdf
Result: One PDF.
No options.
{
"tool": "merge-pdf",
"fileIds": [
"<file id>",
"<file id>"
],
"options": {}
}split-pdfSplit a PDF by page ranges, every N pages, or one file per page.
Input: one file in "fileId" — application/pdf
Result: One PDF, or a .zip when there are several parts.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
mode* | string | one of ranges, extract, every, each | "ranges": every range becomes its own PDF. "extract": all chosen pages go into ONE new PDF. "every": a new PDF every N pages. "each": one PDF per page. |
ranges | string | (required when mode is "ranges" or "extract") | Page ranges such as "1-3,5,8-". |
every | integer | 1–1000 (required when mode is "every") | Pages per part. |
{
"tool": "split-pdf",
"fileId": "<file id>",
"options": {
"mode": "ranges",
"ranges": "1-3,5"
}
}compress-pdfMake a PDF smaller, by level or down to a target size.
Input: one file in "fileId" — application/pdf
Result: The smaller PDF (or the original with a note when compression would damage its text).
| Option | Type | Allowed / default | Description |
|---|---|---|---|
mode* | string | one of level, target-size | "level" uses `level`; "target-size" uses `targetBytes`. |
level | string | one of low, recommended, strong (required when mode is "level") | How hard to compress. |
targetBytes | integer | 10240–209715200 (required when mode is "target-size") | Wanted size in bytes. |
{
"tool": "compress-pdf",
"fileId": "<file id>",
"options": {
"mode": "level",
"level": "recommended"
}
}txt-to-pdfTurn a plain-text file into a PDF (every language, right-to-left included).
Input: one file in "fileId" — text/plain
Result: A PDF.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
pageSize | string | one of a4, letter, legal; default a4 | Paper size. |
orientation | string | one of portrait, landscape; default portrait | Page orientation. |
margin | string | one of none, small, medium, large; default medium | Page margin. |
pageNumbers | boolean | default false | Print “1 / 5” page numbers at the bottom of every page. |
fontFamily | string | one of sans, serif, monospace; default sans | Font style. |
fontSize | integer | 8–24; default 11 | Font size in points. |
{
"tool": "txt-to-pdf",
"fileId": "<file id>",
"options": {
"pageSize": "a4",
"fontFamily": "serif",
"fontSize": 12
}
}docx-to-pdfConvert a Word .docx file to PDF. Every layout value defaults to "original" (the document as its author made it).
Input: one file in "fileId" — application/vnd.openxmlformats-officedocument.wordprocessingml.document
Result: A PDF.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
pageSize | string | one of original, a4, letter, legal; default original | Paper size. |
orientation | string | one of original, portrait, landscape; default original | Page orientation. |
margin | string | one of original, none, small, medium, large; default original | Page margin. |
fontFamily | string | one of original, sans, serif, monospace; default original | Body font style. |
fontSize | integer or "original" | 6–36; default original | Body text size in points, or "original". |
pageNumbers | boolean | default false | Print “1 / 5” page numbers at the bottom of every page. |
{
"tool": "docx-to-pdf",
"fileId": "<file id>",
"options": {}
}markdown-to-pdfTurn a Markdown (.md) or text file into a styled PDF.
Input: one file in "fileId" — text/markdown, text/plain
Result: A PDF.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
pageSize | string | one of a4, letter, legal; default a4 | Paper size. |
orientation | string | one of portrait, landscape; default portrait | Page orientation. |
margin | string | one of none, small, medium, large; default medium | Page margin. |
pageNumbers | boolean | default false | Print “1 / 5” page numbers at the bottom of every page. |
theme | string | one of clean, serif; default clean | Look of the document. |
{
"tool": "markdown-to-pdf",
"fileId": "<file id>",
"options": {
"theme": "clean"
}
}html-to-pdfPrint an HTML file to PDF. Scripts and external resources (images, CSS from the internet) are intentionally not loaded.
Input: one file in "fileId" — text/html
Result: A PDF.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
pageSize | string | one of a4, letter, legal; default a4 | Paper size. |
orientation | string | one of portrait, landscape; default portrait | Page orientation. |
margin | string | one of none, small, medium, large; default medium | Page margin. |
pageNumbers | boolean | default false | Print “1 / 5” page numbers at the bottom of every page. |
printBackground | boolean | default true | Print background colours and images. |
{
"tool": "html-to-pdf",
"fileId": "<file id>",
"options": {
"printBackground": true
}
}text-to-docxTurn a plain-text file into a Word document (every script gets a font that contains its letters).
Input: one file in "fileId" — text/plain
Result: A .docx file.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
fontFamily | string | one of Calibri, Arial, Times New Roman, Courier New; default Calibri | Font for Latin, Cyrillic and Greek text. |
fontSize | integer | 8–32; default 11 | Font size in points. |
lineSpacing | number | one of 1, 1.15, 1.5, 2; default 1.15 | Line spacing. |
pageSize | string | one of a4, letter; default a4 | Paper size. |
margin | string | one of narrow, normal, wide; default normal | Page margin. |
paragraphs | string | one of blank-line, every-line; default blank-line | "blank-line": an empty line starts a new paragraph. "every-line": every line is a paragraph. |
firstLineIsTitle | boolean | default false | Format the first line as a title. |
{
"tool": "text-to-docx",
"fileId": "<file id>",
"options": {
"fontFamily": "Calibri",
"fontSize": 12,
"firstLineIsTitle": true
}
}ocrRead the text of an image or of a PDF (text pages are copied, scanned pages are read with OCR).
Input: one file in "fileId" — image/png, image/jpeg, image/webp, application/pdf
Result: The text, in `result.text`. GET /jobs/{id}/download returns it as a .txt file.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
language | string | default auto | Reading language. Leave it out (or "auto") and the language is detected from the picture — Bengali, Hindi, Arabic, Chinese, Russian and many more, even several scripts on one page. To force it, send Tesseract codes joined with "+", e.g. "ben" or "ben+eng" (up to 4). |
mode | string | one of auto, force; default auto | PDF only. "auto" uses the text layer where a page has one; "force" runs OCR on every page. |
pageMarkers | boolean | default false | Put a "--- Page 3 ---" line before the text of each PDF page. |
{
"tool": "ocr",
"fileId": "<file id>",
"options": {
"mode": "auto",
"pageMarkers": true
}
}pdf-summarySummarise a PDF with AI. The PDF text is sent to the AI service configured on the server.
Input: one file in "fileId" — application/pdf
Result: The summary as Markdown in `result.text` and as a UTF-8 .txt file.
| Option | Type | Allowed / default | Description |
|---|---|---|---|
length | string | one of short, medium, detailed; default medium | About 100 / 250 / 600 words. |
format | string | one of standard, bullets, executive; default standard | Layout of the summary. |
language | string | default auto | "auto" = the language of the document, or one of: en, bn, hi, ur, ar, fa, he, tr, id, ms, vi, th, zh-Hans, zh-Hant, ja, ko, es, fr, de, it, pt, ru, uk, pl, nl, el, sv, da, fi, cs, ro, hu, ta, te, mr, gu, pa, ne, si, km, my, sw, fil. |
focus | string | –300 | Optional wish about emphasis, e.g. "focus on costs" (up to 300 characters). |
{
"tool": "pdf-summary",
"fileId": "<file id>",
"options": {
"length": "short",
"format": "bullets",
"language": "auto"
}
}Failed requests use a normal HTTP status and a JSON body with a stable code:
{
"error": {
"code": "invalid_request",
"message": "Choose a compression level or a target size",
"details": [{ "path": "options", "message": "Choose a compression level or a target size" }],
"requestId": "req_3f9a1c0d7be2415a90"
}
}| Code | Status | Meaning |
|---|---|---|
invalid_request | 400 | The request is malformed or an option is wrong. `error.details` lists the fields. |
unauthorized | 401 | No API key was sent. |
invalid_api_key | 401 | The key does not exist. |
api_key_revoked | 401 | The key was revoked in the dashboard. |
api_key_expired | 401 | The key passed its expiry date. |
plan_required | 403 | The account is not on Pro (anymore), or the plan does not allow this many files. |
not_found | 404 | The file, job or tool does not exist (or belongs to somebody else). |
conflict | 409 | The job is not in the right state (still running / not completed). |
file_not_uploaded | 409 | The file was created but its bytes were not uploaded yet. |
idempotency_key_reused | 409 | The Idempotency-Key belongs to a different request. |
file_expired | 410 | The file or result passed its retention period and was deleted. |
payload_too_large | 413 | The file is bigger than your plan allows. |
storage_full | 413 | Your cloud storage is full. |
unsupported_media_type | 415 | The file type does not fit the tool, or the body is not JSON. |
rate_limited | 429 | Too many requests per minute. Wait `Retry-After` seconds. |
too_many_active_jobs | 429 | Too many jobs are running at once. Wait for some to finish. |
quota_exceeded | 429 | The daily API job limit is used up. Wait `Retry-After` seconds. |
internal_error | 500 | A bug on our side. Quote `error.requestId` to support. |
service_unavailable | 503 | Processing could not be started. Retry shortly. |
Retry on 429, 500 and 503 after waiting (use Retry-After when present), and always together with the same Idempotency-Key for POST /jobs. Do not retry other 4xx answers: the request itself must change.