{"openapi": "3.1.0", "info": {"title": "Zils decision API", "version": "1"}, "servers": [{"url": "https://training.zils.ai/decision"}], "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."}}}, "paths": {"/v1/models": {"get": {"summary": "Models this hotkey may call (shared ones plus its own trained models).", "security": [{"btauth": []}], "responses": {"200": {"description": "Model names", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}, "402": {"description": "This hotkey has never been credited."}}}}, "/v1/systemone": {"post": {"summary": "Ask typed questions (noul = yes/no probability, choice, score) about one state.", "description": "Charged per billable input token at the listed price; output is free.", "security": [{"btauth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "required": ["model", "state", "questions"], "properties": {"model": {"type": "string", "description": "A name from GET /v1/models, e.g. zils-shared."}, "state": {"type": "object", "description": "The facts every question is asked about."}, "questions": {"type": "object", "additionalProperties": {"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"}}]}}}}}, "example": {"model": "zils-shared", "state": {"query": "USB-C cable", "product": "One metre USB-C to USB-C cable"}, "questions": {"match": {"type": "noul", "instructions": "Does this product match the query?"}, "fit": {"type": "score", "instructions": "How closely does it fit?", "criteria": ["Does not match", "Partly matches", "Fully matches"]}}}}}}}, "responses": {"200": {"description": "Typed answers and token usage", "content": {"application/json": {"schema": {"type": "object", "properties": {"model": {"type": "string"}, "answers": {"type": "object"}, "usage": {"type": "object", "properties": {"input_tokens": {"type": "integer"}, "output_tokens": {"type": "integer"}, "billable_input_tokens": {"type": "integer"}}}}}}}}, "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/batches": {"post": {"summary": "Create a bulk job: returns a batch id and a signed PUT URL for JSONL input.", "description": "Each JSONL line is {\"custom_id\": str, \"body\": <System One request>}. PUT the bytes to upload.url with upload.headers, then POST /v1/batches/{id}/submit.", "security": [{"btauth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "required": ["idempotency_key"], "properties": {"idempotency_key": {"type": "string"}}}}}}, "responses": {"200": {"description": "Batch id, limits and upload", "content": {"application/json": {"schema": {"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/batches/{batch_id}": {"get": {"summary": "Batch status and counts.", "security": [{"btauth": []}], "parameters": [{"name": "batch_id", "in": "path", "required": true}], "responses": {"200": {"description": "Status", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}}}}, "/v1/batches/{batch_id}/submit": {"post": {"summary": "Queue an uploaded batch.", "security": [{"btauth": []}], "parameters": [{"name": "batch_id", "in": "path", "required": true}], "requestBody": {"content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "Queued batch", "content": {"application/json": {"schema": {"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/batches/{batch_id}/cancel": {"post": {"summary": "Stop new work on a batch.", "security": [{"btauth": []}], "parameters": [{"name": "batch_id", "in": "path", "required": true}], "requestBody": {"content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "Cancelled batch", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}}}}, "/v1/batches/{batch_id}/results": {"get": {"summary": "Up to 20 committed results after a cursor; follow next_cursor.", "security": [{"btauth": []}], "parameters": [{"name": "batch_id", "in": "path", "required": true}, {"name": "after", "in": "query", "required": true}], "responses": {"200": {"description": "Results page", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Invalid, stale or replayed signature."}, "429": {"description": "Throughput limit; honor Retry-After."}}}}, "/v1/gamma/balance": {"get": {"summary": "Public: a hotkey's spendable USD balance, however it was funded.", "parameters": [{"name": "hotkey", "in": "query", "required": true}], "responses": {"200": {"description": "Decimal USD strings; zeros for an unknown hotkey.", "content": {"application/json": {"schema": {"type": "object", "properties": {"hotkey": {"type": "string"}, "credited_usd": {"type": "string"}, "used_usd": {"type": "string"}, "remaining_usd": {"type": "string"}}}}}}}}}}}