Skip to main content

What This Example Shows

  • One POST /v1/decision/completions request that asks three questions about the same state
  • A noul question (yes or no), a choice question (pick a team) and a score question (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.

Step 3: Read the Answers

The live response from production:
  • noul is the probability that the statement is true: 0.97 that this is urgent.
  • choice is the most likely option. probabilities holds every option, so you can see that infra was the runner-up at 0.07, and confidence tells you when to send the ticket to a person instead.
  • score is an expected value where the first level is 0. 2.99 sits next to level 3, and legend names it: Critical.
  • model is the version that answered: jev-latest resolved to jev-1.14.0.

Cost

The request used 393 input tokens at jev-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