Skip to main content

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 serving google/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.
On other models:
  • google/diffusiongemma-26b-a4b-it writes 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 no confidence or p_null.
  • qwen/qwen3.5-0.8b writes 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 a json_schema completion on a model this small.

2. Extract from text

Name each field with the id you want back and give it a type. Write instructions 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
The System One quickstart for fields sends fields from Node.js and cURL too, and shows the full reply.

3. Extract from an image

Send the image as an image_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
A value read from an image has no span. Its confidence and p_null still apply.

4. Extract from a PDF

Send the PDF as a document_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
Chat Completions takes a PDF only on the OCR models. On a general model such as qwen/qwen3.8-27b, you would rasterise the pages yourself and send them as images. System One does that for you.

  1. 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.
Thresholds are model-specific. Revalidate them on your own documents when you change models.

6. Extract and decide in one call

Fields share a request with noul, choice, and score questions. Read the values and a gate together:
Every question is read concurrently. The reply carries a value for each field and a probability for each decision.

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.