Skip to content

Media & data

Decisions

Decision models answer typed questions about a situation instead of writing prose. You send a state and a set of named questions, and get back one typed answer per question: a likelihood, a chosen option with probabilities, or a score. They are built for the decisions inside software, such as routing a ticket, gating a workflow, classifying an event or scoring a response.

Endpoint

POSThttps://api.ppq.ai/v1/decisions

Also served at https://api.ppq.ai/v1/systemone.

List models

GEThttps://api.ppq.ai/v1/decisions/models
  • The endpoint is not OpenAI SDK compatible. Decision models do not produce chat messages, so they cannot be used with /v1/chat/completions.
  • Responses are not streamed.
  • Billing is per input token. Output tokens are free.
  • Requests are private by default. They are served inside the same attested enclave as chat completions: the state you send is decrypted and forwarded to the model provider only inside the enclave. PPQ's servers never see it, only the token counts needed for billing.

Example

Triage a support ticket with three questions in one request.

import requests

response = requests.post(
    "https://api.ppq.ai/v1/decisions",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "typesafe/jev-1.13",
        "state": {
            "ticket": "My card was charged twice for the same top-up",
            "tier": "pro",
        },
        "questions": {
            "is_billing": {
                "type": "noul",
                "instructions": "Is this a billing issue?",
            },
            "route": {
                "type": "choice",
                "instructions": "Which team should handle it?",
                "criteria": {
                    "billing": "Billing team",
                    "tech": "Engineering",
                    "sales": "Sales",
                },
            },
            "urgency": {
                "type": "score",
                "instructions": "How urgent is this?",
                "criteria": ["low", "medium", "high"],
            },
        },
    },
)

answers = response.json()["answers"]
if answers["is_billing"]["noul"] > 0.9:
    assign_to(answers["route"]["choice"])

Request body

ParameterTypeRequiredDescription
model
string
Yes
A decision model ID, for example typesafe/jev-1.13.
state
string | object | array
Yes
The situation to judge: free text, a structured object, or an array such as a message transcript.
questions
object
Yes
A map of your own question names to question definitions (at least one). Answers come back keyed by the same names.

Question types

Every question needs a type and instructions. The choice and score types also take criteria.

TypecriteriaAnswer
noul
None
noul: a likelihood from 0 to 1. Use it for yes/no judgements where you want the confidence, not just the verdict.
choice
Object of option name → description, 2 or more
choice (the winning option name), probabilities per option, and confidence.
score
Ordered array of labels, 2 or more
score (a probability-weighted position across your labels), a legend mapping index to label, probabilities, and confidence.

Response

answers is keyed by your question names. In the example below, the urgency score of 1.42 sits between medium (index 1) and high (index 2).

{
  "model": "typesafe/jev-1.13-20260917",
  "answers": {
    "is_billing": { "type": "noul", "noul": 0.97 },
    "route": {
      "type": "choice",
      "choice": "billing",
      "probabilities": { "billing": 1, "tech": 0, "sales": 0 },
      "confidence": 1
    },
    "urgency": {
      "type": "score",
      "score": 1.42,
      "legend": { "0": "low", "1": "medium", "2": "high" },
      "probabilities": { "0": 0.01, "1": 0.56, "2": 0.43 },
      "confidence": 0.33
    }
  },
  "usage": { "input_tokens": 392, "output_tokens": 72 },
  "provider": "TypeSafe"
}

Available models

Model IDProviderContext
typesafe/jev-1.14
TypeSafe
262,144
typesafe/jev-1.13
TypeSafe
262,144
~typesafe/jev-latest
TypeSafe
262,144

GET https://api.ppq.ai/v1/decisions/models returns the current list of decision models, including models from other providers, with context length and pricing.

TypeSafe SDK

The official TypeSafe SDK, @typesafe-ai/sdk, posts to /v1/systemone, so it works with PPQ unchanged. Create the client with PPQ's base URL and your PPQ API key:

const client = new TypeSafeClient({
  baseURL: "https://api.ppq.ai",
  apiKey: "YOUR_API_KEY",
});