Introducing the Extractions API
OpenRouter launched an Extractions API in alpha. You send it a document, an image, or a PDF, name the fields you want, and it returns one typed value per field, like the names in an email or the total on a receipt.
Each field gets a type: text, number, date, time, datetime, list, duration, estimate, or forecast. You can add instructions to say what a field means. In the invoice example, due_date is "issue date plus the net payment days," and the model computes it from the terms even though the date isn't written in the text.
The response is built so you can decide what to trust. On Cloudflare's Clairic model, values read from text come back with a span, so you can slice the original document and show where each one came from. Single values also carry a confidence and a p_null, the probability that the document holds nothing for that field. A value becomes null when p_null passes 0.5 (you can change that per field with null_threshold), and a guess shows what the model would have picked. Estimates and forecasts return a distribution (median, p10, p90) instead of a single number. You could set a confidence floor, send anything under it to a person, and store the rest.
OpenRouter's example request runs on Clairic for $0.00011 and covers an invoice with six fields. Its image example, a receipt PNG, cost $0.00025. Three extraction models are available at launch, from Cloudflare, Inception, and ScaleDown. Not every model returns the same details: Extract, for instance, gives a confidence per value but no p_null, and no spans on a PDF. The API is in alpha at /api/alpha/extractions, and you can try it in the OpenRouter Playground.
Loading replies…