PDF Split API

Split PDFs with Natural Language Instructions

Tell the AI how to split in plain English. It reads document content, detects boundaries, and names each file - things page-based splitters could never do.

  • AI-powered boundary detection - with custom instructions
  • 3 split modes - smart, fixed intervals, bookmarks
  • Batch processing - multiple PDFs in one request
  • Auto-naming - split files named by content

Just need to split a few files? Use the free web tool

Your instruction: "Split when you see a new invoice header or 'Page 1 of X'. Each vendor's documents should be separate."

Input

mixed_invoices_q4.pdf47 pages

PDF containing: 12 invoices from 5 vendors, mixed dates, varying page counts

AI Output

2025-01-15_AcmeCorp_Invoice_001.pdf3 pages

reason: "New invoice detected - Acme Corp header"

2025-01-14_GlobeTech_Invoice_002.pdf2 pages

reason: "New vendor letterhead - GlobeTech Inc"

...and 10 more documents

Why AI splitting beats page-based tools

Page-based splitters count pages. AI reads content and understands boundaries.

Page-based / manual splitting

Input:

mixed_invoices.pdf (47 pages)

Split every:

5 pages

Output:

split_1.pdf, split_2.pdf, ... (wrong boundaries)

  • Cannot detect where documents actually start/end
  • Cuts invoices in half, mixes vendors
  • Generic filenames (split_1, split_2...)
  • Cannot understand document content
AI with custom instructions

Input:

mixed_invoices.pdf (47 pages)

Instruction:

"Split when you see new invoice header or vendor letterhead"

Output:

2025-01-15_AcmeCorp_Invoice_001.pdf (3 pages)

  • Detects actual document boundaries from content
  • Follows your natural language instructions
  • Auto-names files based on extracted content
  • Explains why each split was made

Quickstart

Two endpoints: upload a file directly, or pass a URL and we'll fetch it. Use mode=smart with instructions to tell the AI how to detect boundaries.

POST /api/v1/pdf-split - multipart file upload

Shell
curl -X POST https://www.renamed.to/api/v1/pdf-split \  -H "Authorization: Bearer YOUR_API_TOKEN" \  -F "file=@mixed_documents.pdf" \  -F "mode=smart" \  -F 'instructions=Split when you detect a new document.Look for: invoice headers, "Page 1 of X", or new letterhead.Keep cover letters with their attachments.'

POST /api/v1/pdf-split/from-url - JSON body, server fetches the file

Shell
curl -X POST https://www.renamed.to/api/v1/pdf-split/from-url \  -H "Authorization: Bearer YOUR_API_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "url": "https://example.com/scanned-stack.pdf",    "mode": "smart",    "instructions": "Separate by patient name.\nEach patient'"'"'s records should be one file.\nInclude all pages until you see a new patient header."  }'

SDKs

Use our official SDKs for a better developer experience with type safety and error handling.

TypeScript SDK

TypeScript
import { RenamedClient } from '@renamed/sdk'const client = new RenamedClient({ apiKey: process.env.RENAMED_API_KEY })// AI reads the bundle, detects boundaries, names each splitconst job = await client.pdfSplit('./mixed_invoices.pdf', {  mode: 'smart',  instructions: `Split when you detect a new invoice.Look for: company letterhead, "Invoice #", or "Page 1 of X".Each vendor's invoice should be separate.`})// Poll for completionconst result = await job.waitForCompletion()console.log(result.splits)// => [{ filename: "2025-01-15_AcmeCorp_Invoice_001.pdf", reason: "New invoice detected - Acme Corp header" }, ...]

Response

JSON
{  "jobId": "abc123",  "status": "completed",  "progress": 100,  "results": {    "results": [{      "originalFilename": "mixed_documents.pdf",      "splits": [{        "filename": "2025-01-15_AcmeCorp_Invoice_001.pdf",        "downloadUrl": "https://...",        "expiresAt": "2025-01-16T12:00:00Z",        "pages": 3,        "reason": "New invoice detected - Acme Corp header"      },      {        "filename": "2025-01-14_GlobeTech_Invoice_002.pdf",        "downloadUrl": "https://...",        "expiresAt": "2025-01-16T12:00:00Z",        "pages": 2,        "reason": "New vendor letterhead - GlobeTech Inc"      }]    }]  },  "creditsUsed": 2}

SDKs on GitHub: github.com/renamed-to/renamed-sdk

Authentication

