Skip to main content
Chunkr’s document processing API converts PDFs, PowerPoint presentations, Word documents, and images into structured, RAG-ready chunks with layout analysis, OCR, and semantic processing.

Quick Start

1

Upload a Document

Send a POST request to /api/v1/task/parse with your document:
The API returns a task object with a task_id for polling.
2

Poll for Completion

Use the task ID to check processing status:
3

Retrieve Results

Once status is Succeeded, access the processed output:
Python

Configuration Options

Segmentation Strategy

Controls how the document is analyzed and segmented.
Default strategy - Analyzes document layout and detects different element types:
Detects:
  • Title, SectionHeader, Text, ListItem
  • Table, Picture, Caption
  • Formula, Footnote
  • PageHeader, PageFooter
Best for: Most documents requiring accurate structure detection

OCR Strategy

Controls optical character recognition processing.
Default - Processes all pages with OCR:
Adds ~0.5 seconds per page latency

High Resolution Processing

Enables high-resolution images for better quality cropping and post-processing:
Adds ~7 seconds per page latency but significantly improves image quality

Advanced Examples

Complete Configuration

Python

Updating Task Configuration

You can update a completed task to reprocess with different settings:
Task must have status Succeeded or Failed to be updated
Python

Deleting Tasks

Python

Canceling Tasks

Cancel a task that hasn’t started processing:
Python
Task must have status Starting to be cancelled

Error Handling

Error Handling Strategy

Control how errors are handled during processing:
Default - Stops processing on any error:

Common Error Responses

Response Structure

See core/src/routes/task.rs:20-48 for complete response schema.

Best Practices

  • Use LayoutAnalysis for complex documents with tables, images, and varied layouts
  • Use Page strategy for simple text-only documents
  • Use Auto OCR strategy to optimize speed when documents have good text layers
  • Set high_resolution: false for documents without important images
  • Use reasonable target_length values (512-1024 tokens)
  • Configure expires_in to automatically clean up old tasks
  • Poll tasks with exponential backoff to avoid rate limits
  • Store task IDs for later retrieval
  • Delete tasks when no longer needed to free resources

Next Steps