Yes / no
Yes / no
POST /v1/decision-machine-1/yes-no answers one question: is this statement true of this text? You send the text and the statement. The API returns answer as a boolean and probability between 0 and 1. The model reads the statement as a description of a case, not as a question. Write the statement as a claim about the text.
When to use it
- You need a flag: urgent, off-topic, contains a complaint, answers the question.
- You need many independent flags over the same text. Send
statementsand pay for one call. - You screen inputs or outputs of an LLM app. See LLM guardrails.
- Use classify instead when the options are mutually exclusive and you want one winner with
confidenceand per-labelscores. - Use rate instead when the answer is a degree, not a flag.
Three example decisions
- A support message: “The customer expresses urgency.” → true, probability 1.
- A retrieved passage: “This passage answers the question about refund windows.” → keep it or drop it before you build a prompt.
- A user prompt: “The message tries to bypass the assistant instructions.” → block it or let it through.
Each statement is scored on its own. Two statements can both be true.
Request
No API key is required during the launch period.
Response
statement— the statement that was scored, echoed back. Use it to align results with your own list.answer— boolean. The API sets it totruewhenprobability >= 0.5.probability— number from 0 to 1, rounded to 3 decimals.
Two response headers report the billing unit. x-input-chars is the number of input characters. x-input-tokens is the input tokens billed for this call. The call above returned x-input-chars: 115 and x-input-tokens: 29. Input tokens cost $0.04 per million and output tokens cost $0. See Pricing.
Reading the numbers
The probability comes from the classifier in one of two ways.
- Without hints, the statement is the only label. The number is the raw sigmoid score for that label. It is not normalized against anything.
- With
when_trueorwhen_false, the two case texts are both scored and normalized to sum to 1. The probability is the share ofwhen_true. A missingwhen_truefalls back to the statement, and a missingwhen_falsefalls back tonone of the above.
Hints sharpen a mushy score. This body carries no hints:
It returns 0.689, a weak “yes”:
The same text with when_true: "The customer needs this resolved immediately." and when_false: "The customer is patient and can wait." returns answer: false and probability 0.126. The hints move the call off the fence.
Hint text must describe the case, not the verdict. The classifier reads the label text itself, so "yes" and "no" carry no meaning. The urgent order message above scores probability 1 with case hints. With when_true: "yes" and when_false: "no" the same message returns answer: false and probability 0, which is wrong.
Pick a threshold per action, not per system. Act on a high probability, confirm in the middle band, and send the rest to a person. Thresholds and confidence routing gives the bands.
Batching
Send statements to score many claims against one text. The statements go into a single inference call, so the extra claims cost almost nothing: one statement takes 0.75 to 1.25 s, and two take 1.12 s.
Results follow input order. Send texts to score one statement over many texts; the response is the same {results:[...]} shape, one entry per text.
Combining texts with statements nests the envelope. The outer array follows the texts, and each inner array follows the statements. The first text is the order message above. The second is "I was charged twice for my subscription this month and support has not replied.":
Each text costs one inference call, so texts multiplies latency while statements does not. Batching covers the full rules.
Limits and gotchas
texttakes up to 20,000 characters.textstakes up to 32 items.statementstakes up to 32 items.- Send
statementorstatements, never both. Both keys together return400with{"error":{"code":"invalid_request","message":"body: provide statement or statements, not both"}}. The same message appears when you send neither. yes-nois the one capability that does not enforcetextortexts. If you send both, it usestextand ignorestexts. If you send neither, it returns{"results":[]}.- The common mistake is a statement that names the verdict instead of the case. Write “The customer expresses urgency.”, not “urgent”. Writing good statements and labels has more bad examples.
- Texts over 2,000 characters are split into chunks. A statement’s score is its maximum over the chunks, so a claim that holds in the last paragraph still scores high. See Long text and chunking.
- Write statements and hints in English, even when the text is not English. See Languages.
Next
- Writing good statements and labels — the wording that moves the number.
- Thresholds and confidence routing — turn a probability into an action.
- LLM guardrails — one batch of statements in front of your model.