{
  "openapi": "3.1.0",
  "info": {
    "title": "kiapi Qwen Image API",
    "description": "Image generation and editing (Qwen-Image via mflux).\n\nTwo operations on Alibaba's Qwen-Image models: `/generate` (text-to-image, or\nimage-to-image when `init_image` is supplied) and `/edit` (natural-language\nsingle/multi-image editing). Qwen-Image is strong at rendered text and\ninstruction-following edits.\n\n## Upstream docs\n- [mflux — Qwen Image](https://github.com/filipstrand/mflux/blob/main/src/mflux/models/qwen/README.md) — the MLX engine kiapi runs\n- [Qwen/Qwen-Image](https://huggingface.co/Qwen/Qwen-Image) — generate weights\n- [Qwen/Qwen-Image-Edit-2509](https://huggingface.co/Qwen/Qwen-Image-Edit-2509) — edit weights\n\n## Models\n- **image** (default) — text-to-image / img2img. The only variant `/generate`\n  accepts.\n- **edit-2509** — instruction-based editing. The only variant `/edit` accepts.\n\nEach endpoint is pinned to its variant, so `model` is effectively fixed per\noperation; discover variants at `GET /v1/image/qwen/models`. Omitted\n`steps`/`guidance`/`quantize`/size are filled in server-side and the resolved\nvalues are recorded in the result `params`.\n\n## generate vs edit\n- **generate** is text-to-image; pass `init_image` (+ optional `image_strength`\n  in 0..1) to seed an img2img run from one image.\n- **edit** takes a list of reference `images` for single- or multi-image editing\n  / composition under one natural-language prompt.\n\n## Resident vs transient runs\nThe warmed, resident model uses the server-default quantization (q8). A request\nthat either supplies `loras` or sets a `quantize` differing from the resident\nmodel builds a **one-off transient model** for that call — weights load fresh, so\nit is slower and not reused. For the fast path, omit `loras` and leave `quantize`\nunset.\n\n## LoRA\nApply adapters by passing their `file` ids in `loras` (up to 4, each\n`{file, scale}`). Any lora forces a transient run.\n\n## TIPS\n- For a quick image, call `sync` without `Accept: application/json` to get the\n  raw bytes straight back (`curl -o out.png`).\n- `width`/`height` must be multiples of 16 and at most 2048x2048 (default 1024).\n- Qwen-Image renders legible text well — describe the wanted text explicitly in\n  the prompt.\n- First use downloads the Qwen weights (~58 GB full); run `kiapi activate` ahead\n  of time to avoid a cold-start download on the first request.\n\n## Performance\n- Upstream weights are large (~58 GB full); kiapi defaults to q8.\n- Transient runs (any `loras` or a `quantize` override) rebuild the model each\n  call and are slower than the resident path.\n",
    "version": "0.1.0"
  },
  "paths": {
    "/v1/image/qwen/generate": {
      "post": {
        "summary": "Generate Qwen Endpoint",
        "description": "Generate an image from a text prompt (Qwen Image, text-to-image / img2img).\n\nPlain text-to-image by default; supply `init_image` (+ optional\n`image_strength`) to run img2img instead — use `/v1/image/qwen/edit` for\nnatural-language single/multi-image editing. The same endpoint serves both\n`sync` and `async` via `mode`. This endpoint only accepts the `image` model\nvariant.\n\nSync content negotiation: a single image is produced, so unless the client\nasks for JSON the raw image bytes are returned with `X-Kiapi-File-Id` /\n`X-Kiapi-Job-Id` headers — `curl -o out.png` just works. With\n`Accept: application/json` (or async) the Job JSON is returned, whose\n`result` follows ImageResponse.\n\nAny `loras` or a `quantize` differing from the resident model runs a one-off\ntransient model (slower, not reused). Async returns 202 immediately; poll\nGET /v1/jobs/{job_id} and fetch the artifact via GET /v1/files/{file_id}.",
        "operationId": "generate_qwen_endpoint_v1_image_qwen_generate_post",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Response media type preference. application/json returns the Job JSON; otherwise sync requests with one artifact return raw bytes when possible.",
              "examples": [
                "application/json",
                "image/png",
                "audio/wav",
                "video/mp4"
              ],
              "title": "Accept"
            },
            "description": "Response media type preference. application/json returns the Job JSON; otherwise sync requests with one artifact return raw bytes when possible."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result. Returns Job JSON with Accept: application/json; single-artifact jobs may return raw bytes otherwise.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobImageResponse"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-Kiapi-File-Id": {
                "description": "Produced artifact file_id when raw bytes are returned.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Kiapi-Job-Id": {
                "description": "Job id when raw bytes are returned.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{job_id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request for the selected model or file reference."
          },
          "422": {
            "description": "Request schema or validation error."
          },
          "503": {
            "description": "Model setup or memory budget error."
          },
          "504": {
            "description": "Sync request exceeded the configured timeout."
          }
        }
      }
    },
    "/v1/image/qwen/edit": {
      "post": {
        "summary": "Edit Qwen Endpoint",
        "description": "Edit / combine one or more reference images with a prompt (Qwen Image Edit).\n\nTakes a list of `images` (FileRefs, single or multi-image) plus a\nnatural-language `prompt`. For plain image-to-image from a single seed image,\nuse `init_image` on `/v1/image/qwen/generate` instead. The same endpoint\nserves both `sync` and `async` via `mode`. This endpoint only accepts the\n`edit-2509` model variant.\n\nSync content negotiation, transient-model behavior (`loras` / `quantize`\noverride), and the ImageResponse `result` shape match\n`/v1/image/qwen/generate`.",
        "operationId": "edit_qwen_endpoint_v1_image_qwen_edit_post",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Response media type preference. application/json returns the Job JSON; otherwise sync requests with one artifact return raw bytes when possible.",
              "examples": [
                "application/json",
                "image/png",
                "audio/wav",
                "video/mp4"
              ],
              "title": "Accept"
            },
            "description": "Response media type preference. application/json returns the Job JSON; otherwise sync requests with one artifact return raw bytes when possible."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result. Returns Job JSON with Accept: application/json; single-artifact jobs may return raw bytes otherwise.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobImageResponse"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-Kiapi-File-Id": {
                "description": "Produced artifact file_id when raw bytes are returned.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Kiapi-Job-Id": {
                "description": "Job id when raw bytes are returned.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{job_id}.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request for the selected model or file reference."
          },
          "422": {
            "description": "Request schema or validation error."
          },
          "503": {
            "description": "Model setup or memory budget error."
          },
          "504": {
            "description": "Sync request exceeded the configured timeout."
          }
        }
      }
    },
    "/v1/image/qwen/models": {
      "get": {
        "summary": "List Models",
        "description": "List the servable models for this capability.\n\nReturns the public catalog of every variant selectable via the ``model``\nfield on this capability's endpoints.",
        "operationId": "list_models_v1_image_qwen_models_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CapabilityModelSpec"
                  },
                  "type": "array",
                  "title": "Response List Models V1 Image Qwen Models Get"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AsyncJobResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id",
            "description": "In-memory job id. Poll GET /v1/jobs/{job_id} to inspect status, progress, result, and artifacts.",
            "examples": [
              "job_0123456789abcdef"
            ]
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Job type. Generation APIs use values such as zimage, flux2-edit, or acestep-extract.",
            "examples": [
              "zimage"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus",
            "description": "Initial job status. Async responses are normally queued unless the worker starts immediately.",
            "examples": [
              "queued"
            ]
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "type",
          "status"
        ],
        "title": "AsyncJobResponse"
      },
      "CapabilityModelSpec": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Model variant name to pass in the request model field.",
            "examples": [
              "turbo"
            ]
          },
          "family": {
            "type": "string",
            "title": "Family",
            "description": "Capability family that resolves this model variant.",
            "examples": [
              "zimage"
            ]
          },
          "domain": {
            "type": "string",
            "title": "Domain",
            "description": "Capability domain used for grouping model lists.",
            "examples": [
              "image"
            ]
          },
          "aliases": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Aliases",
            "description": "Alternative names that also resolve to this model.",
            "examples": [
              [
                "omni",
                "qwen3-omni-30b"
              ]
            ]
          },
          "default": {
            "type": "boolean",
            "title": "Default",
            "description": "Whether this is the default model when the request omits model.",
            "default": false,
            "examples": [
              true
            ]
          },
          "features": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Features",
            "description": "Handler-declared modalities and features supported by this model.",
            "examples": [
              [
                "text",
                "image"
              ]
            ]
          }
        },
        "type": "object",
        "required": [
          "name",
          "family",
          "domain"
        ],
        "title": "CapabilityModelSpec",
        "description": "Public model discovery entry for capability-specific model lists."
      },
      "EditRequest": {
        "properties": {
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Model variant (see GET /v1/image/qwen/models). Omit for the default `edit-2509`; `/edit` only accepts `edit-2509` (use `/generate` for `image`)."
          },
          "mode": {
            "type": "string",
            "enum": [
              "sync",
              "async"
            ],
            "title": "Mode",
            "description": "`sync` waits for the image (504 on timeout); `async` returns 202 with a job_id immediately — poll GET /v1/jobs/{job_id}.",
            "default": "sync"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "title": "Prompt",
            "description": "Natural-language instruction describing the edit (required)."
          },
          "negative_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Negative Prompt",
            "description": "Optional text describing what to avoid in the result."
          },
          "images": {
            "items": {
              "$ref": "#/components/schemas/FileRef"
            },
            "type": "array",
            "minItems": 1,
            "title": "Images",
            "description": "One or more reference images (Files-API file ids, http(s) URLs, or data URLs) to edit / compose under the prompt. At least one is required."
          },
          "width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Width",
            "description": "Output width in pixels. Omit for the server default (1024). Must be a multiple of 16 and at most 2048."
          },
          "height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Height",
            "description": "Output height in pixels. Omit for the server default (1024). Must be a multiple of 16 and at most 2048."
          },
          "steps": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps",
            "description": "Number of denoising steps (1..100). Omit for the server default (30). More steps = slower, sometimes higher quality."
          },
          "guidance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Guidance",
            "description": "Classifier-free guidance scale. Omit for the server default (2.5); higher follows the prompt more strictly."
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed",
            "description": "Random seed for reproducibility. Omit for a random seed (the resolved seed is recorded in the result `params`)."
          },
          "quantize": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantize",
            "description": "Quantization bits, one of {3, 4, 5, 6, 8}. Omit to use the resident model's quantization (q8). A differing value builds a one-off transient model (slower, not reused)."
          },
          "scheduler": {
            "type": "string",
            "title": "Scheduler",
            "description": "Noise scheduler. `linear` is the default and tested value.",
            "default": "linear"
          },
          "format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "title": "Format",
            "description": "Output image encoding for the produced file.",
            "default": "png"
          },
          "quality": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Quality",
            "description": "Encoder quality 1..100 (used for jpeg/webp; ignored for png).",
            "default": 90
          },
          "loras": {
            "items": {
              "$ref": "#/components/schemas/LoraRef"
            },
            "type": "array",
            "title": "Loras",
            "description": "Up to 4 LoRA adapters [{file, scale}] referencing Files-API ids. Any lora forces a one-off transient model (slower, not reused)."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "prompt",
          "images"
        ],
        "title": "EditRequest"
      },
      "FileDataURLRef": {
        "properties": {
          "type": {
            "type": "string",
            "const": "data_url",
            "title": "Type",
            "default": "data_url"
          },
          "data_url": {
            "type": "string",
            "minLength": 1,
            "title": "Data Url"
          }
        },
        "type": "object",
        "required": [
          "data_url"
        ],
        "title": "FileDataURLRef",
        "examples": [
          {
            "data_url": "data:image/png;base64,iVBORw0KGgo...",
            "type": "data_url"
          }
        ]
      },
      "FileID": {
        "type": "string"
      },
      "FileIDRef": {
        "properties": {
          "type": {
            "type": "string",
            "const": "file_id",
            "title": "Type",
            "default": "file_id"
          },
          "file_id": {
            "type": "string",
            "minLength": 1,
            "title": "File Id"
          }
        },
        "type": "object",
        "required": [
          "file_id"
        ],
        "title": "FileIDRef",
        "examples": [
          {
            "file_id": "file_0123456789abcdef",
            "type": "file_id"
          }
        ]
      },
      "FileRef": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/FileIDRef"
          },
          {
            "$ref": "#/components/schemas/FileURLRef"
          },
          {
            "$ref": "#/components/schemas/FileDataURLRef"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "data_url": "#/components/schemas/FileDataURLRef",
            "file_id": "#/components/schemas/FileIDRef",
            "url": "#/components/schemas/FileURLRef"
          }
        }
      },
      "FileURLRef": {
        "properties": {
          "type": {
            "type": "string",
            "const": "url",
            "title": "Type",
            "default": "url"
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "FileURLRef",
        "examples": [
          {
            "type": "url",
            "url": "https://example.com/input.png"
          }
        ]
      },
      "GenerateRequest": {
        "properties": {
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Model variant (see GET /v1/image/qwen/models). Omit for the default `image`; `/generate` only accepts `image` (use `/edit` for `edit-2509`)."
          },
          "mode": {
            "type": "string",
            "enum": [
              "sync",
              "async"
            ],
            "title": "Mode",
            "description": "`sync` waits for the image (504 on timeout); `async` returns 202 with a job_id immediately — poll GET /v1/jobs/{job_id}.",
            "default": "sync"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "title": "Prompt",
            "description": "Text prompt describing the image to generate (required)."
          },
          "negative_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Negative Prompt",
            "description": "Optional text describing what to avoid in the image."
          },
          "init_image": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FileRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional input image (Files-API file id, http(s) URL, or data URL). When set, `/generate` runs img2img seeded from this image; omit for plain txt2img."
          },
          "image_strength": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Strength",
            "description": "img2img only: how much the `init_image` is preserved, in 0..1. Lower keeps more of the input; higher follows the prompt more freely. Ignored when `init_image` is absent."
          },
          "width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Width",
            "description": "Output width in pixels. Omit for the server default (1024). Must be a multiple of 16 and at most 2048."
          },
          "height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Height",
            "description": "Output height in pixels. Omit for the server default (1024). Must be a multiple of 16 and at most 2048."
          },
          "steps": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps",
            "description": "Number of denoising steps (1..100). Omit for the server default (30). More steps = slower, sometimes higher quality."
          },
          "guidance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Guidance",
            "description": "Classifier-free guidance scale. Omit for the server default (4.0); higher follows the prompt more strictly."
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed",
            "description": "Random seed for reproducibility. Omit for a random seed (the resolved seed is recorded in the result `params`)."
          },
          "quantize": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantize",
            "description": "Quantization bits, one of {3, 4, 5, 6, 8}. Omit to use the resident model's quantization (q8). A differing value builds a one-off transient model (slower, not reused)."
          },
          "scheduler": {
            "type": "string",
            "title": "Scheduler",
            "description": "Noise scheduler. `linear` is the default and tested value.",
            "default": "linear"
          },
          "format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "title": "Format",
            "description": "Output image encoding for the produced file.",
            "default": "png"
          },
          "quality": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Quality",
            "description": "Encoder quality 1..100 (used for jpeg/webp; ignored for png).",
            "default": 90
          },
          "loras": {
            "items": {
              "$ref": "#/components/schemas/LoraRef"
            },
            "type": "array",
            "title": "Loras",
            "description": "Up to 4 LoRA adapters [{file, scale}] referencing Files-API ids. Any lora forces a one-off transient model (slower, not reused)."
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "GenerateRequest"
      },
      "ImageResponse": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model",
            "description": "Resolved model variant that produced the image."
          },
          "prompt": {
            "type": "string",
            "title": "Prompt",
            "description": "The prompt used for the run."
          },
          "file_id": {
            "type": "string",
            "title": "File Id",
            "description": "Files-API id of the produced image. Fetch metadata at GET /v1/files/{id} or bytes at /download. This is also the artifact returned as raw bytes by a single-artifact sync call."
          },
          "image_bytes": {
            "type": "integer",
            "title": "Image Bytes",
            "description": "Size of the produced image in bytes."
          },
          "width": {
            "type": "integer",
            "title": "Width",
            "description": "Width in pixels of the produced image."
          },
          "height": {
            "type": "integer",
            "title": "Height",
            "description": "Height in pixels of the produced image."
          },
          "params": {
            "additionalProperties": true,
            "type": "object",
            "title": "Params",
            "description": "Resolved parameters actually used for the run (model, prompt, seed, width, height, steps, guidance, quantize, scheduler, format, quality, loras, …), so the result is reproducible."
          },
          "timings": {
            "$ref": "#/components/schemas/_Timings",
            "description": "kiapi extension: server-side timing."
          }
        },
        "type": "object",
        "required": [
          "model",
          "prompt",
          "file_id",
          "image_bytes",
          "width",
          "height",
          "params",
          "timings"
        ],
        "title": "ImageResponse",
        "description": "Capability-specific ``result`` for a succeeded qwen generate/edit job."
      },
      "JobID": {
        "type": "string"
      },
      "JobImageResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/JobType",
            "description": "Job type. Use this to interpret the capability-specific result payload.",
            "examples": [
              "zimage"
            ]
          },
          "params": {
            "additionalProperties": true,
            "type": "object",
            "title": "Params",
            "description": "Request parameters captured for inspection and reproducibility. Secret or large media payloads may be omitted or redacted by endpoints."
          },
          "id": {
            "$ref": "#/components/schemas/JobID",
            "description": "In-memory job id. Jobs are cleared when the kiapi process restarts.",
            "examples": [
              "job_0123456789abcdef"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus",
            "description": "Job lifecycle state: queued, running, succeeded, failed, or canceled.",
            "default": "queued",
            "examples": [
              "succeeded"
            ]
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ImageResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "artifacts": {
            "items": {
              "$ref": "#/components/schemas/FileID"
            },
            "type": "array",
            "title": "Artifacts",
            "description": "File ids produced by the job. Use GET /v1/files/{file_id} for metadata or /download for bytes.",
            "examples": [
              [
                "file_0123456789abcdef"
              ]
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Error message when status is failed; otherwise null.",
            "examples": [
              "model 'turbo' is not activated"
            ]
          },
          "created_at": {
            "type": "number",
            "title": "Created At",
            "description": "Unix timestamp when the job was created.",
            "examples": [
              1766200000.0
            ]
          },
          "started_at": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At",
            "description": "Unix timestamp when the worker started the job, or null while queued.",
            "examples": [
              1766200001.0
            ]
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At",
            "description": "Unix timestamp when the job reached a terminal state, or null while queued/running.",
            "examples": [
              1766200030.0
            ]
          },
          "progress": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Progress",
            "description": "Best-effort completion fraction in [0.0, 1.0]. Null means the job has not reported progress.",
            "examples": [
              0.42
            ]
          },
          "progress_label": {
            "type": "string",
            "title": "Progress Label",
            "description": "Short human-readable phase label such as queued, running, denoising, saving, or done.",
            "default": "queued",
            "examples": [
              "denoising"
            ]
          }
        },
        "type": "object",
        "required": [
          "type"
        ],
        "title": "JobImageResponse"
      },
      "JobStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "succeeded",
          "failed",
          "canceled"
        ],
        "title": "JobStatus"
      },
      "JobType": {
        "type": "string"
      },
      "LoraRef": {
        "properties": {
          "file": {
            "$ref": "#/components/schemas/FileRef",
            "description": "The LoRA adapter (`.safetensors`) to apply, as a Files-API file id, http(s) URL, or data URL."
          },
          "scale": {
            "type": "number",
            "title": "Scale",
            "description": "Blend strength for this adapter. 1.0 applies it at full weight; lower values weaken its effect, higher values exaggerate it.",
            "default": 1.0
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "LoraRef",
        "description": "One LoRA adapter to apply, by Files-API reference and blend scale.\n\nAny lora forces a one-off transient model (slower, not reused). Up to 4 may\nbe passed in a request's ``loras`` list."
      },
      "_Timings": {
        "properties": {
          "total_s": {
            "type": "number",
            "title": "Total S",
            "description": "Wall-clock generation time in seconds (model run only)."
          }
        },
        "type": "object",
        "required": [
          "total_s"
        ],
        "title": "_Timings"
      }
    }
  },
  "x-kiapi-capability": "qwen",
  "x-kiapi-domain": "image",
  "x-kiapi-root-openapi": "/openapi.json"
}
