Request body
Unknown top-level fields return a
422.
Question object
Inputs
content is a list of content parts, with no message wrapper and no roles: a read
denoises one canvas over one state, so there is no turn to address and no history to
carry. A bare string is treated as one text part. Media leads, the state follows.
An image URL must be a
data: URL; http(s) is rejected. file_data accepts
either a data:application/pdf;base64, URL or http(s). A PDF’s first 8 pages are
rasterised at 96 DPI and read as the request’s images.
filename is optional.
A part with no
detail gets auto, which reads at full fidelity. low is the explicit
way to trade detail for tokens. The cap applies per request: one high or auto
part lifts every image and page in that request to 280.
Response
Responses carry
x-typesafe-request-id, which mirrors the Gateway’s x-request-id.
input_tokens_details, reads, and cost are this Gateway’s additions. TypeSafe’s
decoder ignores fields it does not model,
so the official SDK still parses the response and a client reading the raw JSON can price
the call. image_tokens is derived from the budget the request applied, 70 or 280 an
image, because the engine reports no image/text split.
A decision is billed per read. A rejected request bills nothing. See
Pricing.
Answer shapes
confidence is 1 - H(p) / ln(K): 1 when all mass is on one label, 0 when the
distribution is uniform.
Response
Errors
See Error Codes for the Gateway-wide envelope.
Related
System One
Question types, images, confidence, and cost levers.
TypeSafe SDK Compatibility
Compatibility matrix and migration steps.
List Models
The current TypeSafe-compatible models on the
/typesafe route.Chat Completions
OCR, VQA, and document inference when you need generated text.