{"openapi": "3.1.0", "info": {"title": "Zils training API", "version": "1", "description": "Train a custom decision model on your labeled examples: create a job, PUT the train, calibration and test JSONL splits to the returned signed URLs, submit, and poll. An accepted model is served on the decision API under a name made from the job name and the first eight characters of its id (e.g. support-actions-9f670236); GET /v1/models there lists it once it is live."}, "servers": [{"url": "https://training.zils.ai"}], "components": {"securitySchemes": {"btauth": {"type": "apiKey", "in": "header", "name": "X-Bittensor-Signature", "description": "btauth/1 (https://www.bittensor.com/docs/guides/signed-requests): sign each request with your sr25519 hotkey, receiver = the service hotkey in the services document, and send the X-Bittensor-Version/Hotkey/Receiver/Nonce/Signature headers. The signed path is the full public path, including any prefix in the server URL. Use a fresh nonce for every attempt. Spend gamma at the service hotkey first; the hotkey is the account, no sign-up or key."}}, "schemas": {"Case": {"type": "object", "required": ["id", "group_id", "family", "state", "question", "label"], "description": "One JSONL line of a dataset split. `question` is a System One question (see the decision API); `label` is the correct option: \"true\"/\"false\" for noul, an option name for choice, the zero-based level as a string for score. Each split needs at least one case; ids are unique across splits, and a group_id (related source records) stays within one split. Every case of a job asks the same question. At most 128 KiB per case.", "properties": {"id": {"type": "string"}, "group_id": {"type": "string"}, "family": {"type": "string", "description": "A slice name used in the quality report."}, "state": {"type": "object"}, "question": {"type": "object", "required": ["type"], "additionalProperties": false, "properties": {"type": {"enum": ["noul", "choice", "score"]}, "instructions": {"type": ["string", "null"]}, "criteria": {"description": "noul: optional {\"true\": text, \"false\": text}; choice: required {option_name: description} with 2-255 options; score: required list of 2-10 level descriptions, lowest first.", "oneOf": [{"type": "object"}, {"type": "array", "items": {"type": "string"}}]}}}, "label": {"type": "string"}}}}}, "paths": {"/v1/config": {"get": {"summary": "Public: trainable base models, channels and limits.", "responses": {"200": {"description": "Configuration"}}}}, "/v1/jobs": {"get": {"summary": "This hotkey's jobs and the models it can train on.", "security": [{"btauth": []}], "responses": {"200": {"description": "Jobs", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}}}, "post": {"summary": "Create a training job; returns signed PUT URLs for the three splits.", "description": "Private jobs reserve the 2 USD minimum at submit and the full price (per training token) after validation; a job the balance cannot cover fails with the price in its error.", "security": [{"btauth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "required": ["name", "acceptance", "allow_training_data_export"], "properties": {"name": {"type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"}, "acceptance": {"type": "object", "required": ["min_accuracy", "min_brier_improvement"], "properties": {"min_accuracy": {"type": "number", "minimum": 0, "maximum": 1}, "min_brier_improvement": {"type": "number", "minimum": 0, "maximum": 2}}, "example": {"min_accuracy": 0, "min_brier_improvement": 0}}, "allow_training_data_export": {"const": true, "description": "Permission for approved Zils workers to read the data."}, "tier": {"enum": ["private", "open"], "default": "private"}, "allow_open_tier_training": {"type": "boolean"}}}}}}, "responses": {"200": {"description": "Job and upload URLs", "content": {"application/json": {"schema": {"type": "object", "properties": {"job": {"type": "object"}, "uploads": {"type": "object", "description": "train, calibration, test: a signed PUT URL each (JSONL of Case)."}}}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}, "402": {"description": "Insufficient balance: no work was done. Body {\"error\": \"insufficient_balance\"}.", "content": {"application/json": {"schema": {"type": "object", "properties": {"error": {}, "message": {"type": "string"}}}}}}}}}, "/v1/jobs/{job_id}": {"get": {"summary": "Job status: uploading, validating, awaiting_approval, running, completed or failed.", "security": [{"btauth": []}], "parameters": [{"name": "job_id", "in": "path", "required": true}], "responses": {"200": {"description": "Job", "content": {"application/json": {"schema": {"type": "object", "properties": {"job": {"type": "object"}}}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}}}}, "/v1/jobs/{job_id}/uploads": {"post": {"summary": "Fresh signed PUT URLs for splits not yet uploaded.", "security": [{"btauth": []}], "parameters": [{"name": "job_id", "in": "path", "required": true}], "requestBody": {"content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "Upload URLs", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}}}}, "/v1/jobs/{job_id}/submit": {"post": {"summary": "Start training once all three splits are uploaded.", "security": [{"btauth": []}], "parameters": [{"name": "job_id", "in": "path", "required": true}], "requestBody": {"content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "Submitted job", "content": {"application/json": {"schema": {"type": "object", "properties": {"job": {"type": "object"}}}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}, "402": {"description": "Insufficient balance: no work was done. Body {\"error\": \"insufficient_balance\"}.", "content": {"application/json": {"schema": {"type": "object", "properties": {"error": {}, "message": {"type": "string"}}}}}}}}}, "/v1/jobs/{job_id}/cancel": {"post": {"summary": "Stop a job. Cancelling after training began still charges it.", "security": [{"btauth": []}], "parameters": [{"name": "job_id", "in": "path", "required": true}], "requestBody": {"content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "Cancelled job", "content": {"application/json": {"schema": {"type": "object", "properties": {"job": {"type": "object"}}}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}}}}, "/v1/jobs/{job_id}/downloads": {"get": {"summary": "Signed URLs for a completed private job's model files.", "security": [{"btauth": []}], "parameters": [{"name": "job_id", "in": "path", "required": true}], "responses": {"200": {"description": "Download URLs", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}}}}}}