typestrict.aidocs

Trainings

The five steps of a training, what each one needs next, and how lists come in pages.

A training is a dataset being prepared (steps 1 to 3) or, once it runs, a model (steps 4 and 5). Each one carries step (1 to 5) and next_action, the same two fields the dashboard, the CLI and the assistants read, so any of them can drive the flow.

{
  "kind": "dataset",
  "id": "0199f0c4-…",
  "name": "support tickets",
  "status": "ready",
  "step": 2,
  "next_action": "structure"
}

Next actions

next_actionWhat it meansWhat to call
upload_filesFiles still to send.PUT each file to its URL, then POST /v1/datasets/{id}/files/{file}/complete
waitWe are working on it.Read it again in a few seconds: GET /v1/datasets/{id} or GET /v1/models/{id}
start_overThe data could not be read.Create a new dataset with the files fixed
structureThe data is read and masked.POST /v1/datasets/{id}/structure, or POST /v1/datasets/{id}/suggest to see decisions first
pick_decisionsThe agent suggested decisions.POST /v1/datasets/{id}/structure with { "questions": [...] }
label_examplesThe held-out examples need answers.GET /v1/datasets/{id}/labels/next, then POST /v1/datasets/{id}/labels/{task} with { "label": "..." }
start_trainingReady to train.GET /v1/encoders, then POST /v1/datasets/{id}/models with { "encoder": "ts-moberto-150m" } (1 credit)
retryThe training failed; the credit came back.POST /v1/datasets/{dataset}/models again
downloadThe model is ready.GET /v1/models/{id}/download returns a link valid for 15 minutes, until files_expire_at
noneThe model's files went (expired, refunded or on your Hugging Face).Nothing: the record and the audit stay (Retention)
expiredThe dataset's data expired.Upload it again to train (Retention)

Starting a training without credits answers 402 with "error": "no_credits".

Pages

Lists come newest first, a page at a time:

{ "data": [ ... ], "next": "6b3f…" }

Pass limit (1 to 100, 25 by default) and, for the following page, cursor with the last next. A page stays the same while new trainings arrive at the top. GET /v1/models and GET /v1/datasets also take status (done for finished models, ready for structured datasets).

curl "https://api.typestrict.ai/v1/models?status=done&limit=10" \
  -H "Authorization: Bearer $TYPESTRICT_API_KEY"

On this page