/// EXTRACT
2 credits

PDF to Chunks API — chunk a PDF for retrieval-augmented generation

Heading-aware, table-safe chunking with a real tokenizer — built for feeding a vector store, not just cutting text at a fixed length.

/// Quick answer

PDF to Chunks splits a document into pieces sized by a real tokenizer (`tiktoken`, `cl100k_base`), not a character count. `strategy: "heading"` (the default) breaks at detected headings and reports each chunk's heading path; `"page"` breaks one chunk per page; `"fixed"` ignores structure and uses pure token windows, optionally overlapping via `overlap`. Every strategy keeps a detected table's rows together in one chunk rather than splitting it mid-row, and repeated headers/footers (page numbers, running titles) are detected across the document and stripped out of the chunk text before it's returned.

Try PDF to Chunks API — free →Read the docs

How does the PDF to Chunks API work?

One HTTP request from any language. Every ASHDOCS endpoint uses the same X-API-Key header.

curl -X POST 'https://api.ashdocs.com/api/v2/tools/pdf-to-chunks' \
  -H 'X-API-Key: ash_live_...' \
  -F 'file=@document.pdf' -F 'options={"max_tokens":800,"overlap":0,"strategy":"heading"}'

Common use cases

Frequently asked questions

How much does the PDF to Chunks API tool cost?+

2 credits per successful call. Sandbox keys (prefix ash_test_) run the tool end-to-end without ever consuming credits — use them in CI or for tuning.

What is the endpoint URL for this tool?+

The endpoint is documented in the curl example on this page. All ASHDOCS endpoints share the base URL https://www.ashdocs.com and require an X-API-Key header.

Can I run this tool inside Make, Zapier, or n8n?+

Yes — through each platform's built-in HTTP mechanism (Make's HTTP module, Webhooks by Zapier, n8n's HTTP Request node). Nothing to install: point it at this exact endpoint with your X-API-Key header. See /integrations/make, /integrations/zapier or /integrations/n8n for step-by-step setup.

Does this tool support batch or scheduled runs?+

Yes. POST /api/v1/batch runs any tool over up to 50 files with a single credit ledger entry, and pipeline schedules let you trigger the same tool on a cron. Both are documented in /docs.

RELATED TOOLS