import requests r = requests.post( "https://api.aimlapi.com/v1/decisions", headers={"Authorization": "Bearer " + AIMLAPI_KEY}, json={ "model": "liquid/d1", "state": "Help! My payments have been failing for 3 days.", "questions": { "team": { "type": "choice", "instructions": "Which team should handle this ticket?", "criteria": { "billing": "Payments, invoicing, refunds", "technical": "Bugs, outages, integrations" } }, "urgent": { "type": "noul", "instructions": "Does this need a reply within the hour?" } } }, ) print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/decisions", { method: "POST", headers: { Authorization: `Bearer ${process.env.AIMLAPI_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "model": "liquid/d1", "state": "Help! My payments have been failing for 3 days.", "questions": { "team": { "type": "choice", "instructions": "Which team should handle this ticket?", "criteria": { "billing": "Payments, invoicing, refunds", "technical": "Bugs, outages, integrations" } }, "urgent": { "type": "noul", "instructions": "Does this need a reply within the hour?" } } }), }); console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/decisions \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"liquid/d1","state":"Help! My payments have been failing for 3 days.","questions":{"urgent":{"type":"noul","instructions":"Does this need a reply within the hour?"}}}'
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Input | |
| Output | |
d1 reads the request in one forward pass and generates no output tokens, so only input is billed.
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
d1 This page | Routing, classification and scoring in code | |||
| Typed decisions inside software | ||||
| Reasoning + agents |
Yes. d1 is served under the model id liquid/d1 through the POST /v1/decisions endpoint. Input is billed at $0.0546 per 1M tokens; output is free, because the model generates no output tokens.
Liquid AI describes a decision model as a class of model purpose-built for structured decisions. Instead of generating text token by token, it evaluates a situation and returns calibrated probabilities across a fixed set of outcomes in a single call with zero generated tokens.
Three types, called primitives. Noul is a yes/no question that returns the probability of “yes” between 0 and 1. Choice is a pick-one-from-many question that returns a probability distribution over named options, from 2 up to 255 of them. Score rates the input against an ordered rubric of 2 to 10 defined levels and returns an expected level, which may be fractional, plus a probability for each level.
Because there is nothing to meter. d1 reads the request in a single forward pass and returns typed values rather than decoding text, so no output tokens exist to bill. Only input tokens are charged, at $0.0546 per 1M.
Up to 128. The request takes a questions map of question key to typed question, and every key comes back in answers with its own typed result, so one call can classify, score and gate the same input at once.
No. Decision models read text only: the content to evaluate is passed as state, which may be a string, a JSON object or an array of texts. A request carrying a non-empty images list is refused.
32,768 tokens, covering the state you pass plus the questions and their criteria.
Liquid AI points to free-form text generation, creative writing, multi-turn conversation, complex multi-step reasoning, open-ended Q&A, summarization and code generation. d1 is the right tool when the answer is a structured decision — classification, routing, scoring, triage, moderation, guardrails, LLM-as-judge checks, agent tool-call approval, or model routing and cascades.