is in Preview. This feature is still in development and may not return accurate results. Do not use this feature in production environments.
Example Use Cases
Use in workflows that need to navigate, scope, or retrieve content by section:- Extraction pipelines: Scope extraction queries to specific sections of a document (for example, “extract all tables in the Claims section”).
- RAG and search: Use section-aware chunking instead of sliding-window chunking for more relevant retrieval results.
- Document review: Generate a navigable TOC for long documents such as insurance policies, contracts, reports, and technical manuals.
- Cross-document analysis: Process large document batches and compare structure across a corpus.
- LLM applications: Provide context windows organized by section rather than arbitrary token splits.
How It Works
accepts the Markdown output from (which contains reference anchors) and returns a structured table of contents. automatically infers the document’s hierarchy. You can also pass an optionalguidelines parameter to control how sections are grouped.
The response includes two formats for the same TOC:
table_of_contents: A structured JSON array for programmatic usetable_of_contents_md: A Markdown-formatted TOC you can prepend to the document for navigation
The TOCs that generates are in English, regardless of the source document language.
Run Parse First
The API requires the Markdown output from the API as input. The Markdown must contain reference anchors (<a id="..."></a>) that uses to map sections back to specific chunks in the original document.
Section with the API
Section a document by calling the endpoint.Parameters
Get the full parameters from the API reference.| Parameter | Required | Description |
|---|---|---|
markdown | Required if markdown_url omitted | The Markdown output from the API. Accepts a file upload or a raw string. |
markdown_url | Required if markdown omitted | A URL pointing to a Markdown file to fetch and section. |
guidelines | Optional | Natural-language instructions that control how the hierarchy is built. When omitted, the API infers structure automatically. Examples: • "Treat each numbered article as a top-level section"• "Create a flat structure, no more than 2 levels deep"• "Separate the introduction and appendices from the main body" |
model | Optional | The section model version to use. If omitted, the API uses the latest model. For more information, see Section Model Versions. |
For information about pricing and credits, go to Pricing & Billing.
Use Section with Our Libraries
Click one of the tiles below to learn how to use the API with our libraries.Python Library
Use with our Python library.
TypeScript Library
Use with our TypeScript library.
Share Your Feedback
is in public preview and we are actively looking for feedback to improve it. To share your experience, schedule a feedback session with us. Come prepared to discuss:- What is working well
- Any challenges you’ve encountered and how the feature could improve
- The email address for your account, found in your profile page
- The documents you used
- The code you used

