Pinned ids and the latest alias
There are two kinds of model id:
- Pinned ids, such as
torchcast-decider-4b-v1-1-api-1, name one exact model. A pinned id never changes meaning: the same id always runs the same model with the same configuration, so its behavior does not shift under you. - The alias
torchcast-decider-latestpoints at the newest stable pinned id. When a new model is released, the alias moves to it. Use the alias to get improvements without code changes; use a pinned id when production behavior must stay fixed until you choose to move.
torchcast-decider-4b-v1-1-api-1. The retirement example below is illustrative. The current list is always GET /v1/models.
The response names the pinned model
Themodel field of every successful response is the pinned id that answered, even when the request named the alias. Record it next to each result: probabilities from different models are not directly comparable, and the pinned id tells you which model produced which numbers.
A request is never answered by a different model than the one it resolved to. If that model is unavailable, the request fails with 503 model_unavailable instead.
Retirement
A pinned id can be retired. A request to a retired id fails with410. When there is a successor, replacement_model names it:
Error
replacement_model is null: choose another active id from GET /v1/models, or use torchcast-decider-latest. The alias is never retired. A request to an id that does not exist fails with 400 invalid_model, and valid_models lists the ids you can call. See Errors.
List the models
GET https://api.torchcast.ai/v1/models lists every model id. It needs no API key, and it is rate limited to 5 requests per second per client IP.
Models
null for the price so that these docs never state one. A model’s live entry carries its current price.
If the model list cannot be loaded, this endpoint answers
503 model_unavailable; retry with backoff.
Per-model limits are never above the global limits on Limits, and can be lower. Read them from this endpoint instead of hard-coding them. Each model’s input-length limit, in tokens, is not in this list; see Input length.
These are the limits the API checks before calling the model. For a short time after a model is added or updated, they can be the global ceilings while the model’s own limits are still loading. In that window the model itself may reject a request that is within them, with 400 invalid_request; reduce the request and retry.