Structured decisions
POST /model/v1/systemone calls a decision model (for example jev-1.13). You send a state and a set of typed questions; it returns probabilities for each one: the probability of yes, of each option, or of each level. It generates no text, and an answer always falls inside the options you gave. The request and response format is compatible with TypeSafe’s System One API; an application already on the TypeSafe SDK only changes its base URL to https://api.deepraxis.com/typesafe, which keeps the original shape verbatim.
It fits places where the same judgment repeats: ticket triage, routing, tagging, moderation, filtering by a condition, scoring and ranking. For arithmetic, counting, date reasoning, multi-step reasoning or generating text, use a chat model.
1. Prepare the terminal
Put your Praxis API key in the PRAXIS_API_KEY environment variable; see Keys and authentication. Install Python and uv.
test -n "$PRAXIS_API_KEY"Expected: exit code 0. The example uses https://api.deepraxis.com; to target another environment, set PRAXIS_API_BASE to its API domain without a trailing slash or path.
2. Ask three questions in one call
Save as decide.py and run uv run -q --no-project --with requests python decide.py.
import osimport requests
base = os.environ.get('PRAXIS_API_BASE', 'https://api.deepraxis.com')resp = requests.post(f'{base}/model/v1/systemone', headers={'Authorization': f"Bearer {os.environ['PRAXIS_API_KEY']}"}, json={ 'model': 'jev-1.13', 'state': {'subject': 'Charged twice', 'message': 'My card was charged twice for the annual plan. Please refund the extra charge today.'}, 'questions': { 'team': {'type': 'choice', 'instructions': 'Which team should handle this ticket', 'criteria': {'billing': 'Charges, invoices, refunds', 'technical': 'Errors, outages, broken features', 'other': 'None of these'}}, 'urgency': {'type': 'score', 'instructions': 'How urgent the request is', 'criteria': ['No time pressure', 'Wants action soon', 'Wants action today']}, 'refund': {'type': 'noul', 'instructions': 'The customer is asking for money back'}, }, })resp.raise_for_status()answers = resp.json()['answers']team = answers['team']assert team['choice'] in ('billing', 'technical', 'other')assert abs(sum(team['probabilities'].values()) - 1) < 0.01refund = answers['refund']['noul']route = 'refund-desk' if refund >= 0.7 else 'person' if refund > 0.3 else 'queue'print(team['choice'], round(team['probabilities'][team['choice']], 2), answers['urgency']['score'], refund, route)Expected: it prints billing 1 2 0.99 refund-desk (probabilities may differ slightly) and exits with code 0. The three questions share one state, are answered in parallel and are billed for one read.
3. The three question types
| Type | Use for | Request fields | Answer |
|---|---|---|---|
noul | one yes/no statement | instructions; optional criteria: { true, false } describing what yes and no mean | noul: probability the statement is true |
choice | one of a fixed set (up to 255 options) | criteria: option name → description | choice, probabilities per option, confidence |
score | a position on an ordered scale (up to 10 levels) | criteria: an array from low to high | score, probabilities per level, legend, confidence |
instructions and each description can be a string, an object or an array; when two options are easily confused, write the descriptions as objects that say what belongs and what does not. Locating things in images (box) and image input (assets) are not supported yet and return 400.
4. Read answers and set cutoffs
- The probability of the top option is the likelihood it is right; act on it. For
noul, usenoulitself. confidencemeasures how concentrated the distribution is, not whether the answer is correct; use it as a second signal only.- Starting cutoffs for
noul: 0.7 or above is yes, 0.3 or below is no, and the middle goes to a person or another process. Adjust them to the cost of a mistake. - Let the model judge and let code decide: split “should this be escalated?” into a few checkable factual questions and combine the answers in code.
5. Billing and limits
Input tokens are billed and output is free; the price is pricing.input of jev-1.13 in the model catalog. The own face returns the amount charged for the call in usage.cost (US dollars); the compatible face returns it only in the X-Praxis-Cost-Usd header. Context is 32K tokens. A model that does not declare the protocol returns 404.
In workflows, the built-in decide action makes the same judgments and later steps branch on the answers.
Next steps
- Structured output: When you need a stable JSON shape rather than probabilities, constrain the answer with a JSON Schema.
- Model catalog: Which models can be used here, and their prices.
- Limits and errors: Error codes and retry strategy.