{
    "openapi": "3.0.3",
    "info": {
        "title": "HTML to PDF \u2014 Ksty.ch",
        "version": "1.0",
        "description": "Render HTML into a paginated PDF \u2014 page size, margins, running headers/footers, metadata and password protection.\n\n# HTML to PDF API\n\nTurns HTML into a real, paginated PDF. Send the markup with `html`, or a `url` to fetch, and you get back a document with the page size, margins, running headers and footers you asked for \u2014 the things a browser's print dialog does, but as an API call you can make from a server with no browser on it.\n\nRendering is synchronous: one request in, one finished PDF out. There is no job to poll and no file to clean up afterwards.\n\n## Your first call\n\n```\nPOST /api/v1/html-to-pdf\nX-Api-Key: ksty_test_...\nContent-Type: application/json\n\n{\"html\": \"<h1>Invoice #1042</h1><p>Thanks for your business.</p>\", \"filename\": \"invoice-1042.pdf\"}\n```\n\n```json\n{\n  \"filename\": \"invoice-1042.pdf\",\n  \"content_type\": \"application/pdf\",\n  \"bytes\": 12894,\n  \"pages\": 1,\n  \"page_size\": \"A4\",\n  \"orientation\": \"portrait\",\n  \"encrypted\": false,\n  \"assets_blocked\": [],\n  \"pdf_base64\": \"JVBERi0xLjQKJeLj...\"\n}\n```\n\n## Getting the file, not JSON\n\nThe default JSON response carries the document in `pdf_base64` \u2014 decode it and write it to disk:\n\n```php\n$pdf = base64_decode($response['pdf_base64']);\nfile_put_contents($response['filename'], $pdf);\n```\n\nIf you would rather have the bytes straight, send `\"output\": \"binary\"` (or an `Accept: application/pdf` header) and the response body *is* the PDF, with `Content-Type: application/pdf`, a `Content-Disposition` naming your file, and `X-Pdf-Pages` / `X-Pdf-Bytes` headers:\n\n```\ncurl -X POST https://ksty.ch/api/v1/html-to-pdf \\\n  -H \"X-Api-Key: ksty_live_...\" -H \"Content-Type: application/json\" \\\n  -d '{\"html\":\"<h1>Hi</h1>\",\"output\":\"binary\"}' -o out.pdf\n```\n\nErrors are always JSON, even in binary mode \u2014 check the content type or the status code before writing the body to a file.\n\n## Page setup\n\n- `page_size` \u2014 `A3`, `A4` (default), `A5`, `Letter`, `Legal`, `Tabloid` or `Ledger`.\n- `orientation` \u2014 `portrait` (default) or `landscape`.\n- `margin` \u2014 millimetres. A single number sets all four sides; an object sets them individually, and any side you leave out keeps its default (`{\"top\":16,\"right\":15,\"bottom\":16,\"left\":15}`).\n\n```json\n{\"html\": \"\u2026\", \"page_size\": \"Letter\", \"orientation\": \"landscape\", \"margin\": {\"top\": 25, \"bottom\": 25}}\n```\n\n## Headers, footers and page numbers\n\n`header_html` and `footer_html` are small HTML fragments repeated on every page, laid out inside the top and bottom margins. Four placeholders are substituted as the document paginates:\n\n| Placeholder | Becomes |\n|---|---|\n| `{PAGENO}` | the current page number |\n| `{nb}` | the total page count |\n| `{DATE j-m-Y}` | today's date, in any PHP date format |\n| `{PAGENO}/{nb}` | the usual \"3/12\" pairing |\n\n```json\n{\n  \"html\": \"<h1>Quarterly report</h1>\u2026\",\n  \"header_html\": \"<div style='text-align:right;font-size:9pt;color:#888'>Acme Inc \u2014 Q3</div>\",\n  \"footer_html\": \"<div style='text-align:center;font-size:9pt'>Page {PAGENO} of {nb}</div>\"\n}\n```\n\nGive a header or footer room to sit in \u2014 with the default 16 mm top margin there is space for one line. If your header wraps onto two, raise `margin.top` to match or the body text will start underneath it.\n\n## Styling\n\nInline `style` attributes and `<style>` blocks in your HTML both work, and `css` adds a stylesheet on top of them \u2014 handy when the markup comes from somewhere you don't control:\n\n```json\n{\"html\": \"<table>\u2026</table>\", \"css\": \"body{font-family:sans-serif} table{width:100%;border-collapse:collapse} td{border:1px solid #ddd;padding:6px}\"}\n```\n\nSupported CSS is print-oriented: the box model, tables, colours, borders, backgrounds, fonts, and the page-break properties (`page-break-before`, `page-break-after`, `page-break-inside: avoid`) \u2014 including `<div style=\"page-break-after:always\"></div>` to force a new page. Flexbox and CSS grid are **not** supported; use tables or floats for print layout.\n\n## Assets: what can and cannot be loaded\n\nBecause you supply the markup, you also supply every URL in it \u2014 so the renderer is strict about what it will go and fetch:\n\n- **Local files are never read.** A `src` pointing at a path on the gateway's disk resolves to nothing.\n- **Remote URLs are off by default.** Pass `remote_assets: true` to allow `http(s)` images and stylesheets. Each one is then checked (public addresses only, redirects re-checked, 5 s timeout, 5 MB each, 25 per document).\n- **`data:` URIs always work.** They are already in your payload \u2014 nothing is fetched.\n\nAnything refused is skipped, not fatal: the PDF still renders and every skipped asset is listed in `assets_blocked` with the reason, so a missing logo is something you can see rather than guess at.\n\n```json\n{\"assets_blocked\": [{\"url\": \"/var/www/logo.png\", \"reason\": \"local file access is not permitted\"}]}\n```\n\nFor a logo or a signature image, embedding it as a `data:` URI is both faster and more reliable than a URL \u2014 nothing to fetch, nothing to time out.\n\n### Relative paths need a base\n\nA page written to be served from a web root refers to its assets relatively \u2014 `assets/css/main.css`, `images/pic01.jpg`. Those are meaningless on their own, so `base_url` says where they live:\n\n```json\n{\"html\": \"\u2026<link rel=\\\"stylesheet\\\" href=\\\"assets/css/main.css\\\">\u2026\", \"base_url\": \"https://example.com/site/\", \"remote_assets\": true}\n```\n\nEvery relative path is then resolved against it (`https://example.com/site/assets/css/main.css`) and fetched under the rules above. When you use `url`, `base_url` defaults to that URL, so a fetched page's own assets resolve without you saying anything. Without a base, relative assets resolve to nothing and the document renders as unstyled text \u2014 which is the usual reason a saved-from-the-browser HTML file comes back looking bare.\n\n## Rendering a live page\n\n`url` fetches a page and renders it. The fetch is a single guarded GET (public http(s) only, \u22643 redirects each re-checked, 8 s timeout, 3 MB cap) and a failure costs you nothing.\n\n```json\n{\"url\": \"https://example.com\", \"remote_assets\": true}\n```\n\nNote that a page fetched this way is usually *not* styled the way you see it in a browser: its CSS and images are external, so they only load with `remote_assets: true`, and anything drawn by JavaScript after load was never in the HTML at all. For pages that render client-side, get the final HTML yourself and pass it as `html`.\n\n## Document properties and protection\n\n`title`, `author` and `subject` populate the PDF's info panel. `password` encrypts the document \u2014 readers prompt for it on open, and printing and copying stay allowed:\n\n```json\n{\"html\": \"\u2026\", \"title\": \"Payslip \u2014 March\", \"author\": \"Acme Payroll\", \"password\": \"s3cret\"}\n```\n\nLost passwords cannot be recovered. The document is encrypted with the password you send and never stored, so re-rendering is the only way back in.\n\n## Merging several documents into one PDF\n\n`documents` takes a list and renders it as a single PDF, in order, with a page break between each:\n\n```json\n{\n  \"documents\": [\n    {\"html\": \"<h1>Cover</h1>\"},\n    {\"html\": \"<h1>Statement</h1><table>\u2026</table>\", \"css\": \"table{width:100%}\"},\n    {\"url\": \"https://example.com/terms\"}\n  ],\n  \"footer_html\": \"<div style='text-align:center'>Page {PAGENO} of {nb}</div>\"\n}\n```\n\nEach entry takes the same `html` / `url` pair as a single call, plus an optional `css`; a bare string is shorthand for `{\"html\": \"\u2026\"}`. The response adds a `documents` count.\n\nThe reason to merge here rather than make three calls and stitch the results yourself is pagination: `{PAGENO}` and `{nb}` run continuously across the whole set, so page 4 of 9 really says \"4 of 9\". Page setup, margins, headers and footers are shared \u2014 once merged there is one document, so one cascade, and a per-document `css` is appended to the shared stylesheet rather than scoped to its section.\n\nUp to **10** documents per call, and the combined HTML still has to fit the 2 MB input budget.\n\n## Page images\n\n`html-to-pdf.image` renders the document exactly as the PDF endpoints do, then returns **one page as a PNG** \u2014 for thumbnails, previews in your own UI, or anywhere shipping a PDF viewer is more trouble than it is worth:\n\n```\nPOST /api/v1/html-to-pdf.image\n{\"html\": \"<h1>Invoice #1042</h1>\", \"page\": 1, \"width\": 900}\n```\n\n```json\n{\"page\":1,\"pages\":1,\"width\":900,\"height\":1273,\"bytes\":139014,\"content_type\":\"image/png\",\"image_base64\":\"iVBORw0KGgo\u2026\"}\n```\n\n- `page` \u2014 which page, 1-based (default 1). Asking for a page the document does not have is a free `invalid_request`, and the error tells you how many there are.\n- `width` \u2014 80 to 2000 px; the height follows the page's aspect ratio.\n- `output: \"binary\"` streams the raw PNG, same as it does for the PDF.\n\nIt costs 3 credits rather than 2: the document is rendered *and* rasterised.\n\n> Page images need a PDF-capable ImageMagick on the server. Where that is missing \u2014 or where its `policy.xml` disables the PDF coder, which is a common hardening default \u2014 the endpoint answers `preview_unavailable` (503) and **does not charge you**. The PDF endpoints are unaffected, so a `503` here is never a sign that rendering itself is broken.\n\n## Rendering it exactly as the browser draws it\n\nThe default engine is mPDF: fast, pure PHP, print-oriented \u2014 and, as the Limits say, no JavaScript and no flexbox or grid. When you need the PDF to look like the page looks in a browser, `html-to-pdf.browser` renders through headless Chrome instead:\n\n```\nPOST /api/v1/html-to-pdf.browser\n{\"html\": \"<div style='display:grid;grid-template-columns:1fr 1fr'>\u2026</div>\", \"wait_ms\": 250}\n```\n\nEverything a browser does, it does: flexbox and grid, gradients, `box-shadow`, custom properties, and **your scripts run** before the page is printed. The response is identical in shape to the mPDF one, with `\"engine\": \"chrome\"` so you can tell them apart.\n\nIt costs **8 credits** rather than 2, because a browser process is started for the call. Expect roughly 1\u20132 seconds.\n\n- `wait_ms` \u2014 extra settle time for scripts that finish after `load` (default 250, max 3000). Raise it if a chart or a font renders a moment late.\n- `header_html` / `footer_html` work here too: the same `{PAGENO}` / `{nb}` / `{DATE \u2026}` placeholders are translated to Chrome's own template syntax, so one syntax works on both engines.\n\n> **This engine has no network access, by design.** Your JavaScript runs inside a real browser, so an engine that could fetch would be able to read internal services and paint the response into the PDF you get back. Chrome is therefore launched with all outbound requests failing, including to localhost. Everything must be *in* the payload: inline `<style>`, the `css` parameter, and `data:` URIs for images. `remote_assets` and `base_url` do nothing here \u2014 an external stylesheet or image simply will not load. `url` mode still works, because the gateway fetches that page itself (guarded) and hands Chrome the markup.\n\nWhich engine to reach for:\n\n| | `html-to-pdf` (mPDF) | `html-to-pdf.browser` (Chrome) |\n|---|---|---|\n| Cost | 2 credits | 8 credits |\n| Speed | ~0.3\u20131 s | ~1\u20132 s |\n| Flexbox / grid | no | yes |\n| JavaScript | no | yes |\n| Remote images / CSS | opt-in via `remote_assets` | never \u2014 inline or `data:` only |\n| Best for | invoices, statements, reports | dashboards, marketing pages, anything designed for screen |\n\n## Endpoints\n\n- `html-to-pdf` \u2014 render and return the document.\n- `html-to-pdf.info` \u2014 render exactly the same document and return only the *facts* about it (`pages`, `bytes`, `assets_blocked`) with no payload. Useful while you iterate on a template and only want to know \"does this still fit on one page?\" without moving a megabyte of base64 around. It costs the same, because the same rendering work happens.\n- `html-to-pdf.image` \u2014 render, then return one page as a PNG (3 credits).\n- `html-to-pdf.browser` \u2014 render through headless Chrome, exactly as a browser draws it (8 credits).\n\n## Limits\n\n- `html` up to 2 MB (or 2 MB combined across `documents`), `css` up to 200 KB, 10 documents per merge.\n- `max_pages` (default 50, maximum 200) refuses an over-long document rather than returning it \u2014 an unbounded template is usually a bug, and you are not charged when it trips.\n- No JavaScript, no flexbox and no CSS grid on the default engine \u2014 it is a print renderer, not a browser. Use `html-to-pdf.browser` when you need those.\n\n## Errors\n\nEvery error is JSON, and the ones you can cause by accident are free \u2014 `invalid_request`, `payload_too_large`, `fetch_failed`, `render_failed`, `too_many_pages`, `preview_unavailable` and `engine_unavailable` all return **0 credits charged**. You pay for documents you receive.\n\n## When to use it\n\n- Invoices, receipts, payslips and contracts generated from a template you already render as HTML.\n- Reports and statements that need real page numbers and a running header.\n- Statement packs: a cover, a body and standing terms merged into one correctly-paginated file.\n- Turning a rendered email or article into an archivable file.\n- Thumbnails of any of the above, via `.image`, without a PDF viewer in your stack.",
        "x-credit-cost": 2,
        "x-free-grant": {
            "type": "monthly",
            "amount": 40
        },
        "x-sandbox": true
    },
    "servers": [
        {
            "url": "https://ksty.ch/api/v1"
        }
    ],
    "security": [
        {
            "ApiKeyAuth": []
        }
    ],
    "paths": {
        "/html-to-pdf": {
            "get": {
                "operationId": "html-to-pdf_get",
                "summary": "Render HTML (or a fetched URL) into a PDF document",
                "x-credit-cost": 2,
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "filename": "document.pdf",
                                    "content_type": "application/pdf",
                                    "bytes": 12894,
                                    "pages": 1,
                                    "page_size": "A4",
                                    "orientation": "portrait",
                                    "encrypted": false,
                                    "assets_blocked": [],
                                    "pdf_base64": "JVBERi0xLjQK\u2026"
                                },
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "filename": {
                                            "type": "string",
                                            "description": "The name you asked for, or document.pdf. Also used in Content-Disposition when output=binary."
                                        },
                                        "content_type": {
                                            "type": "string",
                                            "description": "Always application/pdf."
                                        },
                                        "bytes": {
                                            "type": "integer",
                                            "description": "Size of the finished document, before base64 encoding."
                                        },
                                        "pages": {
                                            "type": "integer",
                                            "description": "Pages in the finished document \u2014 useful for billing your own users, or for checking a document is the length you expected."
                                        },
                                        "page_size": {
                                            "type": "string",
                                            "description": "The paper size that was applied."
                                        },
                                        "orientation": {
                                            "type": "string",
                                            "description": "portrait or landscape, as applied."
                                        },
                                        "encrypted": {
                                            "type": "boolean",
                                            "description": "true when a password was set, so readers will prompt on open."
                                        },
                                        "assets_blocked": {
                                            "type": "array",
                                            "description": "Asset URLs the guard refused, with the reason. **This is a successful response, not an error** \u2014 the document rendered without them. Check this array if an image is missing: local paths are always refused, and remote URLs need remote_assets: true."
                                        },
                                        "pdf_base64": {
                                            "type": "string",
                                            "description": "The document, base64-encoded. Absent when output=binary, where the response body is the PDF itself."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_request \u2014 No document was supplied (\"html\", \"url\" and \"documents\" all missing), a parameter is out of range (unknown page_size, orientation other than portrait/landscape, a base_url that is not http(s)), or the \"documents\" array is malformed or longer than 10 entries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid API key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient credits \u2014 nothing is charged and the API is never reached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key is not scoped to this API, or a test key was used on an API without sandbox support",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "payload_too_large \u2014 The HTML exceeds 2 MB, the extra CSS exceeds 200 KB, or several merged documents exceed the combined 2 MB budget.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "render_failed \u2014 The renderer could not turn your markup into a page \u2014 unsupported CSS or markup it cannot lay out.\n\ntoo_many_pages \u2014 The finished document has more pages than \"max_pages\" allows (default 50).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded for this key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "fetch_failed \u2014 A \"url\" (or a url inside \"documents\") could not be fetched: timeout, non-2xx, oversize body, or an address in a blocked range.\n\nThe API failed after being charged; credits are refunded automatically",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "engine_unavailable \u2014 Only on .browser \u2014 the headless Chrome engine is not installed or cannot start on this server.\n\npreview_unavailable \u2014 Only on .image \u2014 the rasteriser needed to turn a page into a PNG is missing on this server.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "description": "The default engine is mPDF \u2014 pure PHP, no browser process, so the call is a single synchronous\nrequest with nothing to poll and nothing to clean up. It handles the CSS that print layouts actually\nuse: page size and margins, running headers and footers, tables, floats, absolute positioning,\nweb fonts and page breaks.\n\nWhat it does **not** do is run JavaScript or lay out flexbox and grid. If your document depends on\neither, use `.browser` instead and pay for the browser process.",
                "parameters": [
                    {
                        "name": "html",
                        "in": "query",
                        "required": false,
                        "description": "The HTML to render (required unless url or documents is given)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "url",
                        "in": "query",
                        "required": false,
                        "description": "An http(s) URL to fetch and render instead of passing html",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "documents",
                        "in": "query",
                        "required": false,
                        "description": "Merge several documents into one PDF, in order: [{\"html\":\u2026}|{\"url\":\u2026}, \u2026] (max 10)",
                        "schema": {
                            "type": "array"
                        }
                    },
                    {
                        "name": "css",
                        "in": "query",
                        "required": false,
                        "description": "Extra CSS applied on top of the document's own styles",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "base_url",
                        "in": "query",
                        "required": false,
                        "description": "Base URL that relative asset paths resolve against (defaults to url when fetching)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "required": false,
                        "description": "Paper size",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "orientation",
                        "in": "query",
                        "required": false,
                        "description": "Page orientation",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "margin",
                        "in": "query",
                        "required": false,
                        "description": "Page margins in mm \u2014 a single number for all sides, or {top,right,bottom,left}",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "header_html",
                        "in": "query",
                        "required": false,
                        "description": "HTML repeated at the top of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "footer_html",
                        "in": "query",
                        "required": false,
                        "description": "HTML repeated at the bottom of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "required": false,
                        "description": "PDF document title",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "author",
                        "in": "query",
                        "required": false,
                        "description": "PDF document author",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "required": false,
                        "description": "PDF document subject",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "filename",
                        "in": "query",
                        "required": false,
                        "description": "Filename returned in the response / Content-Disposition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "required": false,
                        "description": "Encrypt the PDF; readers prompt for this password on open",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "remote_assets",
                        "in": "query",
                        "required": false,
                        "description": "Allow http(s) images and stylesheets to be fetched",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "max_pages",
                        "in": "query",
                        "required": false,
                        "description": "Refuse the document if it renders to more pages than this (max 200)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "output",
                        "in": "query",
                        "required": false,
                        "description": "json (base64 payload) or binary (raw PDF body)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "disposition",
                        "in": "query",
                        "required": false,
                        "description": "Content-Disposition for binary output",
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            },
            "post": {
                "operationId": "html-to-pdf_post",
                "summary": "Render HTML (or a fetched URL) into a PDF document",
                "x-credit-cost": 2,
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "filename": "document.pdf",
                                    "content_type": "application/pdf",
                                    "bytes": 12894,
                                    "pages": 1,
                                    "page_size": "A4",
                                    "orientation": "portrait",
                                    "encrypted": false,
                                    "assets_blocked": [],
                                    "pdf_base64": "JVBERi0xLjQK\u2026"
                                },
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "filename": {
                                            "type": "string",
                                            "description": "The name you asked for, or document.pdf. Also used in Content-Disposition when output=binary."
                                        },
                                        "content_type": {
                                            "type": "string",
                                            "description": "Always application/pdf."
                                        },
                                        "bytes": {
                                            "type": "integer",
                                            "description": "Size of the finished document, before base64 encoding."
                                        },
                                        "pages": {
                                            "type": "integer",
                                            "description": "Pages in the finished document \u2014 useful for billing your own users, or for checking a document is the length you expected."
                                        },
                                        "page_size": {
                                            "type": "string",
                                            "description": "The paper size that was applied."
                                        },
                                        "orientation": {
                                            "type": "string",
                                            "description": "portrait or landscape, as applied."
                                        },
                                        "encrypted": {
                                            "type": "boolean",
                                            "description": "true when a password was set, so readers will prompt on open."
                                        },
                                        "assets_blocked": {
                                            "type": "array",
                                            "description": "Asset URLs the guard refused, with the reason. **This is a successful response, not an error** \u2014 the document rendered without them. Check this array if an image is missing: local paths are always refused, and remote URLs need remote_assets: true."
                                        },
                                        "pdf_base64": {
                                            "type": "string",
                                            "description": "The document, base64-encoded. Absent when output=binary, where the response body is the PDF itself."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_request \u2014 No document was supplied (\"html\", \"url\" and \"documents\" all missing), a parameter is out of range (unknown page_size, orientation other than portrait/landscape, a base_url that is not http(s)), or the \"documents\" array is malformed or longer than 10 entries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid API key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient credits \u2014 nothing is charged and the API is never reached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key is not scoped to this API, or a test key was used on an API without sandbox support",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "payload_too_large \u2014 The HTML exceeds 2 MB, the extra CSS exceeds 200 KB, or several merged documents exceed the combined 2 MB budget.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "render_failed \u2014 The renderer could not turn your markup into a page \u2014 unsupported CSS or markup it cannot lay out.\n\ntoo_many_pages \u2014 The finished document has more pages than \"max_pages\" allows (default 50).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded for this key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "fetch_failed \u2014 A \"url\" (or a url inside \"documents\") could not be fetched: timeout, non-2xx, oversize body, or an address in a blocked range.\n\nThe API failed after being charged; credits are refunded automatically",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "engine_unavailable \u2014 Only on .browser \u2014 the headless Chrome engine is not installed or cannot start on this server.\n\npreview_unavailable \u2014 Only on .image \u2014 the rasteriser needed to turn a page into a PNG is missing on this server.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "description": "The default engine is mPDF \u2014 pure PHP, no browser process, so the call is a single synchronous\nrequest with nothing to poll and nothing to clean up. It handles the CSS that print layouts actually\nuse: page size and margins, running headers and footers, tables, floats, absolute positioning,\nweb fonts and page breaks.\n\nWhat it does **not** do is run JavaScript or lay out flexbox and grid. If your document depends on\neither, use `.browser` instead and pay for the browser process.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "html": {
                                        "type": "string",
                                        "description": "The HTML to render (required unless url or documents is given)",
                                        "example": "<h1>Invoice #1042</h1><p>Thanks for your business.</p>",
                                        "x-ui": "html"
                                    },
                                    "url": {
                                        "type": "string",
                                        "description": "An http(s) URL to fetch and render instead of passing html",
                                        "example": null
                                    },
                                    "documents": {
                                        "type": "array",
                                        "description": "Merge several documents into one PDF, in order: [{\"html\":\u2026}|{\"url\":\u2026}, \u2026] (max 10)",
                                        "example": null,
                                        "x-ui": "json"
                                    },
                                    "css": {
                                        "type": "string",
                                        "description": "Extra CSS applied on top of the document's own styles",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "base_url": {
                                        "type": "string",
                                        "description": "Base URL that relative asset paths resolve against (defaults to url when fetching)",
                                        "example": null
                                    },
                                    "page_size": {
                                        "type": "string",
                                        "description": "Paper size",
                                        "default": "A4",
                                        "enum": [
                                            "A4",
                                            "A3",
                                            "A5",
                                            "Letter",
                                            "Legal",
                                            "Tabloid",
                                            "Ledger"
                                        ]
                                    },
                                    "orientation": {
                                        "type": "string",
                                        "description": "Page orientation",
                                        "default": "portrait",
                                        "enum": [
                                            "portrait",
                                            "landscape"
                                        ]
                                    },
                                    "margin": {
                                        "type": "object",
                                        "description": "Page margins in mm \u2014 a single number for all sides, or {top,right,bottom,left}",
                                        "example": null,
                                        "x-ui": "margin"
                                    },
                                    "header_html": {
                                        "type": "string",
                                        "description": "HTML repeated at the top of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "footer_html": {
                                        "type": "string",
                                        "description": "HTML repeated at the bottom of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                                        "example": "<div style=\"text-align:center;font-size:9pt\">Page {PAGENO} of {nb}</div>",
                                        "x-ui": "code"
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "PDF document title",
                                        "example": null
                                    },
                                    "author": {
                                        "type": "string",
                                        "description": "PDF document author",
                                        "example": null
                                    },
                                    "subject": {
                                        "type": "string",
                                        "description": "PDF document subject",
                                        "example": null
                                    },
                                    "filename": {
                                        "type": "string",
                                        "description": "Filename returned in the response / Content-Disposition",
                                        "default": "document.pdf",
                                        "example": "invoice-1042.pdf"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Encrypt the PDF; readers prompt for this password on open",
                                        "example": null,
                                        "x-ui": "password"
                                    },
                                    "remote_assets": {
                                        "type": "boolean",
                                        "description": "Allow http(s) images and stylesheets to be fetched",
                                        "default": false,
                                        "example": null
                                    },
                                    "max_pages": {
                                        "type": "integer",
                                        "description": "Refuse the document if it renders to more pages than this (max 200)",
                                        "default": 50
                                    },
                                    "output": {
                                        "type": "string",
                                        "description": "json (base64 payload) or binary (raw PDF body)",
                                        "default": "json",
                                        "enum": [
                                            "json",
                                            "binary"
                                        ]
                                    },
                                    "disposition": {
                                        "type": "string",
                                        "description": "Content-Disposition for binary output",
                                        "default": "attachment",
                                        "example": null,
                                        "enum": [
                                            "attachment",
                                            "inline"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/html-to-pdf.info": {
            "get": {
                "operationId": "html-to-pdf_info_get",
                "summary": "Render the document and return only its facts (pages, bytes) \u2014 no payload",
                "x-credit-cost": 2,
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "pages": 3,
                                    "bytes": 48210,
                                    "page_size": "A4",
                                    "orientation": "portrait",
                                    "assets_blocked": []
                                },
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "pages": {
                                            "type": "integer",
                                            "description": "Pages the document renders to."
                                        },
                                        "bytes": {
                                            "type": "integer",
                                            "description": "Size the finished PDF would be."
                                        },
                                        "page_size": {
                                            "type": "string",
                                            "description": "The paper size that was applied."
                                        },
                                        "orientation": {
                                            "type": "string",
                                            "description": "portrait or landscape, as applied."
                                        },
                                        "assets_blocked": {
                                            "type": "array",
                                            "description": "Assets the guard refused \u2014 the cheapest way to find out an image will be missing before you generate the real document."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_request \u2014 No document was supplied (\"html\", \"url\" and \"documents\" all missing), a parameter is out of range (unknown page_size, orientation other than portrait/landscape, a base_url that is not http(s)), or the \"documents\" array is malformed or longer than 10 entries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid API key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient credits \u2014 nothing is charged and the API is never reached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key is not scoped to this API, or a test key was used on an API without sandbox support",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "payload_too_large \u2014 The HTML exceeds 2 MB, the extra CSS exceeds 200 KB, or several merged documents exceed the combined 2 MB budget.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "render_failed \u2014 The renderer could not turn your markup into a page \u2014 unsupported CSS or markup it cannot lay out.\n\ntoo_many_pages \u2014 The finished document has more pages than \"max_pages\" allows (default 50).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded for this key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "fetch_failed \u2014 A \"url\" (or a url inside \"documents\") could not be fetched: timeout, non-2xx, oversize body, or an address in a blocked range.\n\nThe API failed after being charged; credits are refunded automatically",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "engine_unavailable \u2014 Only on .browser \u2014 the headless Chrome engine is not installed or cannot start on this server.\n\npreview_unavailable \u2014 Only on .image \u2014 the rasteriser needed to turn a page into a PNG is missing on this server.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "html",
                        "in": "query",
                        "required": false,
                        "description": "The HTML to render (required unless url or documents is given)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "url",
                        "in": "query",
                        "required": false,
                        "description": "An http(s) URL to fetch and render instead of passing html",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "documents",
                        "in": "query",
                        "required": false,
                        "description": "Merge several documents into one PDF, in order (max 10)",
                        "schema": {
                            "type": "array"
                        }
                    },
                    {
                        "name": "css",
                        "in": "query",
                        "required": false,
                        "description": "Extra CSS applied on top of the document's own styles",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "base_url",
                        "in": "query",
                        "required": false,
                        "description": "Base URL that relative asset paths resolve against (defaults to url when fetching)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "required": false,
                        "description": "Paper size",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "orientation",
                        "in": "query",
                        "required": false,
                        "description": "Page orientation",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "margin",
                        "in": "query",
                        "required": false,
                        "description": "Page margins in mm \u2014 a single number for all sides, or {top,right,bottom,left}",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "header_html",
                        "in": "query",
                        "required": false,
                        "description": "HTML repeated at the top of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "footer_html",
                        "in": "query",
                        "required": false,
                        "description": "HTML repeated at the bottom of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "remote_assets",
                        "in": "query",
                        "required": false,
                        "description": "Allow http(s) images and stylesheets to be fetched",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ]
            },
            "post": {
                "operationId": "html-to-pdf_info_post",
                "summary": "Render the document and return only its facts (pages, bytes) \u2014 no payload",
                "x-credit-cost": 2,
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "pages": 3,
                                    "bytes": 48210,
                                    "page_size": "A4",
                                    "orientation": "portrait",
                                    "assets_blocked": []
                                },
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "pages": {
                                            "type": "integer",
                                            "description": "Pages the document renders to."
                                        },
                                        "bytes": {
                                            "type": "integer",
                                            "description": "Size the finished PDF would be."
                                        },
                                        "page_size": {
                                            "type": "string",
                                            "description": "The paper size that was applied."
                                        },
                                        "orientation": {
                                            "type": "string",
                                            "description": "portrait or landscape, as applied."
                                        },
                                        "assets_blocked": {
                                            "type": "array",
                                            "description": "Assets the guard refused \u2014 the cheapest way to find out an image will be missing before you generate the real document."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_request \u2014 No document was supplied (\"html\", \"url\" and \"documents\" all missing), a parameter is out of range (unknown page_size, orientation other than portrait/landscape, a base_url that is not http(s)), or the \"documents\" array is malformed or longer than 10 entries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid API key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient credits \u2014 nothing is charged and the API is never reached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key is not scoped to this API, or a test key was used on an API without sandbox support",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "payload_too_large \u2014 The HTML exceeds 2 MB, the extra CSS exceeds 200 KB, or several merged documents exceed the combined 2 MB budget.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "render_failed \u2014 The renderer could not turn your markup into a page \u2014 unsupported CSS or markup it cannot lay out.\n\ntoo_many_pages \u2014 The finished document has more pages than \"max_pages\" allows (default 50).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded for this key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "fetch_failed \u2014 A \"url\" (or a url inside \"documents\") could not be fetched: timeout, non-2xx, oversize body, or an address in a blocked range.\n\nThe API failed after being charged; credits are refunded automatically",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "engine_unavailable \u2014 Only on .browser \u2014 the headless Chrome engine is not installed or cannot start on this server.\n\npreview_unavailable \u2014 Only on .image \u2014 the rasteriser needed to turn a page into a PNG is missing on this server.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "html": {
                                        "type": "string",
                                        "description": "The HTML to render (required unless url or documents is given)",
                                        "example": "<h1>Quarterly report</h1><p>Section one.</p>",
                                        "x-ui": "html"
                                    },
                                    "url": {
                                        "type": "string",
                                        "description": "An http(s) URL to fetch and render instead of passing html",
                                        "example": null
                                    },
                                    "documents": {
                                        "type": "array",
                                        "description": "Merge several documents into one PDF, in order (max 10)",
                                        "example": null,
                                        "x-ui": "json"
                                    },
                                    "css": {
                                        "type": "string",
                                        "description": "Extra CSS applied on top of the document's own styles",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "base_url": {
                                        "type": "string",
                                        "description": "Base URL that relative asset paths resolve against (defaults to url when fetching)",
                                        "example": null
                                    },
                                    "page_size": {
                                        "type": "string",
                                        "description": "Paper size",
                                        "default": "A4",
                                        "enum": [
                                            "A4",
                                            "A3",
                                            "A5",
                                            "Letter",
                                            "Legal",
                                            "Tabloid",
                                            "Ledger"
                                        ]
                                    },
                                    "orientation": {
                                        "type": "string",
                                        "description": "Page orientation",
                                        "default": "portrait",
                                        "enum": [
                                            "portrait",
                                            "landscape"
                                        ]
                                    },
                                    "margin": {
                                        "type": "object",
                                        "description": "Page margins in mm \u2014 a single number for all sides, or {top,right,bottom,left}",
                                        "example": null,
                                        "x-ui": "margin"
                                    },
                                    "header_html": {
                                        "type": "string",
                                        "description": "HTML repeated at the top of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "footer_html": {
                                        "type": "string",
                                        "description": "HTML repeated at the bottom of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "remote_assets": {
                                        "type": "boolean",
                                        "description": "Allow http(s) images and stylesheets to be fetched",
                                        "default": false,
                                        "example": null
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/html-to-pdf.image": {
            "get": {
                "operationId": "html-to-pdf_image_get",
                "summary": "Render the document and return one page as a PNG image",
                "x-credit-cost": 3,
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "page": 1,
                                    "pages": 3,
                                    "width": 900,
                                    "height": 1273,
                                    "bytes": 139014,
                                    "content_type": "image/png",
                                    "image_base64": "iVBORw0KGgo\u2026"
                                },
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "page": {
                                            "type": "integer",
                                            "description": "Which page was rasterised (1-based)."
                                        },
                                        "pages": {
                                            "type": "integer",
                                            "description": "Total pages in the document, so you can loop to image the rest."
                                        },
                                        "width": {
                                            "type": "integer",
                                            "description": "Image width in pixels, as requested."
                                        },
                                        "height": {
                                            "type": "integer",
                                            "description": "Height in pixels, derived from the page aspect ratio \u2014 you do not set it."
                                        },
                                        "bytes": {
                                            "type": "integer",
                                            "description": "PNG size before base64 encoding."
                                        },
                                        "content_type": {
                                            "type": "string",
                                            "description": "Always image/png."
                                        },
                                        "image_base64": {
                                            "type": "string",
                                            "description": "The PNG, base64-encoded. Absent when output=binary, where the body is the image itself."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_request \u2014 No document was supplied (\"html\", \"url\" and \"documents\" all missing), a parameter is out of range (unknown page_size, orientation other than portrait/landscape, a base_url that is not http(s)), or the \"documents\" array is malformed or longer than 10 entries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid API key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient credits \u2014 nothing is charged and the API is never reached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key is not scoped to this API, or a test key was used on an API without sandbox support",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "payload_too_large \u2014 The HTML exceeds 2 MB, the extra CSS exceeds 200 KB, or several merged documents exceed the combined 2 MB budget.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "render_failed \u2014 The renderer could not turn your markup into a page \u2014 unsupported CSS or markup it cannot lay out.\n\ntoo_many_pages \u2014 The finished document has more pages than \"max_pages\" allows (default 50).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded for this key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "fetch_failed \u2014 A \"url\" (or a url inside \"documents\") could not be fetched: timeout, non-2xx, oversize body, or an address in a blocked range.\n\nThe API failed after being charged; credits are refunded automatically",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "engine_unavailable \u2014 Only on .browser \u2014 the headless Chrome engine is not installed or cannot start on this server.\n\npreview_unavailable \u2014 Only on .image \u2014 the rasteriser needed to turn a page into a PNG is missing on this server.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "html",
                        "in": "query",
                        "required": false,
                        "description": "The HTML to render (required unless url or documents is given)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "url",
                        "in": "query",
                        "required": false,
                        "description": "An http(s) URL to fetch and render instead of passing html",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "documents",
                        "in": "query",
                        "required": false,
                        "description": "Merge several documents first, then image a page of the result (max 10)",
                        "schema": {
                            "type": "array"
                        }
                    },
                    {
                        "name": "css",
                        "in": "query",
                        "required": false,
                        "description": "Extra CSS applied on top of the document's own styles",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "base_url",
                        "in": "query",
                        "required": false,
                        "description": "Base URL that relative asset paths resolve against (defaults to url when fetching)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Which page to rasterise, 1-based",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "width",
                        "in": "query",
                        "required": false,
                        "description": "Image width in pixels, 80\u20132000 (height follows the page ratio)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "required": false,
                        "description": "Paper size",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "orientation",
                        "in": "query",
                        "required": false,
                        "description": "Page orientation",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "margin",
                        "in": "query",
                        "required": false,
                        "description": "Page margins in mm \u2014 a single number for all sides, or {top,right,bottom,left}",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "header_html",
                        "in": "query",
                        "required": false,
                        "description": "HTML repeated at the top of every page",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "footer_html",
                        "in": "query",
                        "required": false,
                        "description": "HTML repeated at the bottom of every page",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "remote_assets",
                        "in": "query",
                        "required": false,
                        "description": "Allow http(s) images and stylesheets to be fetched",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "output",
                        "in": "query",
                        "required": false,
                        "description": "json (base64 payload) or binary (raw PNG body)",
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            },
            "post": {
                "operationId": "html-to-pdf_image_post",
                "summary": "Render the document and return one page as a PNG image",
                "x-credit-cost": 3,
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "page": 1,
                                    "pages": 3,
                                    "width": 900,
                                    "height": 1273,
                                    "bytes": 139014,
                                    "content_type": "image/png",
                                    "image_base64": "iVBORw0KGgo\u2026"
                                },
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "page": {
                                            "type": "integer",
                                            "description": "Which page was rasterised (1-based)."
                                        },
                                        "pages": {
                                            "type": "integer",
                                            "description": "Total pages in the document, so you can loop to image the rest."
                                        },
                                        "width": {
                                            "type": "integer",
                                            "description": "Image width in pixels, as requested."
                                        },
                                        "height": {
                                            "type": "integer",
                                            "description": "Height in pixels, derived from the page aspect ratio \u2014 you do not set it."
                                        },
                                        "bytes": {
                                            "type": "integer",
                                            "description": "PNG size before base64 encoding."
                                        },
                                        "content_type": {
                                            "type": "string",
                                            "description": "Always image/png."
                                        },
                                        "image_base64": {
                                            "type": "string",
                                            "description": "The PNG, base64-encoded. Absent when output=binary, where the body is the image itself."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_request \u2014 No document was supplied (\"html\", \"url\" and \"documents\" all missing), a parameter is out of range (unknown page_size, orientation other than portrait/landscape, a base_url that is not http(s)), or the \"documents\" array is malformed or longer than 10 entries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid API key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient credits \u2014 nothing is charged and the API is never reached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key is not scoped to this API, or a test key was used on an API without sandbox support",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "payload_too_large \u2014 The HTML exceeds 2 MB, the extra CSS exceeds 200 KB, or several merged documents exceed the combined 2 MB budget.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "render_failed \u2014 The renderer could not turn your markup into a page \u2014 unsupported CSS or markup it cannot lay out.\n\ntoo_many_pages \u2014 The finished document has more pages than \"max_pages\" allows (default 50).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded for this key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "fetch_failed \u2014 A \"url\" (or a url inside \"documents\") could not be fetched: timeout, non-2xx, oversize body, or an address in a blocked range.\n\nThe API failed after being charged; credits are refunded automatically",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "engine_unavailable \u2014 Only on .browser \u2014 the headless Chrome engine is not installed or cannot start on this server.\n\npreview_unavailable \u2014 Only on .image \u2014 the rasteriser needed to turn a page into a PNG is missing on this server.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "html": {
                                        "type": "string",
                                        "description": "The HTML to render (required unless url or documents is given)",
                                        "example": "<h1>Invoice #1042</h1><p>Thanks for your business.</p>",
                                        "x-ui": "html"
                                    },
                                    "url": {
                                        "type": "string",
                                        "description": "An http(s) URL to fetch and render instead of passing html",
                                        "example": null
                                    },
                                    "documents": {
                                        "type": "array",
                                        "description": "Merge several documents first, then image a page of the result (max 10)",
                                        "example": null,
                                        "x-ui": "json"
                                    },
                                    "css": {
                                        "type": "string",
                                        "description": "Extra CSS applied on top of the document's own styles",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "base_url": {
                                        "type": "string",
                                        "description": "Base URL that relative asset paths resolve against (defaults to url when fetching)",
                                        "example": null
                                    },
                                    "page": {
                                        "type": "integer",
                                        "description": "Which page to rasterise, 1-based",
                                        "default": 1
                                    },
                                    "width": {
                                        "type": "integer",
                                        "description": "Image width in pixels, 80\u20132000 (height follows the page ratio)",
                                        "default": 900
                                    },
                                    "page_size": {
                                        "type": "string",
                                        "description": "Paper size",
                                        "default": "A4",
                                        "enum": [
                                            "A4",
                                            "A3",
                                            "A5",
                                            "Letter",
                                            "Legal",
                                            "Tabloid",
                                            "Ledger"
                                        ]
                                    },
                                    "orientation": {
                                        "type": "string",
                                        "description": "Page orientation",
                                        "default": "portrait",
                                        "enum": [
                                            "portrait",
                                            "landscape"
                                        ]
                                    },
                                    "margin": {
                                        "type": "object",
                                        "description": "Page margins in mm \u2014 a single number for all sides, or {top,right,bottom,left}",
                                        "example": null,
                                        "x-ui": "margin"
                                    },
                                    "header_html": {
                                        "type": "string",
                                        "description": "HTML repeated at the top of every page",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "footer_html": {
                                        "type": "string",
                                        "description": "HTML repeated at the bottom of every page",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "remote_assets": {
                                        "type": "boolean",
                                        "description": "Allow http(s) images and stylesheets to be fetched",
                                        "default": false,
                                        "example": null
                                    },
                                    "output": {
                                        "type": "string",
                                        "description": "json (base64 payload) or binary (raw PNG body)",
                                        "default": "json",
                                        "enum": [
                                            "json",
                                            "binary"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/html-to-pdf.browser": {
            "get": {
                "operationId": "html-to-pdf_browser_get",
                "summary": "Render through headless Chrome \u2014 the page exactly as a browser draws it",
                "x-credit-cost": 8,
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "filename": "document.pdf",
                                    "content_type": "application/pdf",
                                    "bytes": 124738,
                                    "pages": 1,
                                    "page_size": "A4",
                                    "orientation": "portrait",
                                    "engine": "chrome",
                                    "encrypted": false,
                                    "assets_blocked": [],
                                    "pdf_base64": "JVBERi0xLjQK\u2026"
                                },
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "filename": {
                                            "type": "string",
                                            "description": "The name you asked for, or document.pdf."
                                        },
                                        "content_type": {
                                            "type": "string",
                                            "description": "Always application/pdf."
                                        },
                                        "bytes": {
                                            "type": "integer",
                                            "description": "Size of the finished document."
                                        },
                                        "pages": {
                                            "type": "integer",
                                            "description": "Pages in the finished document."
                                        },
                                        "page_size": {
                                            "type": "string",
                                            "description": "The paper size that was applied."
                                        },
                                        "orientation": {
                                            "type": "string",
                                            "description": "portrait or landscape, as applied."
                                        },
                                        "engine": {
                                            "type": "string",
                                            "description": "Always \"chrome\" here \u2014 the field that tells you which engine produced a document when you use both endpoints."
                                        },
                                        "encrypted": {
                                            "type": "boolean",
                                            "description": "Always false: password protection is an mPDF feature, so use the default endpoint when you need it."
                                        },
                                        "assets_blocked": {
                                            "type": "array",
                                            "description": "Assets that did not load. Expect every remote URL to appear here \u2014 this engine has no network access."
                                        },
                                        "pdf_base64": {
                                            "type": "string",
                                            "description": "The document, base64-encoded. Absent when output=binary."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_request \u2014 No document was supplied (\"html\", \"url\" and \"documents\" all missing), a parameter is out of range (unknown page_size, orientation other than portrait/landscape, a base_url that is not http(s)), or the \"documents\" array is malformed or longer than 10 entries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid API key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient credits \u2014 nothing is charged and the API is never reached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key is not scoped to this API, or a test key was used on an API without sandbox support",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "payload_too_large \u2014 The HTML exceeds 2 MB, the extra CSS exceeds 200 KB, or several merged documents exceed the combined 2 MB budget.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "render_failed \u2014 The renderer could not turn your markup into a page \u2014 unsupported CSS or markup it cannot lay out.\n\ntoo_many_pages \u2014 The finished document has more pages than \"max_pages\" allows (default 50).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded for this key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "fetch_failed \u2014 A \"url\" (or a url inside \"documents\") could not be fetched: timeout, non-2xx, oversize body, or an address in a blocked range.\n\nThe API failed after being charged; credits are refunded automatically",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "engine_unavailable \u2014 Only on .browser \u2014 the headless Chrome engine is not installed or cannot start on this server.\n\npreview_unavailable \u2014 Only on .image \u2014 the rasteriser needed to turn a page into a PNG is missing on this server.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "description": "Renders in real headless Chrome, so flexbox, grid, web fonts and JavaScript all work and the output\nmatches what you see when you print the page from a browser. It costs 8 credits rather than 2 because\na browser process is started for the call.\n\n**No network access, at all.** Chrome runs with egress blocked, so every asset must be inline or a\n`data:` URI \u2014 a remote `<img>` or stylesheet simply will not load, and `remote_assets` does not apply\nhere. This is deliberate: your JavaScript executes inside that browser, and an engine that could reach\nthe network would be able to read internal addresses and paint the results into the PDF you receive.\n\nUse the default endpoint when your document is print-CSS only; use this one when it genuinely needs a\nbrowser engine.",
                "parameters": [
                    {
                        "name": "html",
                        "in": "query",
                        "required": false,
                        "description": "The HTML to render (required unless url or documents is given)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "url",
                        "in": "query",
                        "required": false,
                        "description": "An http(s) URL to fetch and render instead of passing html",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "documents",
                        "in": "query",
                        "required": false,
                        "description": "Merge several documents into one PDF, in order (max 10)",
                        "schema": {
                            "type": "array"
                        }
                    },
                    {
                        "name": "css",
                        "in": "query",
                        "required": false,
                        "description": "Extra CSS applied on top of the document's own styles",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "required": false,
                        "description": "Paper size",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "orientation",
                        "in": "query",
                        "required": false,
                        "description": "Page orientation",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "margin",
                        "in": "query",
                        "required": false,
                        "description": "Page margins in mm \u2014 a single number for all sides, or {top,right,bottom,left}",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "header_html",
                        "in": "query",
                        "required": false,
                        "description": "HTML repeated at the top of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "footer_html",
                        "in": "query",
                        "required": false,
                        "description": "HTML repeated at the bottom of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "wait_ms",
                        "in": "query",
                        "required": false,
                        "description": "Extra settle time in ms for scripts that finish after load (max 3000)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "filename",
                        "in": "query",
                        "required": false,
                        "description": "Filename returned in the response / Content-Disposition",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "max_pages",
                        "in": "query",
                        "required": false,
                        "description": "Refuse the document if it renders to more pages than this (max 200)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "output",
                        "in": "query",
                        "required": false,
                        "description": "json (base64 payload) or binary (raw PDF body)",
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            },
            "post": {
                "operationId": "html-to-pdf_browser_post",
                "summary": "Render through headless Chrome \u2014 the page exactly as a browser draws it",
                "x-credit-cost": 8,
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "filename": "document.pdf",
                                    "content_type": "application/pdf",
                                    "bytes": 124738,
                                    "pages": 1,
                                    "page_size": "A4",
                                    "orientation": "portrait",
                                    "engine": "chrome",
                                    "encrypted": false,
                                    "assets_blocked": [],
                                    "pdf_base64": "JVBERi0xLjQK\u2026"
                                },
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "filename": {
                                            "type": "string",
                                            "description": "The name you asked for, or document.pdf."
                                        },
                                        "content_type": {
                                            "type": "string",
                                            "description": "Always application/pdf."
                                        },
                                        "bytes": {
                                            "type": "integer",
                                            "description": "Size of the finished document."
                                        },
                                        "pages": {
                                            "type": "integer",
                                            "description": "Pages in the finished document."
                                        },
                                        "page_size": {
                                            "type": "string",
                                            "description": "The paper size that was applied."
                                        },
                                        "orientation": {
                                            "type": "string",
                                            "description": "portrait or landscape, as applied."
                                        },
                                        "engine": {
                                            "type": "string",
                                            "description": "Always \"chrome\" here \u2014 the field that tells you which engine produced a document when you use both endpoints."
                                        },
                                        "encrypted": {
                                            "type": "boolean",
                                            "description": "Always false: password protection is an mPDF feature, so use the default endpoint when you need it."
                                        },
                                        "assets_blocked": {
                                            "type": "array",
                                            "description": "Assets that did not load. Expect every remote URL to appear here \u2014 this engine has no network access."
                                        },
                                        "pdf_base64": {
                                            "type": "string",
                                            "description": "The document, base64-encoded. Absent when output=binary."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_request \u2014 No document was supplied (\"html\", \"url\" and \"documents\" all missing), a parameter is out of range (unknown page_size, orientation other than portrait/landscape, a base_url that is not http(s)), or the \"documents\" array is malformed or longer than 10 entries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid API key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient credits \u2014 nothing is charged and the API is never reached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key is not scoped to this API, or a test key was used on an API without sandbox support",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "payload_too_large \u2014 The HTML exceeds 2 MB, the extra CSS exceeds 200 KB, or several merged documents exceed the combined 2 MB budget.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "render_failed \u2014 The renderer could not turn your markup into a page \u2014 unsupported CSS or markup it cannot lay out.\n\ntoo_many_pages \u2014 The finished document has more pages than \"max_pages\" allows (default 50).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded for this key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "fetch_failed \u2014 A \"url\" (or a url inside \"documents\") could not be fetched: timeout, non-2xx, oversize body, or an address in a blocked range.\n\nThe API failed after being charged; credits are refunded automatically",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "engine_unavailable \u2014 Only on .browser \u2014 the headless Chrome engine is not installed or cannot start on this server.\n\npreview_unavailable \u2014 Only on .image \u2014 the rasteriser needed to turn a page into a PNG is missing on this server.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "description": "Renders in real headless Chrome, so flexbox, grid, web fonts and JavaScript all work and the output\nmatches what you see when you print the page from a browser. It costs 8 credits rather than 2 because\na browser process is started for the call.\n\n**No network access, at all.** Chrome runs with egress blocked, so every asset must be inline or a\n`data:` URI \u2014 a remote `<img>` or stylesheet simply will not load, and `remote_assets` does not apply\nhere. This is deliberate: your JavaScript executes inside that browser, and an engine that could reach\nthe network would be able to read internal addresses and paint the results into the PDF you receive.\n\nUse the default endpoint when your document is print-CSS only; use this one when it genuinely needs a\nbrowser engine.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "html": {
                                        "type": "string",
                                        "description": "The HTML to render (required unless url or documents is given)",
                                        "example": "<h1>Invoice #1042</h1><p>Thanks for your business.</p>",
                                        "x-ui": "html"
                                    },
                                    "url": {
                                        "type": "string",
                                        "description": "An http(s) URL to fetch and render instead of passing html",
                                        "example": null
                                    },
                                    "documents": {
                                        "type": "array",
                                        "description": "Merge several documents into one PDF, in order (max 10)",
                                        "example": null,
                                        "x-ui": "json"
                                    },
                                    "css": {
                                        "type": "string",
                                        "description": "Extra CSS applied on top of the document's own styles",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "page_size": {
                                        "type": "string",
                                        "description": "Paper size",
                                        "default": "A4",
                                        "enum": [
                                            "A4",
                                            "A3",
                                            "A5",
                                            "Letter",
                                            "Legal",
                                            "Tabloid",
                                            "Ledger"
                                        ]
                                    },
                                    "orientation": {
                                        "type": "string",
                                        "description": "Page orientation",
                                        "default": "portrait",
                                        "enum": [
                                            "portrait",
                                            "landscape"
                                        ]
                                    },
                                    "margin": {
                                        "type": "object",
                                        "description": "Page margins in mm \u2014 a single number for all sides, or {top,right,bottom,left}",
                                        "example": null,
                                        "x-ui": "margin"
                                    },
                                    "header_html": {
                                        "type": "string",
                                        "description": "HTML repeated at the top of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "footer_html": {
                                        "type": "string",
                                        "description": "HTML repeated at the bottom of every page ({PAGENO}, {nb}, {DATE j-m-Y})",
                                        "example": null,
                                        "x-ui": "code"
                                    },
                                    "wait_ms": {
                                        "type": "integer",
                                        "description": "Extra settle time in ms for scripts that finish after load (max 3000)",
                                        "default": 250
                                    },
                                    "filename": {
                                        "type": "string",
                                        "description": "Filename returned in the response / Content-Disposition",
                                        "default": "document.pdf",
                                        "example": null
                                    },
                                    "max_pages": {
                                        "type": "integer",
                                        "description": "Refuse the document if it renders to more pages than this (max 200)",
                                        "default": 50
                                    },
                                    "output": {
                                        "type": "string",
                                        "description": "json (base64 payload) or binary (raw PDF body)",
                                        "default": "json",
                                        "enum": [
                                            "json",
                                            "binary"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "ApiKeyAuth": {
                "type": "apiKey",
                "in": "header",
                "name": "X-Api-Key"
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "string",
                                "description": "Stable machine-readable code \u2014 branch on this, never on the message."
                            },
                            "message": {
                                "type": "string"
                            },
                            "request_id": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }
}