Skip to main content
Classification is a routing decision: given a page or a document, pick one label from a fixed set so the right pipeline runs next. This guide covers both ways to do it on the Gateway, and when each is the right tool.

1. Pick an approach

Default to System One: a fixed label set with a probability attached is exactly what a routing step needs, and the answer can never come back as something outside your set. Reach for chat completions when the label set is not fixed, or when you need an explanation alongside the label.

2. Classify a page image

One choice question with an entry per label, plus any yes/no checks the pipeline needs. Descriptions are optional; null is fine when a label speaks for itself.
Send it with an image_url part. The System One quickstart has the same call in Python, Node.js, cURL and the CLI, and the shape of the reply. Designing the label set is the part that decides your accuracy:
Classification rarely needs full page detail, but the default gives it to you: an input with no detail is read at 280 vision tokens. Set "detail": "low" to read at 70 instead, as the examples here do, for 4x fewer billed image tokens at the same latency. See Inputs.

3. Classify a PDF

Pass the PDF straight through as a file part. The route rasterises its first 8 pages for you at 96 DPI, so this is one call, not an OCR pass followed by a classification pass. detail stays low here: naming a document kind does not need small print.
A request carries images or one document, never both: the document’s pages are the read’s images. A longer PDF is answered from its opening pages, which is what naming a document kind needs. When you genuinely need every page, fan out per page on chat completions instead.

  1. Act on the confidence

The point of a calibrated answer is that you can decide when not to trust it. confidence runs from 1 (all mass on one label) to 0 (uniform).
Thresholds are model-specific. Tune them on a labelled sample of your own documents, and re-tune whenever you change models.

System One

Question types, images, confidence, and cost levers.

Document OCR

Reading documents to markdown or structured blocks.

System One API

Request and response reference.

Models

Catalog, capabilities, and accepted inputs per model.