Skip to navigation

Create extraction

Read a piece of state and get one typed value per field you name.

Authentication

AuthorizationBearer
Your production key sent as a bearer token.

Request

This endpoint expects an object.
modelstringRequired

Extraction model ID, for example cloudflare/clairic.

fieldsobjectRequired

Fields to extract, keyed by your names (up to 100). Each field’s type sets the type of its value.

statestringOptionalDefaults to

Text to read. Can be empty only when images are sent.

imageslist of strings or objects or nullOptional

Up to 4 PNG, JPEG, or WebP images, as data: URLs or {content_type, base64} objects. Each up to 4 MiB decoded and 8 MiB in total. Remote URLs aren’t accepted. Supported by cloudflare/clairic only.

reference_datestring or nullOptional

ISO date (YYYY-MM-DD) that anchors relative dates and dates written without a year.

optionsobject or nullOptional

Extra output. Supported by cloudflare/clairic only.

vendorstring or nullOptional
Optional execution vendor pin.
customerstring or nullOptional
Optional customer UUID to scope the key, budget, and usage to.

Response

Successful Response
modelstring
Model that answered.
vendorstring
Vendor that served the request.
answersmap from strings to any

One typed answer per field, keyed by your field names. Each has type and value (null when the input doesn’t determine it), plus per-type detail such as confidence, span, or a distribution.

truncatedboolean
True when the input exceeded the model's context window and was cut from the end.
usageobject
Token usage for an extraction request.
object"extraction"OptionalDefaults to extraction
state_textstring or nullOptional

The text that span offsets index into, when options.return_state_text is true.

Errors

422
Unprocessable Entity Error