Skip to main content
POST /typesafe/v1/systemone answers typed questions about a state (text, JSON, or images) and returns a calibrated probability for every answer. Nothing is generated and nothing is parsed, so an answer can never be off-schema. The route is wire-compatible with TypeSafe’s Jev API. Point the typesafe-sdk client at https://gateway.vlm.run/typesafe and it works unchanged. See TypeSafe SDK Compatibility.

Core philosophy

  • World knowledge, not a trained classifier: the engines are open-weight VLMs, so a question can name any concept they already know. There is no dataset to collect, no model to fine-tune and nothing to redeploy when the label set changes: edit the criteria and the next read answers the new question.
  • Under 200 ms, with the shape guaranteed: a read is one forward pass, not a decode and a parse, and the budget is held there on purpose. Over a socket the measured p50 is ~44 ms. The answer is read off the model rather than written by it, so it is always one of your labels, with a probability attached, and never a string you have to parse or repair.
  • Cheap enough to stop rationing: a read is a fraction of a cent, so the right instinct is to point it at every visual question you have: gate an expensive pipeline, route a document, label a frame, sanity-check an upload. The cost of asking should never be the reason you did not.

Quickstart

Ask a scanned invoice page three typed questions in one call. The image goes in as an image_url part carrying a base64 data URL, with detail set to high because the amounts are small print.
Response

Models

Several engines answer these questions, each named explicitly, and a decision reports the id that answered it. See Models.

When to use a read

A read costs the prompt prefill plus one forward pass. Generating the same answer pays a full decode plus parsing, and the parse can still fail.

Question types

Three types, each answering a different shape of question. A score answer is the expected level, so a 3-level question returns a number from 0 to 2 rather than a bucket. For the exact criteria each type takes and its limits, see the request reference.

Confidence

confidence runs from 1 (the model puts all its mass on one label) to 0 (the distribution is uniform). Threshold on it to decide when a human, or a larger model, should look. Document Classification works a full routing example.
Probabilities are the model’s own at temperature 1, not a parsed guess. They are still model-specific: revalidate your thresholds when you change models.

Inputs

Media rides in content, a list of content parts. A part names its own kind, so one list carries images, a document, and text together. Media leads, the state follows. A bare string in content is one text part.
Send images or one document, never both. A document’s pages become the read’s images, so the two compete for the same 8 slots. Sending both is a 422.
No roles, no message array. A read denoises a single canvas over a single state, so there is no turn to address and no history to carry.
detail decides how closely an input is read. The default is auto, which reads at full fidelity: 280 vision tokens. Set "detail": "low" to read at 70 instead, which is 4x fewer billed image tokens at the same latency and is usually enough for classifying or routing. The cap applies per request, so one high or auto part lifts the whole read. For the accepted part shapes and the full detail table, see the request reference.

Classify a PDF

The route rasterises the document itself, so one call gets you the same typed answers you would get for images. Send the PDF as a file part, with file_data set to either a base64 data URL as below or an http(s) URL.
A PDF longer than 8 pages is answered from its opening pages, which is what classifying or routing one needs. Reading every page of a long document is a job for the Gateway’s per-page document pipeline, not for a decision.

Streaming

WS /typesafe/ws answers the same questions per frame instead of per request, for a caller reading a video or an image stream. The questions are sent once, each frame is raw binary, and every decision carries the same answers and usage as a posted read. See Streaming.

Gateway extensions

Three optional fields go beyond Jev’s contract. reasoning_effort is off by default on purpose: a read is a prefill, and thinking is the one thing that turns it into a generation. medium and high (128 and 256 tokens) are declared but return a 422 until an engine is fast enough to hold the latency target under them. A diffusion engine rejects any reasoning budget with a 422. See the request reference for ranges and defaults. Unknown fields are rejected with a 422, so a typo is never silently ignored.

Cost levers, in order of effect

Next steps

System One API

Full request and response reference, plus error envelopes.

TypeSafe SDK Compatibility

Point an existing Jev client at the Gateway with three environment variables.

Chat Completions

OCR, VQA, and document inference when you need generated text.

Rate Limits

Per-tier quotas and how they apply to a read.

Streaming

WS /typesafe/ws, for per-frame decisions over video or an image stream.

CLI

vlmrun gw s1 for one-off reads, gates that guard a script, and dry runs.