1. Pick an approach
Use System One fields for a flat set of values that code acts on: invoice and receipt totals, form fields, identifiers, dates. Use a
json_schema completion for nested objects, or when a value is a paragraph of generated text.
Measured
One RTX 5090 servinggoogle/gemma-4-26b-a4b-it through the Gateway. Each row reads the same 10 fields (text, dates, amounts, a list, and an optional PO number) from the same 32 synthetic invoices. For a PDF, the chat approaches send the pages as images, since this model takes no PDF on Chat Completions.
- Latency: System One returns a document 2.6x to 3.6x sooner, at every input type.
- Output: 30% to 43% fewer output tokens. Keys and JSON syntax are never generated.
- Throughput: System One leads at low and moderate concurrency. With 16 or more documents in flight, one JSON completion per document keeps up better, because each field is one engine call.
google/diffusiongemma-26b-a4b-itwrites every field on one canvas in a single read. On text it returned a document in 170 ms against 185 ms for a JSON reply, and read 1.5x the documents per second at 4 at a time. Its fields carry noconfidenceorp_null.qwen/qwen3.5-0.8bwrites a whole JSON reply in about 330 ms, so fields save little time, and they were less accurate: each field is read without the others. Use ajson_schemacompletion on a model this small.
2. Extract from text
Name each field with the id you want back and give it a type. Writeinstructions for anything the id does not make obvious. A field id reaches the model, so order_number reads better than f1.
This example reads a shipping confirmation email. The email has no gift message, so gift_message comes back null.
Python
Output
3. Extract from an image
Send the image as animage_url part, as an http(s) URL or a data: URL. The state says what to read. Keep detail at its default for small print.
This example reads a U.S. passport card exemplar.
Python
Output
span. Its confidence and p_null still apply.
4. Extract from a PDF
Send the PDF as adocument_url part, or as a file part with the bytes inline. The route renders the first 16 pages at 96 DPI and reads them as one set of images. A field can come from any of them: a total on page 2 is read in the same call as an invoice number on page 1. Three fields control the pages, as on Chat Completions:
This example reads a one-page Google invoice. Its figures are small and light, so it renders at 144 DPI. The invoice prints no purchase order number, so
po_number comes back null.
Output
- Act on the confidence
Accept a field when its confidence clears your threshold. Send the rest to a person, or to a larger model with only those fields.
6. Extract and decide in one call
Fields share a request withnoul, choice, and score questions. Read the values and a gate together:
Related
System One
Field types, answer shapes, and limits.
System One API
Full request and response reference.
Document Classification
Route documents by kind before you extract.
Response Formats
json_schema on Chat Completions, for nested output.