Docling as a hosted API
docling-serve's API with one API key: PDF, Word, PowerPoint, Excel, HTML and images to Markdown and JSON, at 1 credit per PDF page.
Last updated
| Price | 1 credit per PDF page converted (2 with force_ocr), 10 credits per other file |
|---|---|
| Limits | One file per request, up to 25 MB and 200 pages |
| Waiting | Sync calls wait up to 50 s; longer conversions run on as tasks you poll |
| Results | Kept for 7 days, then deleted |
Docling converts PDF, Word, PowerPoint, Excel, HTML and image files to Markdown, JSON, HTML or plain text. It finds the reading order, headings, lists and tables, and runs OCR on scanned pages.
This API is docling-serve's own: the same paths, form fields and responses under https://api.pagespool.com/v1/docling. A client written for docling-serve works when you change its base URL and add your API key. Try it first on a short PDF with the free tool.
Price and limits
A PDF costs 1 credit per page converted. With page_range you pay only for the pages in the range, and force_ocr doubles the price. Any other file costs 10 credits. The credits are charged when the conversion is submitted and refunded if it fails. Plans are on the pricing page.
- One file per request, up to 25 MB and 200 pages.
- Up to 1 unfinished conversion at a time on the free plan, 3 on a paid plan.
- The sync routes wait up to 50 seconds. A longer conversion answers
504with codeuse_asyncand itstask_id. It goes on running, and you poll it like an async one. - Docling stops a PDF after 8 seconds per page, at least 2 and at most 24 minutes; any other file after 5 minutes.
- Results are kept for 7 days. The uploaded file is deleted when the conversion ends.
- Not supported: callbacks, zip and presigned targets, pipelines other than
standard, and options outsideto_formats,from_formats,image_export_mode,do_ocr,force_ocr,ocr_engine,ocr_lang,pdf_backend,table_mode,page_range,abort_on_error,do_table_structure,include_images,images_scaleandmd_page_break_placeholder. Each answers400. There is no WebSocket status route; docling's client falls back to polling.
Self-hosting or hosted
docling-serve is open source, and you can run it yourself. The CPU image is 4.4 GB, and a conversion worker loads the layout, table and OCR models into memory: plan for several GB of RAM per worker, more for long or scanned PDFs. You also run the queue, the API key, upgrades and the machine.
Hosted here, you need one API key. The same key and credit balance work for the other engines on this site, and every engine has its own MCP server.
curl
Convert a PDF and wait for the result (up to 50 seconds):
curl -H "X-Api-Key: YOUR_API_KEY" \
-F "files=@report.pdf" -F "to_formats=md" \
https://api.pagespool.com/v1/docling/v1/convert/file
The Markdown is in document.md_content. For a long document, queue it, poll it, then fetch the result:
curl -H "X-Api-Key: YOUR_API_KEY" -F "files=@report.pdf" \
https://api.pagespool.com/v1/docling/v1/convert/file/async
# {"task_id": "3f9c…", "task_type": "convert", "task_status": "pending", "task_position": 0, "task_meta": null}
curl -H "X-Api-Key: YOUR_API_KEY" https://api.pagespool.com/v1/docling/v1/status/poll/3f9c…
curl -H "X-Api-Key: YOUR_API_KEY" https://api.pagespool.com/v1/docling/v1/result/3f9c…
A document on the web goes to the source route. We download it from its https URL ourselves:
curl -H "X-Api-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"options": {"to_formats": ["md"], "page_range": [1, 10]}, "sources": [{"kind": "http", "url": "https://arxiv.org/pdf/2501.17887"}]}' \
https://api.pagespool.com/v1/docling/v1/convert/source/async
Open WebUI
Open WebUI sends uploaded documents to docling-serve when its content extraction engine is Docling. Point it here:
CONTENT_EXTRACTION_ENGINE=docling
DOCLING_SERVER_URL=https://api.pagespool.com/v1/docling
DOCLING_API_KEY=YOUR_API_KEY
Open WebUI uses the sync route, so a document that takes longer than 50 seconds fails there. For long PDFs, use the async routes.
Docling's Python client
docling-client installs docling's DoclingServiceClient, which runs a conversion on a docling-serve endpoint instead of on your machine:
pip install docling-client
from docling.service_client import DoclingServiceClient, StatusWatcherKind
with DoclingServiceClient(
url="https://api.pagespool.com/v1/docling",
api_key="YOUR_API_KEY",
status_watcher=StatusWatcherKind.POLLING,
job_timeout=1800,
) as client:
result = client.convert(source="report.pdf")
print(result.document.export_to_markdown())
StatusWatcherKind.POLLING skips the WebSocket attempt, which this API does not serve, and job_timeout gives long PDFs the time they need.
Your API key
Create a key on the API keys page. Send it in any of three ways:
X-API-Key: YOUR_API_KEY(docling's clients send it asX-Api-Key, the same header);Authorization: Bearer YOUR_API_KEY;- HTTP Basic with the key as the password. A client that takes only a URL can carry the key in it, as
https://x:YOUR_API_KEY@….
Never put the key in a path or a query string: those end up in access logs. A missing or wrong key answers 401.
MCP and the free tool
For AI agents, the Docling MCP server is https://api.pagespool.com/mcp/docling/. Its convert_document tool queues a document, and get_conversion returns the Markdown when it is done. Setup steps per client are on the connect page.
The free PDF to Markdown tool runs the same conversion on a PDF of up to 3 pages, with no account.
Docling™ is a trademark of LF Projects, LLC; pagespool is not affiliated.