Structured Decision Probabilities, Question Types, Threshold Policies, and Verification
How Perplexity's Decisions API returns calibrated probabilities you can threshold in code, with cookbook patterns for QA, triage, agents, and search quotes.
This page summarises Perplexity cookbook and reference material on the Decisions API: a decision model that returns typed answers with probabilities your application compares to cutoffs, instead of parsing free-form chat. The same cluster covers companion patterns that pair Agent API (web_search, custom profiles) and Search API snippets with those probabilities for gates, ranking, and enrichment.
Decisions API vs chat models: when to use probabilities
Section titled “Decisions API vs chat models: when to use probabilities”People look this up when they need automated yes/no, routing, or rubric scores in CI, triage, or agent tool loops—not a paragraph they must interpret.
A chat model can look at the same chart and write a paragraph about it. You cannot put a cutoff on a paragraph … A decision model returns a calibrated probability for each question you ask, so your code can hold the policy.
— Perplexity, Check a Chart for Misleading Design with a Decision Model
Triage is a pile of small decisions, and each one needs a number you can put a threshold on. That is what the Decisions API returns.
— Perplexity, Ticket triage with the Decisions API
Common conclusion: use a chat or Agent API response when the product needs prose, tools, or open-ended reasoning; use the Decisions API when your code must branch deterministically on numbers (fail build, block payment, escalate ticket, pick a quote). Probabilities are the model’s estimate—they are not measured accuracy rates and not proof of truth (quickstart, answer gate).
POST /v1/decisions: auth, models, and request shape
Section titled “POST /v1/decisions: auth, models, and request shape”How to call the Decisions API (SDK or HTTP)
Section titled “How to call the Decisions API (SDK or HTTP)”Install the Perplexity Python library (0.44.0 or later) or the TypeScript SDK (0.39.0 or later). The endpoint is a single JSON POST, so any HTTP client also works; the cURL tab below shows the raw request.
— Perplexity, Decisions API Quickstart
| Item | Detail |
|---|---|
| Endpoint | POST https://api.perplexity.ai/v1/decisions |
| Auth | Authorization: Bearer plus project API key (PERPLEXITY_API_KEY) |
| Models | pplx-decider-latest; flash variant pplx-decider-flash-latest |
| Body | model, state (text, images, or structured objects), questions (named map) |
| Response | One entry per question under the name you chose; usage.input_tokens; echo of model |
Send state as captions, PNG data URLs in image_url, or structured fields (chart checker, action gate). For costs versus Agent calls, see pricing. SDK entry point: SDK overview.
Flash billing when you group many questions
Section titled “Flash billing when you group many questions”On pplx-decider-flash-latest, Flash can keep several questions in one request but evaluates each separately and bills the state once per question (quickstart). Cookbooks that batch six or fourteen questions on one screenshot (for example visual QA staying on pplx-decider-v1.2) do so to control grouping and billing—check the recipe’s model constant before you change it.
Question types: noul, choice, and score
Section titled “Question types: noul, choice, and score”noul — probability of yes
Section titled “noul — probability of yes”Returns answers[name].noul in [0,1]: P(yes). Compare to a threshold; values near 0.5 mean unsure (quickstart). In defect checklists, yes usually means the problem is present (high = bad), except where a recipe defines otherwise (chart check).
choice — pick one option with confidence
Section titled “choice — pick one option with confidence”Returns top choice, full probabilities over options (roughly summing to 1), and confidence 0–1. Confidence is not the top probability:
confidence on choice and score answers is computed from probabilities and runs from 0 to 1. It is not the top probability
— Perplexity, Decisions API Quickstart
Choice confidence uses (p_top - 1/n) / (1 - 1/n) for n options. Cap options at 255 per question (browser agent); the quote finder caps sentences at 255 for the same reason (quote finder).
score — ordered rubric levels
Section titled “score — ordered rubric levels”Returns expected score (probability-weighted index), per-level probabilities, legend, and confidence. Ticket triage reads both expected severity and tail risk p_critical on the top level (ticket triage).
Image state, tile limits, retries, and rate limits
Section titled “Image state, tile limits, retries, and rate limits”Screenshots are read in 32×32 tiles, max 2,048 tiles per image. Oversize images without resize tend to yield 504 after a long wait, not 400 (visual QA, browser agent). Cookbooks retry 429, 500, 502, 503, 504 (typically twice, respecting Retry-After); 400 and 401 are not retried. Organisation rate limits around 10 requests per second appear in browser agent and ticket triage docs; include x-request-id from response headers when contacting support.
For on-device decisions without cloud upload, Decider for Mac exposes a local http://127.0.0.1:8080/v1/decisions endpoint (same question types; model download on disk).
Threshold policies: how cookbooks turn probabilities into actions
Section titled “Threshold policies: how cookbooks turn probabilities into actions”Patterns repeat: (1) define named questions in one request where billing allows; (2) read probabilities; (3) apply ordered rules in plain code; (4) log evidence (run.json, run.jsonl, CI summary).
| Pattern | Doc | Policy idea |
|---|---|---|
| Visual QA CI | Catch Visual Bugs in CI | Six noul defects per screenshot; FAIL_AT=0.80, WARN_AT=0.40; pair questions content_lost / intentional for redesigns vs breaks |
| Chart design | Chart misleading design check | Fourteen questions; FLAG / BORDERLINE; gate checks by detected chart type |
| Agent tool gate | Check agent actions | Rules first, then on_policy, matches_records, reversible; allow / ask / block |
| Browser steps | Drive a browser | Goal reached, risk stop, dismiss overlays, scroll, click by ACT_MIN |
| Citation gate | Judge citation accuracy | Per-sentence support vs snippets; investigate rewrites up to cap |
| Search quote | Rank search results | Rank per result, then compare; print quote only if compare ≥ 0.6 |
| Support triage | Ticket triage | Escalate / review / close spam / auto-reply / queue from three questions |
The Decisions API returns a probability instead of a paragraph. Your CI step screenshots each page, sends the picture to pplx-decider-v1.2 with six yes-or-no questions … and gets six numbers from 0 to 1.
— Perplexity, Catch Visual Bugs in CI with the Decisions API
The model never sees the HTML, the CSS, or the cutoffs. It gets a picture and the questions and returns a probability for each.
— Perplexity, Catch Visual Bugs in CI with the Decisions API
For visual CI, prefer thresholded probabilities over raw pixel diff when intentional redesign should pass while content loss should fail—the pair questions encode that distinction (visual QA).
Search API plus Decisions API: one quoted sentence with a URL
Section titled “Search API plus Decisions API: one quoted sentence with a URL”Why rank snippets before answering the user
Section titled “Why rank snippets before answering the user”The Search API returns up to five pages for a question. Your user wants the one sentence that answers it, in the page’s own words, with a link.
— Perplexity, Rank search results — best quote via Decisions API
Flow: one Search call (max_results: 5) → split snippets to sentences → per-result choice (best) + noul (has_answer) → compare candidates with shared-scale noul → output quote only if compare clears ANSWER_CUTOFF (0.6) and candidates cleared HAS_ANSWER_CUTOFF (0.3). Per-result choice probabilities are not cross-comparable until the compare request (quote finder).
Every character of the quote came back from the Search API.
— Perplexity, Rank search results — best quote via Decisions API
A quote that answers is not a quote that is true. Treat the printed sentence as the best candidate from these results, and check it before you rely on it for anything that matters.
— Perplexity, Rank search results — best quote via Decisions API
The recipe does not fetch full pages; quotes come from snippets only. “No answer” means nothing in the top five snippets qualified—not that the web has no answer (quote finder).
Agent API patterns that pair with or replace Decisions gates
Section titled “Agent API patterns that pair with or replace Decisions gates”These cookbooks sit beside Decisions in the same documentation set; they solve different layers (tools, batch scale, evidence on disk).
Custom profile metric investigation (connector + skill)
Section titled “Custom profile metric investigation (connector + skill)”Once the Agent API customizations (managed connectors, versioned skills, instructions, and tools) are configured, your application sends a profile ID and a question. The profile supplies the saved configuration instead of making each application rebuild it.
— Perplexity, Build a Data Analytics Agent Using Custom Connectors
Agent API returns evidence you can inspect, not a guarantee of correct reasoning.
— Perplexity, Build a Data Analytics Agent Using Custom Connectors
Inspect mcp_call, sandbox_results, and executed SQL in response.json—not only narrative in output_text (data analyst).
Batch enrichment and validation-heavy Agent flows
Section titled “Batch enrichment and validation-heavy Agent flows”Batch API company enrichment runs many POST /v1/responses jobs asynchronously; join outputs with custom_id because order is not preserved. JSON schema validates shape, not factual truth—review sources before customer-facing use. ClickHouse customer enrichment constrains people_search result IDs in application code so URLs cannot be invented. Agent API regression testing checks instruction changes against fixed cases (for example verify_outcome vs unsafe wait_then_retry on ambiguous payments) with citations ⊆ search results.
Weekly web timeline (Agent only for synthesis)
Section titled “Weekly web timeline (Agent only for synthesis)”Story timeline uses web_search with MM/DD/YYYY date filters per window; bars reflect search counts, turning points are model-named—parse only the ## Turning points section for chart markers.
Common mistakes across Decisions and Agent cookbooks
Section titled “Common mistakes across Decisions and Agent cookbooks”- Treating high
noulas truth or on-topic nuance (quote finder, answer gate). - Using Flash for grouped questions without accounting for per-question state billing (quickstart).
- Sending screenshots over 2,048 tiles without resize → 504 (visual QA).
- Trusting agent prose over
response.jsonevidence (data analyst). - Skipping deterministic rules before Decisions in action gate (amount limits, PO checks).
- Citation markers in Agent output ≠ supported sentences without answer gate checks.
- Batch rows
missingwhen a batch fails entirely—always handle non-completedstatuses (batch enrichment).
How to check this on your site
Section titled “How to check this on your site”-
Set
PERPLEXITY_API_KEYand run the Decisions API Quickstart request; confirm each named question returns a probability and noteusage.input_tokens. -
For an image workflow, capture a viewport within tile budget (for example 1280×800 in browser agent), call the API once, and store
x-request-idwith your cutoff verdict. -
Run offline
pytestfrom a cookbook you adopt (quote finder, browser agent, regression testing) to validate request shape and policy order before live keys. -
Inspect artifact logs (
out/run.json,triage_results.jsonl,runs/<id>/response.json) and tune cutoffs with margin—not single decimal literals (quickstart). -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about.