POST /v1/decisions. Most existing integrations move with three changes.
What to change
- Base URL: send requests to
https://api.torchcast.ai/v1/decisions. - API key: create a key in the console and send it as
Authorization: Bearer tcd_.... - Model id: use
torchcast-decider-latest, or a pinned id fromGET /v1/models.
cURL
answers, usage and error keeps working.
Rules to check
The response model is the pinned id
The model field of a successful response is always the pinned id that answered, never the alias you sent. If you call torchcast-decider-latest, expect model to be a pinned id such as torchcast-decider-4b-v1-1-api-1. If your code compares the response model with the requested one, compare against the alias’s target_model from GET /v1/models instead, or drop the check. See Models.
Question names
Question names must be 1 to 64 characters of letters, digits,_ and -. Names with spaces, dots or other characters are rejected with 400 invalid_request. Rename such questions, for example "is defect?" to is_defect.
Option names
choice option names must be 1 to 128 characters, and each must be unique within its question. A JSON body that repeats a key anywhere (in questions, in criteria, or inside the state) is rejected with 400, rather than silently keeping the last value.
Strict request fields
Fields other thanmodel, state and questions at the top level, and other than type, instructions and criteria in a question, are rejected with 400 invalid_request, with param naming the field.