Extract structured data

Fills a JSON Schema from the text. Supports strings, numbers, booleans, enums, string arrays and nested objects. Arrays of objects are accepted and returned empty. Missing values are null. Send `text` for one result, or `texts` for a batch wrapped as `{ results: [...] }`. The response carries `x-input-chars` (input characters) and `x-input-tokens` (input tokens billed for this call) headers.

Request

This endpoint expects an object.
schemamap from strings to anyRequired
JSON Schema of the object to extract. Strings, numbers, booleans, enums, arrays of strings and nested objects. Arrays of objects are accepted and returned empty.
textstringOptional1-20000 characters
The text to decide about.
textslist of stringsOptional

Batch form: one result per text.

Response

Result, or { results } for a batch

ExtractResultobject
OR
object

Errors

400
Bad Request Error
502
Bad Gateway Error