{"openapi": "3.1.0", "info": {"title": "temperwork API", "version": "1.0.0", "description": "The temperwork public API: pipelines and steps, judges, datasets,\nexecutions, trainings and LoRAs, for scripts and agents. Every request sends\nan API key made on the Account page, under API keys:\n`Authorization: Bearer tw_...` (or `X-Api-Key: tw_...`). A key acts for the user who made it, in the\norg they acted for then, with its scopes: `read`, or `write` (which also\nreads). Credits, environments, the account, orgs and keys are managed in the\npage only.\n\nErrors are `{\"error\": {\"code\", \"message\"}}` with 400, 401 (no key, a\nrevoked, expired or read-only one), 402 (not enough credits: nothing was\nqueued), 404, 409 and 503. POSTs that queue work take an `Idempotency-Key`\nheader: the same key again within a day gets the first answer (with\n`Idempotent-Replayed: true`) instead of starting it twice."}, "servers": [{"url": "/", "description": "this studio"}], "security": [{"bearer": []}, {"apiKeyHeader": []}], "tags": [{"name": "Key"}, {"name": "Datasets"}, {"name": "Pipelines"}, {"name": "Judges"}, {"name": "Executions"}, {"name": "Trainings"}, {"name": "LoRAs"}], "paths": {"/v1/key": {"get": {"tags": ["Key"], "summary": "The key in use", "operationId": "getKey", "description": "The key this request was sent with: its name, scopes and expiry, and the user and org it acts for.\n\nScope: `read`.", "x-scope": "read", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/datasets": {"get": {"tags": ["Datasets"], "summary": "List datasets", "operationId": "getDatasets", "description": "Your datasets (the org's, acting for an org) and the public ones, and your folders.\n\nReturns `{datasets: [{name, modality, origin, public, file_count, folder, ...}], folders, modalities}`.\n\nScope: `read`.", "x-scope": "read", "parameters": [], "responses": {"200": {"description": "`{datasets: [{name, modality, origin, public, file_count, folder, ...}], folders, modalities}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}, "post": {"tags": ["Datasets"], "summary": "Create a dataset", "operationId": "postDatasets", "description": "An empty dataset for uploads. An upload dataset of the same name and modality is fine.\n\nReturns the dataset.\n\nScope: `write`.", "x-scope": "write", "parameters": [], "responses": {"200": {"description": "the dataset", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string", "description": "a dataset name (letters, digits, `-`, `_`, `.`)"}, "modality": {"type": "string", "description": "what it holds (default images)", "enum": ["images", "video", "text", "audio"]}, "folder": {"type": "string", "description": "the folder to put it in"}}, "required": ["name"]}}}}}}, "/v1/datasets/move": {"post": {"tags": ["Datasets"], "summary": "Move datasets and folders", "operationId": "postDatasetsMove", "description": "Returns `{folders}`.\n\nScope: `write`.", "x-scope": "write", "parameters": [], "responses": {"200": {"description": "`{folders}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"to": {"type": "string", "description": "the folder (null: the top)"}, "datasets": {"type": "array", "description": "dataset names", "items": {"type": "string"}}, "folders": {"type": "array", "description": "folder ids", "items": {"type": "string"}}}}}}}}}, "/v1/datasets/{name}": {"get": {"tags": ["Datasets"], "summary": "Get a dataset", "operationId": "getDatasetsName", "description": "Returns `{name, modality, origin, public, created, created_by, from, file_count, files}`.\n\nScope: `read`.", "x-scope": "read", "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "`{name, modality, origin, public, created, created_by, from, file_count, files}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/datasets/{name}/copy": {"post": {"tags": ["Datasets"], "summary": "Copy a dataset", "operationId": "postDatasetsNameCopy", "description": "A copy in your own datasets, which you can change: of a public dataset, or of one of yours, whole or only some of its files.\n\nReturns the copy.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "the copy", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"as": {"type": "string", "description": "the copy's name (a public dataset: its own by default)"}, "folder": {"type": "string", "description": "the folder to put the copy in"}, "files": {"type": "array", "description": "only these of its files, by name (e.g. the ones a judge passed, to train on); absent: all", "items": {"type": "string"}}}}}}}}}, "/v1/datasets/{name}/delete": {"post": {"tags": ["Datasets"], "summary": "Delete a dataset or one file", "operationId": "postDatasetsNameDelete", "description": "Scope: `write`.", "x-scope": "write", "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"file": {"type": "string", "description": "one file of an upload dataset; absent: the whole dataset"}}}}}}}}, "/v1/datasets/{name}/files": {"post": {"tags": ["Datasets"], "summary": "Upload a file", "operationId": "postDatasetsNameFiles", "description": "The request body is the file (`Content-Type: application/octet-stream`), at most 4 MB on the hosted studio; larger files go straight to storage through `/uploads`. The dataset is made if it is new.\n\nReturns `{dataset, file}`: the name it was saved under.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "file", "in": "query", "required": true, "description": "the file's name (a -2, -3 ... suffix if taken)", "schema": {"type": "string"}}, {"name": "modality", "in": "query", "required": false, "description": "a new dataset's modality (default images)", "schema": {"type": "string"}}, {"name": "folder", "in": "query", "required": false, "description": "a new dataset's folder", "schema": {"type": "string"}}], "responses": {"200": {"description": "`{dataset, file}`: the name it was saved under", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/octet-stream": {"schema": {"type": "string", "format": "binary"}}}}}}, "/v1/datasets/{name}/links": {"post": {"tags": ["Datasets"], "summary": "Get download links", "operationId": "postDatasetsNameLinks", "description": "Links to the files, valid for 15 minutes. Files going out past the month's free bytes are charged in credits (402 when there are too few). A public dataset's files are not downloaded.\n\nReturns `{links: [{file, url, size}], expires_s}`.\n\nScope: `read`.", "x-scope": "read", "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "`{links: [{file, url, size}], expires_s}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"files": {"type": "array", "description": "the files (default: all, up to 1000)", "items": {"type": "string"}}}}}}}}}, "/v1/datasets/{name}/uploads": {"post": {"tags": ["Datasets"], "summary": "Get an upload URL", "operationId": "postDatasetsNameUploads", "description": "A presigned URL to `PUT` one file to, for an hour (hosted studio). Then call `complete` with the `file` it gives, so the studio checks it and makes its thumbnail.\n\nReturns `{method: PUT, url, file, expires_s, complete}`.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "`{method: PUT, url, file, expires_s, complete}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"file": {"type": "string", "description": "the file's name"}, "modality": {"type": "string", "description": "a new dataset's modality"}, "folder": {"type": "string", "description": "a new dataset's folder"}}, "required": ["file"]}}}}}}, "/v1/datasets/{name}/uploads/complete": {"post": {"tags": ["Datasets"], "summary": "Complete an upload", "operationId": "postDatasetsNameUploadsComplete", "description": "A file that isn't what its name says (or is too big) is deleted and refused.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"file": {"type": "string", "description": "the `file` the upload URL gave"}}, "required": ["file"]}}}}}}, "/v1/folders": {"post": {"tags": ["Datasets"], "summary": "Create a folder", "operationId": "postFolders", "description": "Returns `{folder, folders}`: its id.\n\nScope: `write`.", "x-scope": "write", "parameters": [], "responses": {"200": {"description": "`{folder, folders}`: its id", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string", "description": "its name"}, "parent": {"type": "string", "description": "the folder it goes in"}}, "required": ["name"]}}}}}}, "/v1/folders/{folder_id}/delete": {"post": {"tags": ["Datasets"], "summary": "Delete a folder", "operationId": "postFoldersFolderidDelete", "description": "What it held moves up to its parent.\n\nReturns `{folders}`.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "folder_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "`{folders}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {}}}}}}}, "/v1/folders/{folder_id}/rename": {"post": {"tags": ["Datasets"], "summary": "Rename a folder", "operationId": "postFoldersFolderidRename", "description": "Returns `{folders}`.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "folder_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "`{folders}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string", "description": "its new name"}}, "required": ["name"]}}}}}}, "/v1/kinds": {"get": {"tags": ["Pipelines"], "summary": "Kinds and their settings", "operationId": "getKinds", "description": "Each kind (step, pipeline, judge): its settings' fields, defaults and run options.\n\nScope: `read`.", "x-scope": "read", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/models": {"get": {"tags": ["Pipelines"], "summary": "Base models", "operationId": "getModels", "description": "Returns `{models: [{id, label, takes, makes, status, default}]}`: status ga (tested, it has produced output) or beta.\n\nScope: `read`.", "x-scope": "read", "parameters": [], "responses": {"200": {"description": "`{models: [{id, label, takes, makes, status, default}]}`: status ga (tested, it has produced output) or beta", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/pipelines": {"get": {"tags": ["Pipelines"], "summary": "List steps, pipelines and judges", "operationId": "getPipelines", "description": "Returns `{pipelines: [{pipeline_id, name, kind, latest_version, ...}]}`.\n\nScope: `read`.", "x-scope": "read", "parameters": [{"name": "kind", "in": "query", "required": false, "description": "only this kind", "schema": {"type": "string", "enum": ["step", "pipeline", "judge"]}}, {"name": "archived", "in": "query", "required": false, "description": "the archived ones instead", "schema": {"type": "boolean"}}], "responses": {"200": {"description": "`{pipelines: [{pipeline_id, name, kind, latest_version, ...}]}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}, "post": {"tags": ["Pipelines"], "summary": "Create a step, pipeline or judge", "operationId": "postPipelines", "description": "Returns `{pipeline, warnings}`.\n\nScope: `write`.", "x-scope": "write", "parameters": [], "responses": {"200": {"description": "`{pipeline, warnings}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string", "description": "its name"}, "kind": {"type": "string", "description": "what it is (default step)", "enum": ["step", "pipeline", "judge"]}, "settings": {"type": "object", "description": "its settings (GET /v1/kinds: each kind's fields and defaults); a pipeline's `steps` is a list of blocks: `{pipeline_id, version}` or `{parallel: [[step, ...], ...]}`"}, "copy_of": {"type": "object", "description": "`{pipeline_id, version}`: a copy of that version instead"}, "note": {"type": "string", "description": "a note on its first version"}}, "required": ["name"]}}}}}}, "/v1/pipelines/{pipeline_id}": {"get": {"tags": ["Pipelines"], "summary": "Get one", "operationId": "getPipelinesPipelineid", "description": "Returns the record, with `credits`: what its latest version costs.\n\nScope: `read`.", "x-scope": "read", "parameters": [{"name": "pipeline_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "the record, with `credits`: what its latest version costs", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/pipelines/{pipeline_id}/delete": {"post": {"tags": ["Pipelines"], "summary": "Delete it and its versions", "operationId": "postPipelinesPipelineidDelete", "description": "Scope: `write`.", "x-scope": "write", "parameters": [{"name": "pipeline_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {}}}}}}}, "/v1/pipelines/{pipeline_id}/update": {"post": {"tags": ["Pipelines"], "summary": "Rename or archive", "operationId": "postPipelinesPipelineidUpdate", "description": "Scope: `write`.", "x-scope": "write", "parameters": [{"name": "pipeline_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string", "description": "a new name"}, "archived": {"type": "boolean", "description": "archive or bring back"}}}}}}}}, "/v1/pipelines/{pipeline_id}/versions": {"post": {"tags": ["Pipelines"], "summary": "Save a new version", "operationId": "postPipelinesPipelineidVersions", "description": "Versions never change once saved.\n\nReturns `{version, warnings}`.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "pipeline_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "`{version, warnings}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"settings": {"type": "object", "description": "every setting of the new version (defaults filled in)"}, "base_version": {"type": "integer", "description": "the version these edits start from (409 if it is no longer the latest)"}, "note": {"type": "string", "description": "what changed"}}, "required": ["settings", "base_version"]}}}}}}, "/v1/pipelines/{pipeline_id}/versions/{version}": {"get": {"tags": ["Pipelines"], "summary": "Get a version", "operationId": "getPipelinesPipelineidVersionsVersion", "description": "Scope: `read`.", "x-scope": "read", "parameters": [{"name": "pipeline_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "version", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/pipelines/{pipeline_id}/versions/{version}/delete": {"post": {"tags": ["Pipelines"], "summary": "Delete a version", "operationId": "postPipelinesPipelineidVersionsVersionDelete", "description": "Scope: `write`.", "x-scope": "write", "parameters": [{"name": "pipeline_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "version", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {}}}}}}}, "/v1/datasets/{name}/judgements": {"get": {"tags": ["Judges"], "summary": "A dataset's judgements", "operationId": "getDatasetsNameJudgements", "description": "Returns `{dataset, files, judges, reviews, ...}`: each judge's verdicts on its files.\n\nScope: `read`.", "x-scope": "read", "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "`{dataset, files, judges, reviews, ...}`: each judge's verdicts on its files", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/judges": {"get": {"tags": ["Judges"], "summary": "List judges", "operationId": "getJudges", "description": "The same as GET /v1/pipelines?kind=judge. Start a judge's run with POST /v1/executions, `type: judge`.\n\nScope: `read`.", "x-scope": "read", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/judges/{pipeline_id}/board": {"get": {"tags": ["Judges"], "summary": "A judge's scoreboard", "operationId": "getJudgesPipelineidBoard", "description": "`review` grades the judge against people's labels: `detection` (`tpr`: true fails it caught, `tnr`: true passes it passed, `balanced`: their mean, each with `lo`/`hi`, a 95% interval), raw agreement (`rate`), `judged` (its pass rate) and `corrected` (that rate corrected for its error rates, once 5 files of each kind are labelled); each llm step of `by_step` a `suggested` pass mark. `top` and `pipelines` rows carry `interval` (95%) and `tied_next` (overlaps the next row: the ranking is not separable); each row `corrected`.\n\nReturns `{judge_id, judged, review, recent, top, pipelines, models}`.\n\nScope: `read`.", "x-scope": "read", "parameters": [{"name": "pipeline_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "required": false, "description": "rows of recent and top (1 to 100, default 10)", "schema": {"type": "integer"}}], "responses": {"200": {"description": "`{judge_id, judged, review, recent, top, pipelines, models}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/judges/{pipeline_id}/remark": {"post": {"tags": ["Judges"], "summary": "Move llm steps' pass marks", "operationId": "postJudgesPipelineidRemark", "description": "Saves a new version with those llm steps' pass marks and works out its verdicts on every dataset base_version judged last from the scores kept, without judging again. Files an earlier step failed before and now passes are left not judged until the version runs on them (`needs_run`).\n\nReturns `{version, datasets, needs_run, skipped, warnings}`.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "pipeline_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "`{version, datasets, needs_run, skipped, warnings}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"marks": {"type": "object", "description": "{step name: pass mark, 1 to 10}"}, "base_version": {"type": "integer", "description": "the version the marks start from (409 if it is no longer the latest)"}}, "required": ["marks", "base_version"]}}}}}}, "/v1/judges/{pipeline_id}/reviews": {"post": {"tags": ["Judges"], "summary": "Review a verdict", "operationId": "postJudgesPipelineidReviews", "description": "A person's label for a file a judge judged, which the board compares the judge against. Send only files someone looked at: each label counts as checked.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "pipeline_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"dataset": {"type": "string", "description": "the dataset judged (unless items)"}, "file": {"type": "string", "description": "the file (unless items)"}, "pass": {"type": "boolean", "description": "whether it should pass (null: clear the review)"}, "labels": {"type": "object", "description": "labels for the file"}, "items": {"type": "array", "description": "instead: labels across datasets, [{dataset, file, pass}]", "items": {"type": "object"}}}}}}}}}, "/v1/executions": {"get": {"tags": ["Executions"], "summary": "List executions", "operationId": "getExecutions", "description": "Newest first.\n\nReturns `{executions, cursor}`.\n\nScope: `read`.", "x-scope": "read", "parameters": [{"name": "pipeline_id", "in": "query", "required": false, "description": "one step's, pipeline's or judge's", "schema": {"type": "string"}}, {"name": "version", "in": "query", "required": false, "description": "its version (repeat for several)", "schema": {"type": "integer"}}, {"name": "type", "in": "query", "required": false, "description": "only these", "schema": {"type": "string", "enum": ["inference", "training", "judge"]}}, {"name": "model", "in": "query", "required": false, "description": "runs on this base model", "schema": {"type": "string"}}, {"name": "dataset", "in": "query", "required": false, "description": "runs that read or wrote it", "schema": {"type": "string"}}, {"name": "lora", "in": "query", "required": false, "description": "the trainings that make this LoRA", "schema": {"type": "string"}}, {"name": "from", "in": "query", "required": false, "description": "a date, 2026-11-11", "schema": {"type": "string"}}, {"name": "to", "in": "query", "required": false, "description": "a date", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "required": false, "description": "1 to 200, default 50", "schema": {"type": "integer"}}, {"name": "cursor", "in": "query", "required": false, "description": "the last page's cursor", "schema": {"type": "string"}}], "responses": {"200": {"description": "`{executions, cursor}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}, "post": {"tags": ["Executions"], "summary": "Start an execution", "operationId": "postExecutions", "description": "Checked, recorded as queued and sent to a queue; a worker runs it. Refused with 402 when the org's credits don't cover it (nothing is queued). Send an `Idempotency-Key` so a retry never starts two.\n\nReturns the execution, `{execution_id, status: queued, ...}`.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "description": "any unique string (1 to 255 ASCII characters): a retry with the same one within a day gets the first answer instead of starting it again", "schema": {"type": "string"}}], "responses": {"200": {"description": "the execution, `{execution_id, status: queued, ...}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"type": {"type": "string", "description": "what to start: a run of a step or pipeline (default), a judge's run, or a training (or use POST /v1/trainings)", "enum": ["run", "judge", "training"]}, "pipeline_id": {"type": "string", "description": "the step, pipeline or judge to run"}, "version": {"type": "integer", "description": "its version (default: the latest)"}, "data": {"type": "object", "description": "`{input}` (a dataset), with `ref`/`refs` for steps that take references; a judge's `{input, reference?}`"}, "run": {"type": "object", "description": "run options the step or pipeline takes (GET /v1/kinds: each kind's `run` fields)"}, "queue": {"type": "string", "description": "a queue to send it to, or env:<id> for one of the org's temperwork environments (default: where its datasets are, else temperwork's)"}, "training": {"type": "object", "description": "with type `training`: as POST /v1/trainings takes"}}}}}}}}, "/v1/executions/preview": {"post": {"tags": ["Executions"], "summary": "Check an execution without starting it", "operationId": "postExecutionsPreview", "description": "Checked as a start would be, recording nothing: its version, outputs, queue, and what it will cost.\n\nScope: `read`.", "x-scope": "read", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"type": {"type": "string", "description": "what to start: a run of a step or pipeline (default), a judge's run, or a training (or use POST /v1/trainings)", "enum": ["run", "judge", "training"]}, "pipeline_id": {"type": "string", "description": "the step, pipeline or judge to run"}, "version": {"type": "integer", "description": "its version (default: the latest)"}, "data": {"type": "object", "description": "`{input}` (a dataset), with `ref`/`refs` for steps that take references; a judge's `{input, reference?}`"}, "run": {"type": "object", "description": "run options the step or pipeline takes (GET /v1/kinds: each kind's `run` fields)"}, "queue": {"type": "string", "description": "a queue to send it to, or env:<id> for one of the org's temperwork environments (default: where its datasets are, else temperwork's)"}, "training": {"type": "object", "description": "with type `training`: as POST /v1/trainings takes"}}}}}}}}, "/v1/executions/{execution_id}": {"get": {"tags": ["Executions"], "summary": "Get an execution", "operationId": "getExecutionsExecutionid", "description": "As it stands now. With `wait`, the answer comes when it has finished (succeeded, failed, stopped or interrupted) or the time is up, whichever is first: poll again until `status` is one of those.\n\nScope: `read`.", "x-scope": "read", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "wait", "in": "query", "required": false, "description": "wait up to this many seconds (at most 25) for it to finish", "schema": {"type": "integer"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/executions/{execution_id}/cancel": {"post": {"tags": ["Executions"], "summary": "Cancel", "operationId": "postExecutionsExecutionidCancel", "description": "Take it off the queue before a worker starts it (a pipeline run: the steps not started yet; a judge run that is running: stopped at the next file).\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {}}}}}}}, "/v1/executions/{execution_id}/compare": {"get": {"tags": ["Executions"], "summary": "Compare runs", "operationId": "getExecutionsExecutionidCompare", "description": "Without `with`: the runs on the same input it can be compared with. With one `with`, `judges` holds each judge that judged both outputs, paired by source file: `a` and `b` pass rates (95% Wilson `lo`/`hi`), `pass_diff` (b - a, with an exact interval that agrees with the test), `only_a`/`only_b` and McNemar's exact `p` (`significant` under 0.05), and `score_diff` when files have scores.\n\nScope: `read`.", "x-scope": "read", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "with", "in": "query", "required": false, "description": "another run's id (repeat, up to 5)", "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/executions/{execution_id}/compare/pick": {"post": {"tags": ["Executions"], "summary": "Pick the better output", "operationId": "postExecutionsExecutionidComparePick", "description": "Scope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"with": {"type": "string", "description": "the other run (or a list, with `best`)"}, "file": {"type": "string", "description": "the file"}, "pick": {"type": "string", "description": "a, b or tie (null: undecided)"}, "best": {"type": "string", "description": "with several: the best run"}}, "required": ["file"]}}}}}}, "/v1/executions/{execution_id}/compare/try": {"post": {"tags": ["Executions"], "summary": "Try a change", "operationId": "postExecutionsExecutionidCompareTry", "description": "A new version of the run's step with these settings changed, queued on the same input.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "description": "any unique string (1 to 255 ASCII characters): a retry with the same one within a day gets the first answer instead of starting it again", "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"settings": {"type": "object", "description": "the settings to change (model, loras, prompt, negative_prompt, sampling_steps, cfg_scale, seed)"}, "note": {"type": "string", "description": "a note"}}, "required": ["settings"]}}}}}}, "/v1/executions/{execution_id}/delete": {"post": {"tags": ["Executions"], "summary": "Delete the record", "operationId": "postExecutionsExecutionidDelete", "description": "Its record for good (what it made stays). 409 while it runs.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {}}}}}}}, "/v1/executions/{execution_id}/rerun": {"post": {"tags": ["Executions"], "summary": "Run again", "operationId": "postExecutionsExecutionidRerun", "description": "Queue it again: same version, data and options unless given.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "description": "any unique string (1 to 255 ASCII characters): a retry with the same one within a day gets the first answer instead of starting it again", "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"version": {"type": "integer", "description": "another version"}, "data": {"type": "object", "description": "other data"}, "run": {"type": "object", "description": "other run options"}, "queue": {"type": "string", "description": "another queue"}}}}}}}}, "/v1/trainings": {"get": {"tags": ["Trainings"], "summary": "List trainings", "operationId": "getTrainings", "description": "Returns `{executions, cursor}`.\n\nScope: `read`.", "x-scope": "read", "parameters": [{"name": "lora", "in": "query", "required": false, "description": "the trainings that make this LoRA", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "required": false, "description": "1 to 200", "schema": {"type": "integer"}}, {"name": "cursor", "in": "query", "required": false, "description": "the last page's cursor", "schema": {"type": "string"}}], "responses": {"200": {"description": "`{executions, cursor}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}, "post": {"tags": ["Trainings"], "summary": "Start a training", "operationId": "postTrainings", "description": "A LoRA training, queued like any execution. 402 when credits don't cover it.\n\nReturns the execution.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "description": "any unique string (1 to 255 ASCII characters): a retry with the same one within a day gets the first answer instead of starting it again", "schema": {"type": "string"}}], "responses": {"200": {"description": "the execution", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string", "description": "the LoRA to make"}, "model": {"type": "string", "description": "the base model (GET /v1/models)"}, "sets": {"type": "array", "description": "up to 8 pair sets, each `{source, target, prompt, captions?}` (datasets)", "items": {"type": "object"}}, "source": {"type": "string", "description": "one set: the source dataset"}, "target": {"type": "string", "description": "one set: the target dataset"}, "prompt": {"type": "string", "description": "one set: its prompt"}, "steps": {"type": "integer", "description": "100 to 20000"}, "rank": {"type": "integer", "description": "1 to 256"}, "lr": {"type": "number", "description": "1e-7 to 1e-2"}, "resolution": {"type": "integer", "description": "one of 512, 768, 1024, 1280, 1536"}, "save_every": {"type": "integer", "description": "50 up to steps"}, "seed": {"type": "integer", "description": "0 to 2\u00b3\u00b2\u22121"}, "queue": {"type": "string", "description": "a queue to send it to"}}, "required": ["name"]}}}}}}, "/v1/trainings/plan": {"post": {"tags": ["Trainings"], "summary": "Check a training", "operationId": "postTrainingsPlan", "description": "Checked as a start would be: its pairs per set, where it would go and what it will cost.\n\nScope: `read`.", "x-scope": "read", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string", "description": "the LoRA to make"}, "model": {"type": "string", "description": "the base model (GET /v1/models)"}, "sets": {"type": "array", "description": "up to 8 pair sets, each `{source, target, prompt, captions?}` (datasets)", "items": {"type": "object"}}, "source": {"type": "string", "description": "one set: the source dataset"}, "target": {"type": "string", "description": "one set: the target dataset"}, "prompt": {"type": "string", "description": "one set: its prompt"}, "steps": {"type": "integer", "description": "100 to 20000"}, "rank": {"type": "integer", "description": "1 to 256"}, "lr": {"type": "number", "description": "1e-7 to 1e-2"}, "resolution": {"type": "integer", "description": "one of 512, 768, 1024, 1280, 1536"}, "save_every": {"type": "integer", "description": "50 up to steps"}, "seed": {"type": "integer", "description": "0 to 2\u00b3\u00b2\u22121"}, "queue": {"type": "string", "description": "a queue to send it to"}}, "required": ["name"]}}}}}}, "/v1/trainings/{execution_id}/checkpoints": {"get": {"tags": ["Trainings"], "summary": "Its checkpoint eval", "operationId": "getTrainingsExecutionidCheckpoints", "description": "Scope: `read`.", "x-scope": "read", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/trainings/{execution_id}/checkpoints/choose": {"post": {"tags": ["Trainings"], "summary": "Choose a checkpoint", "operationId": "postTrainingsExecutionidCheckpointsChoose", "description": "Copy it into the library under the LoRA's name.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"checkpoint": {"type": "string", "description": "the checkpoint"}, "stop": {"type": "boolean", "description": "also stop the training"}}, "required": ["checkpoint"]}}}}}}, "/v1/trainings/{execution_id}/checkpoints/eval": {"post": {"tags": ["Trainings"], "summary": "Run its checkpoints", "operationId": "postTrainingsExecutionidCheckpointsEval", "description": "Scope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "description": "any unique string (1 to 255 ASCII characters): a retry with the same one within a day gets the first answer instead of starting it again", "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"holdout": {"type": "string", "description": "the held-out dataset"}, "prompt": {"type": "string", "description": "the prompt"}, "checkpoints": {"type": "array", "description": "which (default: every one not run yet)", "items": {"type": "string"}}}, "required": ["holdout"]}}}}}}, "/v1/trainings/{execution_id}/checkpoints/pick": {"post": {"tags": ["Trainings"], "summary": "Pick the best for a file", "operationId": "postTrainingsExecutionidCheckpointsPick", "description": "Scope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"file": {"type": "string", "description": "the file"}, "checkpoint": {"type": "string", "description": "the checkpoint (null: undecided)"}}, "required": ["file"]}}}}}}, "/v1/trainings/{execution_id}/fetch": {"post": {"tags": ["Trainings"], "summary": "Copy its checkpoints into the library", "operationId": "postTrainingsExecutionidFetch", "description": "Scope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {}}}}}}}, "/v1/trainings/{execution_id}/resume": {"post": {"tags": ["Trainings"], "summary": "Resume", "operationId": "postTrainingsExecutionidResume", "description": "A training whose pod went away, queued again to go on from the checkpoint it last saved.\n\nScope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {}}}}}}}, "/v1/trainings/{execution_id}/stop": {"post": {"tags": ["Trainings"], "summary": "Stop early", "operationId": "postTrainingsExecutionidStop", "description": "Scope: `write`.", "x-scope": "write", "parameters": [{"name": "execution_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {}}}}}}}, "/v1/loras": {"get": {"tags": ["LoRAs"], "summary": "List LoRAs", "operationId": "getLoras", "description": "Returns `{loras: [{key, name, model, size, ...}]}`: the library, newest first.\n\nScope: `read`.", "x-scope": "read", "parameters": [], "responses": {"200": {"description": "`{loras: [{key, name, model, size, ...}]}`: the library, newest first", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}}}, "/v1/loras/delete": {"post": {"tags": ["LoRAs"], "summary": "Delete a LoRA", "operationId": "postLorasDelete", "description": "Scope: `write`.", "x-scope": "write", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"key": {"type": "string", "description": "the LoRA's key"}}, "required": ["key"]}}}}}}, "/v1/loras/link": {"post": {"tags": ["LoRAs"], "summary": "Get a download link", "operationId": "postLorasLink", "description": "Returns `{url, expires_s}`.\n\nScope: `read`.", "x-scope": "read", "parameters": [], "responses": {"200": {"description": "`{url, expires_s}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "404": {"$ref": "#/components/responses/not_found"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"key": {"type": "string", "description": "the LoRA's key"}}, "required": ["key"]}}}}}}, "/v1/loras/uploads": {"post": {"tags": ["LoRAs"], "summary": "Get an upload URL", "operationId": "postLorasUploads", "description": "A presigned URL to `PUT` a .safetensors file to, then `complete` with its `key` and base model.\n\nReturns `{method: PUT, url, key, expires_s, complete}`.\n\nScope: `write`.", "x-scope": "write", "parameters": [], "responses": {"200": {"description": "`{method: PUT, url, key, expires_s, complete}`", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string", "description": "its name"}}, "required": ["name"]}}}}}}, "/v1/loras/uploads/complete": {"post": {"tags": ["LoRAs"], "summary": "Complete an upload", "operationId": "postLorasUploadsComplete", "description": "Scope: `write`.", "x-scope": "write", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"$ref": "#/components/responses/invalid"}, "401": {"$ref": "#/components/responses/unauthorized"}, "402": {"$ref": "#/components/responses/insufficient_credits"}, "404": {"$ref": "#/components/responses/not_found"}, "409": {"$ref": "#/components/responses/conflict"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"key": {"type": "string", "description": "the upload's key"}, "model": {"type": "string", "description": "its base model"}}, "required": ["key"]}}}}}}}, "components": {"securitySchemes": {"bearer": {"type": "http", "scheme": "bearer", "bearerFormat": "tw_<id>_<secret>", "description": "An API key from the Account page."}, "apiKeyHeader": {"type": "apiKey", "in": "header", "name": "X-Api-Key", "description": "The same key on its own, where Authorization is taken by something on the way."}}, "schemas": {"Error": {"type": "object", "required": ["error"], "properties": {"error": {"type": "object", "required": ["code", "message"], "properties": {"code": {"type": "string", "enum": ["conflict", "insufficient_credits", "internal", "invalid", "method_not_allowed", "not_found", "rate_limited", "timeout", "too_large", "unauthorized", "unavailable", "unsupported_media_type"]}, "message": {"type": "string"}}}}}}, "responses": {"invalid": {"description": "400: invalid", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "unauthorized": {"description": "401: unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "insufficient_credits": {"description": "402: insufficient credits", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "not_found": {"description": "404: not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "method_not_allowed": {"description": "405: method not allowed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "timeout": {"description": "408: timeout", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "conflict": {"description": "409: conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "too_large": {"description": "413: too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "unsupported_media_type": {"description": "415: unsupported media type", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "rate_limited": {"description": "429: rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "internal": {"description": "500: internal", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "unavailable": {"description": "503: unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}