Skip to main content
A decision model answers typed questions about a piece of content, the state, and returns calibrated probabilities instead of generated text. One request can ask several questions, and each answer comes back as a number or a pick you can branch on directly, with no parsing and no prompt to coax a format out of an LLM. Use a decision model instead of an LLM agent when the output is a decision, not prose:
  • Classifying: which category, team or intent a message belongs to
  • Routing: which agent, swarm type or model should handle a task
  • Gating: whether a task needs an expensive agent call at all
  • Grading: how good an answer is before it ships
A request costs a few hundredths of a cent, so you can put a decision model in front of or behind every agent call.

Endpoints

All three take your API key in the x-api-key header.

Request

Several questions go in one request, and the state’s tokens are billed once, so asking three questions about a ticket costs about the same as asking one.

Question Types

Every question has a type, optional instructions saying what to decide, and criteria.
  • choice is the most likely option and probabilities holds every option’s probability.
  • score is an expected value where the first level is 0. With four levels, a score of 2.99 means almost certainly the fourth level. legend maps each level’s position to its description.
  • confidence is how sure the model is of a choice or score answer, from 0 to 1. Send low-confidence answers to a person.

Response

POST /v1/decision/completions returns: usage.total_cost is the amount charged for the request. See Decision Model Completion for a full request and response.

TypeSafe API Format

POST /v1/systemone takes and returns exactly what the TypeSafe API does, so the TypeSafe SDKs work with base_url set to https://api.swarms.world and a Swarms API key.
  • model is required.
  • The response has only model, answers and usage with input_tokens and output_tokens.
  • The job ID is in the x-typesafe-request-id response header, and the amount charged in x-swarms-total-cost.

Models and Pricing

Decision models are billed per token at the model’s price. Call GET /v1/decision/models for the current models and their input_cost_per_1m and output_cost_per_1m in USD, and see List Decision Models and Estimate Costs for estimating a request’s cost from them.
  • The same $1.00 minimum balance as the other completion endpoints applies.
  • Nothing is charged when a request fails.

Errors