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_action | What it means | What to call |
|---|---|---|
upload_files | Files still to send. | PUT each file to its URL, then POST /v1/datasets/{id}/files/{file}/complete |
wait | We are working on it. | Read it again in a few seconds: GET /v1/datasets/{id} or GET /v1/models/{id} |
start_over | The data could not be read. | Create a new dataset with the files fixed |
structure | The data is read and masked. | POST /v1/datasets/{id}/structure, or POST /v1/datasets/{id}/suggest to see decisions first |
pick_decisions | The agent suggested decisions. | POST /v1/datasets/{id}/structure with { "questions": [...] } |
label_examples | The held-out examples need answers. | GET /v1/datasets/{id}/labels/next, then POST /v1/datasets/{id}/labels/{task} with { "label": "..." } |
start_training | Ready to train. | GET /v1/encoders, then POST /v1/datasets/{id}/models with { "encoder": "ts-moberto-150m" } (1 credit) |
retry | The training failed; the credit came back. | POST /v1/datasets/{dataset}/models again |
download | The model is ready. | GET /v1/models/{id}/download returns a link valid for 15 minutes, until files_expire_at |
none | The model's files went (expired, refunded or on your Hugging Face). | Nothing: the record and the audit stay (Retention) |
expired | The 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"