Skip to main content
POST
Extract typed values
Extraction is in preview. Model availability depends on configured provider routes.
Extraction belongs to the Decisions family. Use decisions to choose among known options; use extraction to return values such as an invoice number, date or total.
The examples require an active extraction model route. Check model availability before sending requests. Python AsyncPhaseo also exposes await client.extractions.create(...).

Field types

Supported types are text, number, date, time, datetime, duration and list. Lists require items: "text", "number" or "date". Supply 1–64 fields and at most 16,384 source characters. Field names start with a letter or underscore and contain up to 64 letters, digits, underscores, dots or hyphens. Numbers and durations support integer and decimals (0–6). Durations accept seconds, minutes, hours, days, weeks, months or years. Set reference_date when interpreting incomplete dates depends on a specific year. Image inputs use { content_type, base64 } objects: at most four PNG/JPEG/WebP images, 4 MiB each and 8 MiB combined after decoding. The request limit is 16 MiB. Remote URLs, PDFs, audio, video, estimates, forecasts and streaming are unsupported.

Read answers

Read answers[field_name].value. A scalar value can be null when the source does not determine it. p_null is the model’s probability of an undetermined value; confidence is a separate model-reported score. Lists provide confidence without p_null. These scores do not guarantee correctness: choose review thresholds for your workload. A valid empty list is different from a failed request. truncated: true means the provider did not process all source input. Review or resubmit shorter input before relying on completeness. Text offsets and raw guesses are not exposed. Complex arithmetic should be performed in application code. Usage reports aggregate input_tokens across provider passes. Output tokens are zero. Use the gateway’s returned pricing rather than estimating cost from source length or multiplying usage by the number of fields.

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
model
string
required

Model ID with the extraction.extract capability.

Required string length: 1 - 256
input
string
required

Source text. May be empty when images are supplied.

Maximum string length: 16384
fields
object
required

Field names match ^[A-Za-z_][A-Za-z0-9_.-]{0,63}$.

images
object[]

Embedded PNG, JPEG or WebP images; 4 MiB each and 8 MiB combined decoded.

Maximum array length: 4
reference_date
string<date>

Explicit date context for incomplete dates.

Response

200 - application/json

Typed extraction answers

model
string
required
answers
object
required
truncated
boolean
required

Whether the provider truncated source input.

usage
object
required
Last modified on October 19, 2026