What This Example Shows
- Listing the available decision models and their prices with
GET /v1/decision/models - Choosing between the
jev-latestalias and a pinned version - Estimating a request’s cost from its token count, and checking it against
usage.total_cost
Why This Matters
The model list changes as models are added and versions ship, so read prices from the endpoint instead of copying them into your code. The same prices let you budget a job before you run it: a decision model is billed per token, so a request’s cost is its token count times the model’s price.Step 1: List the Models
- cURL
- Python
release_date is always an empty string; it is there for TypeSafe SDK compatibility.
Step 2: Choose jev-latest or a Pinned Version
jev-latest is an alias, and it is the default when you leave out model_name. The version behind it can change, so every completion’s model field shows which version actually answered:
jev-latest was answered by jev-1.14.0, a newer version than the pinned jev-1.13.0 in the list. Only names in the list can be requested; any other returns 400.
- Use
jev-latestto get new versions without changing your code. - Pin a listed version such as
jev-1.13.0when answers must stay comparable over time, for example when you tuned routing thresholds on its probabilities.
Step 3: Estimate a Request’s Cost
A request costsinput_tokens × input_cost_per_1m / 1,000,000, plus the same for output tokens:
The TypeSafe SDK’s
client.models.list() gets this same list from GET /v1/models, so code written against the TypeSafe SDK sees the Swarms prices without changes.Next Steps
- Decision Models and SystemOne Reference: request fields, question types and errors
- Gate and Judge an Agent: what a decision call costs next to the agent call it gates
- Get Decision Models and Prices: the endpoint’s API reference