Skip to main content

Basic Usage

Segment Options

Use SegmentOptions to configure segmentation behavior:
OptionTypeDefaultDescription
segmentation_schemastrRequiredJSON schema defining segment names and descriptions
checkpoint_idstrNoneCheckpoint ID from a previous convert() call
modestr"fast"Processing mode: "fast", "balanced", "accurate"
save_checkpointboolFalseSave checkpoint for reuse with subsequent calls
max_pagesintNoneMaximum number of pages to process
page_rangestrNoneSpecific pages to process (e.g., "0-5,10"). For spreadsheets, filters by sheet index.
skip_cacheboolFalseSkip cached results, force reprocessing
webhook_urlstrNoneWebhook URL for completion notification

Checkpoint Reuse

Use checkpoints to avoid re-parsing a document when running segmentation after conversion. First convert with save_checkpoint=True, then segment using the returned checkpoint_id:

Segmentation Result

The result object contains the segmentation data alongside standard conversion fields:

Async Usage

Next Steps

Segmentation Recipe

Learn more about document segmentation patterns and use cases.

Structured Extraction

Extract structured data from documents using JSON schemas.

Document Conversion

Convert documents to Markdown, HTML, JSON, or chunks.