Extractions
Extraction models read a state you supply, such as an invoice, email, or contract, and return one typed value per field you name. Use them to fill a record from a document when you need a date, number, or list you can store, not text to parse. Each value comes with a confidence and, for text, the exact span it came from, so you can decide which values to trust without asking a chat model for JSON.
Send an extraction request
Send state, the text to read, and fields, a map of named fields whose keys come back as the keys of answers. Each field’s type sets the type of its value.
The cURL request returns:
value is null when the input doesn’t determine the field. p_null is the probability of that, and guess is the model’s best value even when value is null, so use guess only where a wrong value costs less than a missing one. span and spans are character offsets into state. The model can compute as well as copy: due_date adds the 30 net days to the issue date, and total adds the pallets to shipping.
Choose a model
Use cloudflare/clairic when you need numbers, durations, estimates, forecasts, images, or confidence. scaledown/extract-1 returns type and value only, with no confidence or spans, and costs half as much for plain text and dates. Output is $0 on both, and usage.cost reports the cost in USD.
Reference
Every field takes optional instructions and null_threshold, the probability of null above which value is null (0.5 by default). Field names start with a letter or underscore and run up to 64 characters.
cloudflare/clairic reads state alongside as many fields as fit in one 8,192-token pass, and splits the rest across more passes. Each pass reads state again, so usage.input_tokens counts it once per pass and usage.passes says how many there were. Ask for the fields you need in one request rather than one request per field, and keep instructions short.
Extraction models don’t stream and take no sampling parameters. Organizations with zero data retention can call cloudflare/clairic but not scaledown/extract-1. GET /v1/models lists extraction models with output: ["extraction"], paged at 50 by default, so pass limit (up to 500) when you search.