Response Structure
The response contains these top-level fields:extraction: the extracted values, structured to match your schema.extraction_metadata: per-field metadata with the range grounding for each value.markdown: the input Markdown, echoed back unchanged. Allrangesoffsets index into this string.metadata: request information such as the job ID, model version, and duration.warnings: non-fatal warnings emitted during extraction. Empty when the extraction is clean.schema_violation_error: set whenoptions.strictisfalseand the schema contained fields the model could not extract; the extraction is partial. See Status 206.
warnings or schema_violation_error is set, a synchronous request returns HTTP 206 instead of 200. An Extract Jobs poll always returns HTTP 200, with these fields inside result.
Extracted Values (extraction)
The extraction field contains the values extracted from the document, structured to match your schema exactly. When a value cannot be found in the source, it is returned as null.
For a schema that requests a revenue field and a summary field, extraction returns:
Per-Field Metadata (extraction_metadata)
The extraction_metadata field mirrors the structure of extraction, with each leaf value replaced by a {value, ranges} object:
value: the extracted value, matching the corresponding leaf inextraction.ranges: an array of{"start": n, "end": n}objects that locate the value in the input Markdown. See Grounding with Ranges.
Grounding with Ranges
A value copied from the input is grounded: itsranges tell you where it came from in the input Markdown.
For each leaf value in extraction_metadata, ranges is an array of {"start": n, "end": n} objects. Each marks a [start, end) slice of the Markdown string you submitted, in Unicode code point offsets, so you can map any value back to its exact location in the text.
For bounding boxes on the page (visual grounding), pass the response’s extraction_metadata and the parse’s structure to the Ground API, which maps each field to the blocks it came from, with page numbers and coordinates.
Each entry in the ranges array follows these rules:
- Each object marks a range of characters, where
startis inclusive andendis exclusive. - The
rangesarray can contain more than one object, because a single value can appear in more than one place in the document. - When a value is synthesized rather than copied from the source,
rangesisnull. Thevaluestill carries the extracted value.
Slice the Markdown
A value’sranges index into the returned markdown string, which echoes your input back unchanged, so you can quote the exact source text behind an extracted value. Offsets count Unicode code points, as declared by metadata.range_units.
A value can have more than one range. Join the slices to reassemble its text:
Request Metadata (metadata)
The metadata field provides information about the request:
Example Response
This response extracts arevenue value and a summary from a one-page financial report. The revenue value is grounded: its range covers the characters $4.2M in the input Markdown. The summary value is synthesized from the document as a whole rather than copied from one location, so its ranges is null. Its value still carries the summary text.