Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

A Liquid API key from the API keys page of Liquid Console, sent as Authorization: Bearer $LIQUID_API_KEY.

Body

application/json
model
string
required

The decision model id to use. d1:latest and d1-ultra:latest always point to the newest model of their family; pin an exact id such as d1-ultra to keep the same model.

Example:

"$DECISION_MODEL_ID"

questions
object
required

Up to 128 named questions; answers come back under the same keys. Each has a type ("choice", "score", or "noul") and instructions (a string or JSON). A Choice takes criteria mapping 2–255 option names to a description or null; a Score takes criteria as an ordered list of 2–10 level descriptions; a Noul takes optional criteria of { "true": …, "false": … }, used only when both are given and say more than a bare yes and no. A request is billed its state and images once plus each question's own tokens, so asking a state several questions in one request costs far less than asking them in separate requests. Every question still reads the whole state, so the input limits apply to the state, images, and one question together: d1 and d1.1 allow 65,536 tokens and d1-ultra 32,768, and all three 250 KB of text, and they return 422 over either.

state
any

The content the questions are about: plain text, or structured JSON such as a chat log or record. Omit or send null when the questions stand alone. As in Perplexity's Decisions API, an array state may also hold images as OpenAI-style { "type": "image_url", "image_url": { "url": "data:…" } } parts: they are taken out of the state and checked under the same rules as images, which the request must then leave out (sending both returns 422), and a single string left beside them becomes the text state.

images
any[]

Up to 8 images the questions are about, for decision models that accept images: those listing image in input_modalities from GET /decisions/v1/models, such as d1. Other models return 422. Each is a base64 data:image/…;base64, URL or a { "content_type", "base64" } object: JPEG, PNG, or WebP, 5 MB each, within the 4.5 MB request body limit. Remote image URLs are not accepted. Images come before the state in the prompt, in the order sent, and every question sees all of them. On d1 and d1-ultra, an image costs 1.5 input tokens per 32Γ—32-pixel patch that covers it (ceil(width / 32) Γ— ceil(height / 32) patches), rounded up per image, and a request is billed its images once, however many questions it asks. The images of a request may cover at most 10,000 patches in all, and no image may be more than 100 times as long as it is wide; either returns 422. This is an extension to the System One API; omit it to stay TypeSafe-compatible.

Response

Successful response.

model
string

The model that answered.

answers
object

One answer per question id. Choice: choice, probabilities per option, confidence. Score: score (probability-weighted, may fall between levels), legend, probabilities per level, confidence. Noul: noul, the probability of yes. Confidence runs from 0 (probability spread evenly) to 1 (all on one answer); for a Score it also counts how far the probability sits from the most likely level, so a split between the two ends of the scale is 0.

usage
object

Token counts: { input_tokens, output_tokens }, plus cost in USD when the model is priced. input_tokens counts the state and images once and each question's own tokens. Output is always 0.