curl -X GET 'https://api.anyformat.ai/v3/splits/3f2504e0-4f89-41d3-9a0c-0305e82c3301/pdf/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
--output invoice.pdf
from anyformat.sdk import Client
client = Client(api_key="YOUR_API_KEY")
run = client.get_run("069dcc2c-e14c-7606-8000-2ee4fb17b4f9")
for split in run.result.splits:
for handle in ([split] if split.id else split.partitions):
with open(f"{handle.name}.pdf", "wb") as out:
out.write(client.download_split_pdf(handle.id))
import { Anyformat } from "@anyformat/sdk";
const af = new Anyformat({ apiKey: "YOUR_API_KEY" });
const run = await af.getRun("069dcc2c-e14c-7606-8000-2ee4fb17b4f9");
for (const split of run.results?.splits ?? []) {
for (const handle of split.id ? [split] : split.partitions) {
const pdf = await af.downloadSplitPdf(handle.id!);
// `pdf` is a Blob — write it, upload it, or hand it to a viewer.
}
}
Splits
Download a split
Get one splitter sub-document’s pages as a PDF
GET
/
v3
/
splits
/
{split_id}
/
pdf
/
curl -X GET 'https://api.anyformat.ai/v3/splits/3f2504e0-4f89-41d3-9a0c-0305e82c3301/pdf/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
--output invoice.pdf
from anyformat.sdk import Client
client = Client(api_key="YOUR_API_KEY")
run = client.get_run("069dcc2c-e14c-7606-8000-2ee4fb17b4f9")
for split in run.result.splits:
for handle in ([split] if split.id else split.partitions):
with open(f"{handle.name}.pdf", "wb") as out:
out.write(client.download_split_pdf(handle.id))
import { Anyformat } from "@anyformat/sdk";
const af = new Anyformat({ apiKey: "YOUR_API_KEY" });
const run = await af.getRun("069dcc2c-e14c-7606-8000-2ee4fb17b4f9");
for (const split of run.results?.splits ?? []) {
for (const handle of split.id ? [split] : split.partitions) {
const pdf = await af.downloadSplitPdf(handle.id!);
// `pdf` is a Blob — write it, upload it, or hand it to a viewer.
}
}
Rate limit tier: general, 600 requests/min. See Rate limits. No credits are billed.
A workflow with a splitter node carves one uploaded packet into sub-documents — the
A partitioned category is several sub-documents and no single one of them, so it has no id of its own. Download each partition instead.
splits[] a run’s results carry. This endpoint returns one of them as a PDF.
The document is built from the packet’s source files when you ask for it and is never stored, so there is no artifact to expire and no second URL to follow: the bytes come back on this request.
Finding the id
Read it off a processed run’s results (Get a run). Anid is present when, and only when, it addresses exactly one sub-document:
| The splitter rule | Where the id is |
|---|---|
| No partition key | splits[].id — the category is one sub-document, and partitions is empty. |
| A partition key | splits[].id is null and each splits[].partitions[].id carries its own. |
Caching
The response carries anETag and Cache-Control: private. The tag is opaque — store the one you were given and send it back verbatim in If-None-Match, rather than building it from the split id. A split’s pages never change (a new run of the same workflow mints new split ids), so a still-current split answers 304 Not Modified without transferring the document again.
Errors
| Status | error_code | Meaning |
|---|---|---|
404 | NOT_FOUND | Unknown split id, or one belonging to another organization. |
409 | SPLIT_HAS_NO_PAGES | The category matched no page in this run. Every splitter rule gets a row, including the ones that matched nothing. |
409 | SPLIT_SOURCE_NOT_PDF | The split’s source document could not be read as a PDF. A packet uploaded in another format is sliced out of the PDF the platform rendered for it, so this means that rendered copy is missing or unreadable. |
422 | INTERNAL_INCONSISTENCY | The stored geometry names a page the source document does not have. Do not retry. |
curl -X GET 'https://api.anyformat.ai/v3/splits/3f2504e0-4f89-41d3-9a0c-0305e82c3301/pdf/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
--output invoice.pdf
from anyformat.sdk import Client
client = Client(api_key="YOUR_API_KEY")
run = client.get_run("069dcc2c-e14c-7606-8000-2ee4fb17b4f9")
for split in run.result.splits:
for handle in ([split] if split.id else split.partitions):
with open(f"{handle.name}.pdf", "wb") as out:
out.write(client.download_split_pdf(handle.id))
import { Anyformat } from "@anyformat/sdk";
const af = new Anyformat({ apiKey: "YOUR_API_KEY" });
const run = await af.getRun("069dcc2c-e14c-7606-8000-2ee4fb17b4f9");
for (const split of run.results?.splits ?? []) {
for (const handle of split.id ? [split] : split.partitions) {
const pdf = await af.downloadSplitPdf(handle.id!);
// `pdf` is a Blob — write it, upload it, or hand it to a viewer.
}
}

