Overview
Pulse API is designed to handle documents of any size, from single-page memos to multi-thousand-page reports. Page count never causes an error — only the transport of the bytes is gated:- Direct multipart uploads (
file=) are limited to 100 MB. A larger direct upload fails fast with HTTP413and error codeFILE_TOO_LARGE_USE_URL; it is never silently accepted. file_urlsubmissions are accepted at any size. Files over 100 MB must be submitted viafile_urlpointing at your own hosted or presigned URL (for example, an S3 presigned GET URL).
job_id — there is no separate API for large documents, and you are billed only for the pages that are actually extracted.
File Size Limits
A
413 response carries "code": "FILE_TOO_LARGE_USE_URL" and names the limit. Host the document yourself — any URL Pulse can download, such as an S3 presigned GET URL — and resubmit with file_url.
Partial Results
A large-document job completes with a partial result whenever at least one page succeeds; it fails outright only when every page is unextractable. Partial results are loud and page-precise:failed_pagesat the result top level lists each unrecoverable page as{"page": N, "error": "..."}.- A matching summary is appended to
warnings. - The markdown carries a
<!-- PAGE N FAILED EXTRACTION: ... -->placeholder at each hole so page-splitting consumers keep alignment. - Only extracted pages are billed.
failed_pages on every completed large-document job; if it is absent, every page was extracted.
Automatic Optimizations
Smart Async Switching
The production client automatically switches to async mode for large files:Large Result Download Links
For documents over 70 pages, spreadsheet extractions, or any response payload above the 5 MB inline threshold, results are returned as a one-time download link of the formhttps://api.runpulse.com/results/{job_id}. Fetching the link returns the complete result JSON with the same shape as an inline response:
Processing Strategies
1. Full Document Processing
Process entire documents when you need complete context:2. Page Range Processing
Extract specific sections to reduce processing time:- Single page:
"5"— extracts the 5th page - Range:
"10-20"— extracts pages 10 through 20 (inclusive) - Multiple ranges:
"1-5,10-15,20"— extracts pages 1-5, 10-15, and page 20 - Mixed:
"1,3,5-10,15"— extracts pages 1, 3, 5-10, and 15
When you request a page subset, every page number in the response — markdown page-break markers, bounding boxes, tables, words, and extension output — refers to the original document’s page numbers, not positions within the subset. Extracting
pages="10-20" yields items labeled pages 10 through 20.3. Selective Extraction
Extract only what you need to minimize processing:Async Processing Deep Dive
Starting Async Jobs
Polling for Completion
Parallel Processing
Process multiple large documents simultaneously:Optimization Techniques
1. Memory Management
For very large responses:2. Cost Optimization
Minimize pages processed to reduce costs:3. Performance Monitoring
Track processing performance:Common Patterns
Legal Document Processing
Financial Report Analysis
Error Handling
Handling Large Document Errors
Best Practices Summary
Use Async for Large Files
Use Async for Large Files
- Always use async processing for files > 50 pages
- Let the client auto-detect when to use async
- Implement proper polling with backoff
Optimize Page Ranges
Optimize Page Ranges
- Process only the pages you need
- Extract TOC first to navigate large documents
- Use chunking for very large documents
Handle Large Result Download Links
Handle Large Result Download Links
- Check for
is_urlin responses and readurl(ahttps://api.runpulse.com/results/{job_id}link) - Treat the link as one-time use: download and persist on the first read
- The link expires 1 hour after job completion — fetch promptly
- Authenticate the GET with your
x-api-keyheader
Monitor Performance
Monitor Performance
- Track processing times and costs
- Adjust chunk sizes based on document type
- Use concurrent processing for multiple files
Next Steps
Async Processing
Async flag, polling, and webhooks
Error Handling
Handle errors in large documents