Skip to main content
Define the structure you want with JSON Schema. You can omit required and additionalProperties from object schemas. Before extraction, Transform adds each property name to required and sets additionalProperties to false on every object, including nested objects.
For multipart requests, send schema as a JSON string. For a request using parse_id, send it as a JSON object. The Extract guide shows both encodings.

Add guidance only when needed

The optional prompt field provides instructions for filling your schema, such as how to normalize a date. The schema still defines the returned structure. A prompt does not create a confidence score or guarantee populated citations.

Correct a rejected schema

Parse and direct-document Extract require JSON Schema draft 2020-12. Omit $schema to use that draft. Other declared drafts return HTTP 400 with invalid_schema. Extract using parse_id accepts schemas validated against drafts 6, 7, 2019-09, or 2020-12. The extraction engine can still reject a schema with HTTP 400 and invalid_schema.
  • malformed_schema_json: The schema is not valid JSON. Check quoting and syntax.
  • invalid_schema: The schema is not valid JSON Schema, uses a draft other than 6, 7, 2019-09, or 2020-12, or breaks an extraction constraint. The error detail names the problem.
  • schema_too_large: The schema exceeds the size limit after Transform adds required and additionalProperties. Reduce the schema size.