What This Example Shows
- One
POST /v1/decision/completionsrequest that asks three questions about the same state - A
noulquestion (yes or no), achoicequestion (pick a team) and ascorequestion (rate severity) - How to read each answer type, and
usage.total_cost - The same request in cURL and Python
requests
Why This Matters
Triage is a decision, not an essay. An LLM agent asked “is this urgent, which team, how bad” returns prose you have to parse, and it can phrase the answer differently every time. A decision model returns a probability, a pick and a score you can branch on directly, all three in one request, for about $0.00002.Step 1: Setup
Get an API key from https://swarms.world/platform/api-keys.Step 2: Send the Request
model_name is left out, so the request uses the default, jev-latest.
- cURL
- Python
Step 3: Read the Answers
The live response from production:noulis the probability that the statement is true: 0.97 that this is urgent.choiceis the most likely option.probabilitiesholds every option, so you can see thatinfrawas the runner-up at 0.07, andconfidencetells you when to send the ticket to a person instead.scoreis an expected value where the first level is 0. 2.99 sits next to level 3, andlegendnames it: Critical.modelis the version that answered:jev-latestresolved tojev-1.14.0.
Cost
The request used 393 input tokens atjev-latest’s $0.0483 per 1M input tokens, with output free:
393 × $0.0483 / 1,000,000 = $0.0000190, which is the usage.total_cost above. Three questions cost the same as one would have, because the state’s tokens are billed once. At that rate, 10,000 tickets cost about $0.19.
Prices come from GET /v1/decision/models; see List Decision Models and Estimate Costs.
Next Steps
- Decision Models and SystemOne Reference: question types, errors and the TypeSafe API format
- SystemOne: Use the TypeSafe Format: the same request in the TypeSafe API’s format
- Gate and Judge an Agent: put a decision model on either side of an agent call
- Pick a Swarm and the Best Draft: let a decision model choose the swarm type and the winning output