All API requests require authentication via Bearer token in the Authorization header.

API Token (recommended)

Generate API tokens from Settings → API Tokens. Tokens are prefixed with rt_ and provide full access to your account.

Authorization: Bearer rt_abc123def456...

OAuth 2.0

For apps that authenticate on behalf of users, use OAuth 2.0. After the OAuth flow completes, you receive an access token that works the same way:

Authorization: Bearer <oauth_access_token>

See API documentation for OAuth client registration and flow details.

API Parameters

Key parameters for controlling the split behavior.

ParameterTypeRequiredValues / Notes
fileFileYes*Single file upload. *At least one of file or files[] required.
files[]File[]Yes*Multiple files for batch processing.
modestringNoDefault: smart. Values: smart | every-n-pages | by-bookmarks
instructionsstringNoFor smart mode only. Natural language instructions for boundary detection. Max 5,000 characters.
pagesPerSplitintegerYes if mode=every-n-pagesNumber of pages per split. Range: 1-1000.

URL endpoint (/api/v1/pdf-split/from-url)

Same parameters as above, but instead of file/files[], use url (string) or urls (string[]).

What your instructions can do

The AI interprets natural language and applies complex boundary detection that would require custom code to build yourself.

Boundary detection
"Split when you see 'Page 1 of X' or a new company letterhead"
Document grouping
"Keep cover letters with their attachments. Don't split appendices from main documents."
Entity-based splitting
"Separate by patient name - each patient's records should be one file"
Header detection
"Each PURCHASE ORDER starts a new document. Invoice headers also indicate new documents."

Split modes

Choose the mode that fits your use case. Smart mode is the default.

smartdefault

AI detects document boundaries automatically. Optionally provide instructions to guide boundary detection.

every-n-pages

Split at fixed intervals. Requires pagesPerSplit parameter (1-1000).

by-bookmarks

Split at PDF bookmark boundaries. Requires the source PDF to have bookmarks.

Built for production

Limits

  • File size: 100MB max
  • Formats: PDF only
  • Instructions: 5,000 characters max
  • Pages per split: 1-1,000 (for every-n-pages mode)
  • Processing: 30s-2min typical

Common errors

  • 400 no_files No files provided
  • 400 invalid_file_type Not a PDF
  • 400 file_too_large Exceeds 100MB
  • 401 unauthorized Missing or invalid API key
  • 402 insufficient_credits Not enough credits
  • 404 not_found Job not found

Security: All requests over TLS. The /from-url endpoint blocks localhost and private IP ranges.

Pricing

1 credit per 3 pages (rounded up). Then $9 per 1,000 credits.

  • 50 free credits on signup
  • Credits valid for 12 months
  • 30-day money-back guarantee
View pricing details

Getting started

Four steps to integrate the PDF Split API into your workflow.

1

Get your API token

Generate an API token from your dashboard. You get 50 free credits on signup.

2

Upload PDF or provide URL

Submit to /api/v1/pdf-split (file upload) or /api/v1/pdf-split/from-url (URL). Include your instructions for smart mode.

3

Poll status endpoint

The initial response includes a statusUrl. Poll /api/v1/pdf-split/status/{jobId} until status=completed.

4

Download split files

Each split includes a downloadUrl. URLs expire in 24 hours. The reason field explains why each boundary was detected.

FAQ

How does AI boundary detection work?
In "smart" mode, the AI analyzes document content to identify where one document ends and another begins. It detects changes in letterhead, document type, vendor, "Page 1 of X" patterns, and structural elements. You can guide it with natural language instructions.
What can I put in the instructions parameter?
Natural language describing how to detect boundaries. Examples: "Split when you see a new invoice header or Page 1 of X", "Each document starts with a cover letter followed by attachments", "Separate by patient name - each patient's records should be one file".
How long does processing take?
Most jobs complete in 30 seconds to 2 minutes depending on file size and page count. The API is async - you submit a job and poll for completion.
What's the max file size?
PDF files up to 100MB. There is no hard page limit, but very large documents may take longer to process.
How are split files named?
In smart mode, the AI generates descriptive filenames based on document content - extracting dates, vendors, document types, and other entities. Each split also includes a "reason" field explaining why the boundary was detected.
How is this different from traditional PDF splitters?
Traditional splitters work on page numbers or bookmarks. This API reads document content, understands meaning, and applies your natural language instructions. It can split by vendor, patient, document type, or any semantic boundary - things impossible with page-based tools.