Overview
Previously, you could pass astructured_output object directly in your /extract request to get structured data in a single call. This approach has been replaced by a dedicated /schema endpoint that runs after extraction.
Why the change?
Before vs. After
Migration Steps
1
Step 1: Remove
structured_output from your /extract call2
Strip the
structured_output, schema, and schema_prompt parameters from your extraction request. Keep all other parameters (pages, figure_processing, extensions, etc.) as-is.3
Step 2: Save the
extraction_id from the response4
The
/extract response includes an extraction_id (when storage is enabled, which is the default). Store this ID — you’ll need it for the schema step.5
Step 3: Call /schema with your schema config
6
Send a
POST /schema request with the extraction_id and your schema in the schema_config object. The schema format is the same JSON Schema you were using before.7
Step 4: Update response handling
8
The schema result is now in
response.schema_output (instead of response.structured_output). The shape includes values and citations.Code Examples
Python SDK
TypeScript SDK
curl
With Async Processing
If you were usingstructured_output with async extraction, here’s the updated flow:
Advanced: Split-Mode Schema (New Capability)
With the new flow, you can now split a document into topics and apply different schemas to each section. This was not possible with the oldstructured_output approach.
Python
Response Field Mapping
If you’re parsing the response, here’s how the fields map:FAQ
Will structured_output on /extract stop working immediately?
Will structured_output on /extract stop working immediately?
No. The parameter will continue to work for backward compatibility but will be removed in a future version. We recommend migrating as soon as possible.
Is the schema format the same?
Is the schema format the same?
Yes. The JSON Schema format is identical. The only change is where you send it: instead of
structured_output.schema on /extract, you send schema_config.input_schema on /schema. The schema_prompt field is also in the same location within the config object.Does the two-step flow cost more?
Does the two-step flow cost more?
/schema is billed at 1 credit/page (or 4 credits/page with effort: true) on top of the /extract charge. The document is not re-extracted — /schema runs on the already-extracted content — but the schema step itself is metered. See Credit Usage for the full rate table.Can I use async for the schema step too?
Can I use async for the schema step too?
Yes! Set
async: true on the /schema request to get a job_id and poll for results, just like extraction.What if I don't need structured data — just markdown?
What if I don't need structured data — just markdown?
Then you’re already using the recommended flow. Just call
/extract without any schema parameters and use the markdown from the response.Related
Schema Endpoint
Full reference for the /schema endpoint (single + split mode)
Schema Design Guide
Best practices for writing effective JSON schemas
Pipeline Overview
How extract → split → schema work together
Split Endpoint
Split documents into topics for targeted schema extraction