Queue a download of a variant's weights to one host (a model job)
const url = 'http://localhost:8300/v1/studio/admin/models/example/download';const options = { method: 'POST', headers: { 'x-api-key': '<x-api-key>', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"host":"example","variant":"example","addon":"example","accept_licence":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8300/v1/studio/admin/models/example/download \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "host": "example", "variant": "example", "addon": "example", "accept_licence": true }'Admin only (403). 202 with the new job, queued; 200 with the existing job when a download of the same (host, model, variant) is already queued or running (idempotent). The runner of the env whose models key lists the model on that host fetches the variant’s source (and any shared component of its owner variant not already on the host with matching hashes) into <models root>/<dir>/ as plain files. 404 for a model no host publishes. 422 host <host> has no env for <model>, <model> has no variant <variant>, <title> <variant> has no download source, licence <id> must be accepted (the variant’s source.must_accept and accept_licence not true). 409 <title> <variant> is already on <host> (state present), a delete of <title> on <host> is unfinished; runner’s hosts key reports models_disk.writable: false). add-on instead: 422 <model> has no add-on <addon>, give a variant or an add-on, not both, <title> <add-on title> has no download source; 409 <title> <add-on title> is already on <host>.
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)
Request Bodyrequired
Section titled “Request Bodyrequired”object
Absent = the model’s first variant
Download this optional add-on (Model.addons[].component) instead of a variant; never with variant
True: the admin accepted the variant’s licence text as GET /v1/studio/models showed it; required when its must_accept is true
Example generated
{ "host": "example", "variant": "example", "addon": "example", "accept_licence": true}Responses
Section titled “Responses”The same download, 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"}