Ask the Gemini Decisions API two questions about each supplier PDF. Which document type fits, and is the title readable? When both answers pass your checks, the app can stage a suggested invoice or delivery-note label. A cropped page that shows only a supplier name and reference number goes to a person.

Google introduced Gemini Decision 1 on November 11, 2026. The Decisions API accepts PDFs and returns a structured answer for each question. The two questions share the PDF and are evaluated independently. Application code combines the answers and decides what to do with the file. Google’s launch announcement · Decisions API guide

Try the rule with three sample PDFs

Each sample is a fictional one-page PDF with an expected route for the exercise.

  • sample-invoice.pdf is headed INVOICE. Expect a suggested invoice label.
  • sample-delivery-note.pdf is headed DELIVERY NOTE. Expect a suggested delivery_note label.
  • sample-cropped.pdf shows a vendor name and a reference number with the title missing. Expect human_review. A reviewer can request the complete page.

Download the three sample PDFs and offline routing demo (ZIP)

Unzip the download and run python route_demo.py from that folder. The demo runs offline and leaves the PDFs in place. Its mock responses use the same top-level answers object as the REST response below.

Three fictional supplier PDFs illustrate the routing rule. The invoice and delivery note have readable titles. The cropped page goes to human review when the title check fails.
Illustration of supplier PDF routing with fictional documents and mock decision values. Open the full-size diagram.

Send one PDF and ask two questions

For a live integration, send POST /v1beta/decisions to generativelanguage.googleapis.com from your backend over HTTPS. Send Content-Type: application/json and put the API key in x-goog-api-key. Keep the key on the server and use a fictional PDF for your first request. Replace BASE64_PDF_BYTES with the base64 encoding of one sample file. Keep the filename out of the request so the model has to classify the page itself. REST quickstart · PDF input format

{
  "model": "gemini-decision-1",
  "input": [{
    "type": "document",
    "mime_type": "application/pdf",
    "data": "BASE64_PDF_BYTES"
  }],
  "questions": {
    "document_type": {
      "type": "choice",
      "instructions": "Which category fits the visible document?",
      "criteria": {
        "invoice": "A supplier bill requesting payment.",
        "delivery_note": "A record of items sent or delivered.",
        "other": "A different document or too little evidence to classify it."
      }
    },
    "title_readable": {
      "type": "noul",
      "instructions": "Can you read a document title on the first page?",
      "criteria": {
        "true_description": "A document title is visible and legible.",
        "false_description": "The title is absent, cut off or illegible."
      }
    }
  }
}

Turn the answers into a review decision

A choice answer includes the selected value, the probabilities for the offered options, and the confidence in the selected value. A noul answer includes a yes probability and a separate confidence field. For example, a yes probability of 0.06 gives a confidence of 0.94 in the answer no. The app checks title_readable.noul because it needs evidence that the title is readable. Google’s guide to answer values and confidence

In this mock invoice response, both decisions are inside answers.

{
  "answers": {
    "document_type": {
      "type": "choice",
      "choice": "invoice",
      "probabilities": {
        "invoice": 0.94,
        "delivery_note": 0.04,
        "other": 0.02
      },
      "confidence": 0.94
    },
    "title_readable": {
      "type": "noul",
      "noul": 0.97,
      "confidence": 0.97
    }
  }
}

Check that the request succeeded and that the two answers have the expected types and numeric ranges. Stage the suggested label only when document_type.choice is invoice or delivery_note, document_type.confidence is at least 0.80, and title_readable.noul is at least 0.80. Send every other case to human_review, including other, unknown categories, missing or malformed answers, and failed API requests. Keep the review reason with the file so the reviewer can tell a low readability score from a failed request.

Swipe or scroll horizontally to view all columns.

Mock scores and routes for the three practice PDFs
Sample Suggested type Type confidence Title yes probability Route
Invoice Invoice 0.94 0.97 Suggest invoice
Delivery note Delivery note 0.92 0.95 Suggest delivery note
Cropped page Invoice 0.88 0.06 Human review

The cropped page meets the type confidence threshold, but its title score fails. The reviewer sees the page and the review reason, requests an uncropped copy, and leaves the file pending until the title can be checked.

Both 0.80 thresholds are for the exercise. To set thresholds for a real intake queue, compare the suggestions with labels from people who handle those PDFs. Count mistaken suggestions alongside the files sent to review. A readable title alone says little about whether a bill is genuine or payable. How to check AI answers before using them in automation

Check API access, cost, and data handling

A live request uses a Gemini API key from Google AI Studio and sends the PDF to Google. The developer guide calls for SDK version 3.2 or later if you use Google’s Python or JavaScript SDK. The REST example uses v1beta directly. Gemini API key setup · SDK requirements and REST quickstart

On November 12, 2026, Google’s pricing page listed a free tier and a paid rate of $0.10 per million input tokens, with zero output tokens. Google counts the shared PDF input once per request and adds input tokens for each question. Gemini Decision pricing

Use the fictional PDFs when trying a live call. Google’s unpaid-service terms generally allow it to use submitted content and responses to improve its products, and human reviewers may see that content. The terms specify regional exceptions and separate rules for paid services, including limited logging. Check the terms that apply to your account before sending supplier documents. Google’s unpaid-service data terms · Google’s paid-service data terms

← Back to Tech Guides
Tech Guides
Turn a PDF Into Editable Markdown With Docling ↗