Skip to main content
This guide walks you through your first Reducto API call. You will parse a document and get back structured JSON ready for LLMs, downstream extraction, or any other processing step in your pipeline.

Fastest path for coding agents

If you are using Claude Code, Codex, Cursor, or another coding agent, start here. This path avoids Studio clicks and extra docs navigation.
  1. Set REDUCTO_API_KEY.
  2. Choose one interface:
    • Local file or folder: use the Reducto CLI.
    • Agent tool calling: use the Reducto MCP server.
    • Application code: use the Python, Node.js, Go, or cURL examples below.
  3. Parse the sample PDF first, then replace the URL or file path with your document.
For MCP, install once with uvx mcp-server-reducto --login, then ask the agent to call parse_document(document_url="https://cdn.reducto.ai/samples/fidelity-example.pdf").

What we’re going to parse

We’ll use a financial statement PDF that contains multiple tables, headers, account summaries, and formatted text. This is the kind of complex document that’s difficult to process manually but straightforward with Reducto. Finance Statement View the sample PDF in Studio or download it directly to follow along. What we want to extract:
  • The portfolio value table with beginning and ending values
  • Account information including account numbers and types
  • Income summary broken down by tax category
  • Top holdings with values and percentages
By the end of this guide, you’ll have all of this data in structured JSON that you can use in your application. For structured field extraction (e.g., extracting specific account numbers or values into typed fields), see the /extract endpoint after completing this quickstart.

Prerequisites

1

Create a Reducto account

Go to studio.reducto.ai and sign up for a free account.
2

Get your API key

In the Studio sidebar, click API Keys, then Create new API key. Give it a name and copy the key.
Reducto Studio sidebar showing API Keys option

Click API Keys in the sidebar to create a new key

3

Set your API key as an environment variable

This allows the SDK to authenticate automatically without hardcoding the key in your code.
4

Setup with AI

You can also copy the below snippet for your AI coding agent to connect to Reducto via the MCP Server.

Install the SDK

Choose your language and install the Reducto SDK:
Requires Python 3.8+.

Parse the document

Now let’s write the code to parse our financial statement. We’ll go through each part step by step.
1

Import the SDK and initialize the client

First, we import the Reducto client. When you create a Reducto() client without passing an API key, it automatically reads from the REDUCTO_API_KEY environment variable you set earlier.
2

Upload your document

Before parsing, you need to upload the document to Reducto’s servers. The upload() method accepts a file path (as a string) and returns a reference that you’ll use in the next step.You can download the sample PDF from here.
You can also pass a URL directly to the parse method if your document is already hosted somewhere accessible, like an S3 bucket:
3

Parse the document

Now we call the parse.run() method with the uploaded file reference. This sends the document through Reducto’s processing pipeline, which runs OCR, detects layout, extracts tables, and structures everything into chunks.
4

Access the extracted content

The response contains chunks, which are logical sections of the document. Each chunk has a content field with the full text and a blocks field with individual elements like tables, headers, and paragraphs.
Each block has a type that tells you what kind of content it is: Title, Section Header, Text, Table, Figure, Key Value, and others. The bbox field contains the bounding box coordinates so you know exactly where on the page this content came from.
Complete code:

Understanding the response

Here’s what we got back from parsing our financial statement:
Key fields:

Customizing the output

The default settings work well for most documents, but you can customize the parsing behavior for specific use cases.
You can pass configuration options as TypedDict imports from reducto.types or as plain dictionaries:
You can also pass plain dictionaries instead of TypedDict imports. Both work identically.
What these options do:
  • enhance.agentic: Runs AI-powered cleanup on the specified scope. Use "text" for OCR correction on scanned documents, or "table" to improve table structure detection.
  • enhance.summarize_figures: Generates natural language descriptions of charts, graphs, and images. Useful for RAG pipelines where you need to search figure content.
  • formatting.table_output_format: Controls how tables are returned. Options are html, md (markdown), json, csv, dynamic (default, returns markdown for simple tables and HTML for complex ones), or jsonbbox.
  • settings.page_range: Limits processing to specific pages. Useful for large documents where you only need certain sections.
For the full list of options, see the Parse configuration reference.

What’s next

Now that you can parse documents, explore the other Reducto endpoints:

/extract

Define a JSON schema and extract specific fields from your documents.

/split

Divide long documents into sections based on content type.

/edit

Fill PDF forms and modify DOCX documents programmatically.

/parse (async)

Process documents asynchronously with webhooks for high-volume workloads.

Troubleshooting

This means your API key is missing or invalid. Check that the REDUCTO_API_KEY environment variable is set correctly and that the key hasn’t expired in Studio.
Some complex tables need extra help. Enable enhance.agentic with [{"scope": "table"}] for AI-powered table reconstruction, or try formatting.table_output_format set to "html" or "json" for more structured output.
For scanned documents or low-quality PDFs, enable the agentic text enhancement: enhance.agentic: [{"scope": "text"}]. If the document is password-protected, pass the password in settings.document_password. This may also be due to bad metadata polluting the output, in which case, reach out to Reducto support.
Every response includes a studio_link that opens the job in Reducto Studio. Use it to visually inspect what was extracted and debug any issues.