Skip to main content
POST
Extract structured data from a document against a JSON schema and persist the result as an Extraction resource that can later be retrieved via GET /v1/extractions/{extraction_id} or listed via GET /v1/extractions.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request to run a structured extraction on a single document.

Extends the base extraction request with the document to process (either inline content or a reference to a previously uploaded file) and a stream flag that controls whether results are returned incrementally.

document
MIMEData · object
required

A file represented by its filename and a base64 data url.

json_schema
Json Schema · object
required

JSON schema describing the structured output

model
string
default:retab-small

The model to use for the extraction

instructions
string | null

Free-form instructions appended to the system prompt to steer the extraction.

n_consensus
integer
default:1

Number of consensus extraction runs to perform. Uses deterministic single-pass when set to 1.

metadata
Metadata · object | null

User-defined metadata to associate with this extraction

additional_messages
Additional Messages · object[] | null

Additional chat messages forwarded to the extraction model.

bust_cache
boolean
default:false

If true, skip the LLM cache and force a fresh completion

stream
boolean
default:false
background
boolean
default:false

If true, run asynchronously: returns immediately with status 'queued' and an empty output. Poll GET /v1//{id} until status is terminal. Mutually exclusive with stream.

chunking_keys
Chunking Keys · object | null

Response

Streaming extraction chunks