Queue a delete of a model's files on one host (a model job)
const url = 'http://localhost:8300/v1/studio/admin/models/example?host=example';const options = { method: 'DELETE', headers: {'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url 'http://localhost:8300/v1/studio/admin/models/example?host=example' \ --header 'Authorization: Bearer <token>' \ --header 'x-api-key: <x-api-key>'Admin only (403). 202 with the job (its keeps: shared components left on disk because another variant on the host that is not deleted loads them); 200 with the existing job when the same delete is queued or running. variant absent = every variant of the model on the host. Refused, checked again by studio when it releases the job and by the runner before it removes anything (then the job fails in_use): 409 <title> <variant> is not on <host> (state missing), <component> of <title> is loaded on <host>; unload it first (a resident entry of any env of the host whose files the delete removes), <title> is in use by a queued or running run on <host> (a run not yet terminal whose model node names the model and whose host is the host, or that is not placed yet and the host is eligible for it), a download of <title> on <host> is unfinished; cancel 422 host , , host is required. The runner deletes only inside (never through a symlink out of it). deletes only that optional add-on's files (a variant's delete keeps them): 409, , and the in-use and unfinished-download texts above; 422 , give a variant or an add-on, not both`.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A model id of the registry (qwen-image-2.1; unknown or malformed = 404)
Query Parameters
Section titled “Query Parameters”An optional add-on of the model (Model.addons[].component) instead of a variant
Responses
Section titled “Responses”The same delete, already queued or running
object
The runner env that does it (the one whose models or loras key lists the model or LoRA)
Download, delete
Download: the variant; delete: null = every variant (or the add-on’s)
Download and delete: the optional add-on instead of a variant (variant null)
Lora_delete
Qwen Image 2.1 · Turbo, or the LoRA’s name
Delete: the shared components it leaves on disk, decided when it was queued; [] otherwise
object
The variants on the host that still load it
The admin’s user id
The first running status
Example
{ "kind": "download", "title": "Qwen Image 2.1 · Turbo", "state": "queued", "failure": { "class": "not_found" }}The job, queued
object
The runner env that does it (the one whose models or loras key lists the model or LoRA)
Download, delete
Download: the variant; delete: null = every variant (or the add-on’s)
Download and delete: the optional add-on instead of a variant (variant null)
Lora_delete
Qwen Image 2.1 · Turbo, or the LoRA’s name
Delete: the shared components it leaves on disk, decided when it was queued; [] otherwise
object
The variants on the host that still load it
The admin’s user id
The first running status
Example
{ "kind": "download", "title": "Qwen Image 2.1 · Turbo", "state": "queued", "failure": { "class": "not_found" }}Missing or invalid x-api-key (Kong), or missing/invalid/expired/revoked bearer token
object
Example generated
{ "detail": "example"}Valid token without the admin role: “admin role required”
object
Example generated
{ "detail": "example"}Not found
object
Example generated
{ "detail": "example"}The resource’s state forbids this
object
Example generated
{ "detail": "example"}Invalid input
object
Example generated
{ "detail": "example"}Retryable
object
Example generated
{ "detail": "example"}