{
  "openapi": "3.1.0",
  "info": {
    "title": "Runware API - FLUX.2 [klein] 9B Style LoRA Training",
    "summary": "Style LoRA training workflow for FLUX.2 [klein] 9B with downloadable safetensors output",
    "description": "FLUX.2 [klein] 9B Style LoRA Training is a Runware training workflow for producing style-focused LoRA adapters on top of the FLUX.2 Klein 9B architecture. It takes a zipped dataset together with a trigger word and training settings, then outputs a LoRA as a safetensors file that can be downloaded or uploaded directly to the platform for immediate use in downstream image generation workflows.",
    "version": "1.0.0",
    "x-model-id": "runware-flux-2-klein-9b-style-lora-training",
    "x-air-id": "runware:flux-2-klein-9b@style-lora-training",
    "x-status": "live",
    "x-capabilities": [
      "train"
    ],
    "x-modes": [
      {
        "id": "dataset",
        "inputs": [
          "dataset"
        ]
      },
      {
        "id": "dataset+checkpoint",
        "inputs": [
          "dataset",
          "checkpoint"
        ]
      }
    ],
    "x-released-at": "2026-07-24T00:00:00Z",
    "x-cover-image": "https://assets.runware.ai/covers/runware-flux-2-klein-9b-style-lora-training.jpg",
    "x-pricing": {
      "currency": "USD",
      "docs": "https://runware.ai/docs/models-api/pricing",
      "rates": [
        {
          "amount": 0.00301,
          "unit": "step",
          "display": "$0.00301 per step"
        }
      ],
      "overview": "Pricing is $0.00301 per step"
    }
  },
  "externalDocs": {
    "description": "FLUX.2 [klein] 9B Style LoRA Training on Runware",
    "url": "https://runware.ai/docs/models/runware-flux-2-klein-9b-style-lora-training"
  },
  "servers": [
    {
      "url": "https://api.runware.ai/v1",
      "description": "Runware REST API"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Runware API Key (e.g., Bearer <your-key>)"
      }
    },
    "schemas": {
      "AuthenticationTask": {
        "title": "Authentication",
        "description": "Authenticates a connection using an API key. Can be sent as the first element of the request array as an alternative to using the Authorization header.",
        "type": "object",
        "x-response-schema": "https://schemas.runware.ai/responses/utilities/authentication.json",
        "properties": {
          "taskType": {
            "title": "Task Type",
            "description": "Identifier for the type of task being performed.",
            "type": "string",
            "const": "authentication"
          },
          "apiKey": {
            "title": "API Key",
            "description": "Your Runware API key.",
            "type": "string"
          },
          "connectionSessionUUID": {
            "title": "Connection Session UUID",
            "description": "Optional session UUID to resume a previous connection and receive any buffered results.",
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "taskType",
          "apiKey"
        ],
        "additionalProperties": false
      },
      "RequestBody": {
        "type": "array",
        "items": {
          "type": "object",
          "x-constraints": [
            {
              "operation": "fileSize",
              "parameters": [
                "inputs.dataset"
              ],
              "maximum": 4294967296
            },
            {
              "operation": "archiveUnzippedSize",
              "parameters": [
                "inputs.dataset"
              ],
              "maximum": 5368709120
            },
            {
              "operation": "archiveFileCount",
              "parameters": [
                "inputs.dataset"
              ],
              "maximum": 20000
            },
            {
              "operation": "archiveImageCount",
              "parameters": [
                "inputs.dataset"
              ],
              "minimum": 10,
              "maximum": 10000
            },
            {
              "operation": "fileSize",
              "parameters": [
                "inputs.dataset"
              ],
              "maximum": 104857600,
              "scope": "each"
            }
          ],
          "properties": {
            "model": {
              "title": "Model",
              "description": "Send `auto` instead of an AIR identifier to have the model router choose the model for this task. The rest of the request is unchanged, every value you send is kept, and only the parameters you leave out are filled in. See [Model Router](https://runware.ai/docs/models-api/model-router).\n\n[Read full documentation](https://runware.ai/docs/models/runware-flux-2-klein-9b-style-lora-training#model)",
              "type": "string",
              "const": "runware:flux-2-klein-9b@style-lora-training"
            },
            "inputs": {
              "title": "Inputs",
              "description": "Input assets for the task.",
              "type": "object",
              "properties": {
                "dataset": {
                  "title": "Dataset",
                  "description": "Training dataset as a ZIP file (UUID or URL) containing the training images, each optionally paired with a `.txt` caption file of the same filename.",
                  "type": "string"
                },
                "checkpoint": {
                  "title": "Checkpoint",
                  "description": "AIR of a LoRA previously trained on Runware to resume from. `trainingSteps` runs as additional steps from its final checkpoint. LoRAs trained elsewhere are not supported.",
                  "type": "string"
                }
              },
              "required": [
                "dataset"
              ],
              "additionalProperties": false
            },
            "importModel": {
              "type": "object",
              "title": "Import Model",
              "description": "Configuration for the trained model that is uploaded to the platform after training completes.",
              "properties": {
                "air": {
                  "title": "AIR",
                  "description": "Artificial Intelligence Resource identifier. Format: `provider:model@version`.",
                  "type": "string",
                  "minLength": 1
                },
                "heroImageURL": {
                  "title": "Hero Image URL",
                  "description": "URL of the hero image.",
                  "type": "string",
                  "format": "uri"
                },
                "name": {
                  "title": "Name",
                  "description": "Name of the model.",
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 255
                },
                "private": {
                  "title": "Private",
                  "description": "Whether the model should be private.",
                  "type": "boolean",
                  "default": true
                },
                "shortDescription": {
                  "title": "Short Description",
                  "description": "Short description of the model.",
                  "type": "string"
                },
                "version": {
                  "title": "Version",
                  "description": "Version of the model.",
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "air",
                "name"
              ],
              "additionalProperties": false
            },
            "learningRate": {
              "title": "Learning Rate",
              "description": "Step size applied at each training update. Lower values learn more slowly but can improve stability.",
              "type": "number",
              "default": 0.00005,
              "minimum": 0.00001,
              "maximum": 0.01
            },
            "trainingSteps": {
              "title": "Training Steps",
              "description": "Total number of optimization steps to run during training.",
              "type": "integer",
              "minimum": 10,
              "maximum": 4000,
              "default": 1000
            },
            "triggerWord": {
              "title": "Trigger Word",
              "description": "Word or phrase used to activate the trained concept at inference time.",
              "type": "string",
              "minLength": 3,
              "maxLength": 100
            },
            "taskType": {
              "title": "Task Type",
              "description": "Identifier for the type of task being performed.",
              "type": "string",
              "const": "training"
            },
            "taskUUID": {
              "title": "Task UUID",
              "description": "UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.",
              "type": "string",
              "format": "uuid"
            },
            "webhookURL": {
              "title": "Webhook URL",
              "description": "Webhook URL that receives JSON responses via HTTP POST when generation tasks complete. For batch requests with multiple results, each completed item triggers a separate webhook call as it becomes available.",
              "type": "string",
              "format": "uri"
            },
            "includeCost": {
              "title": "Include Cost",
              "description": "Include task cost in the response.",
              "type": "boolean"
            }
          },
          "required": [
            "inputs",
            "importModel",
            "taskType",
            "taskUUID",
            "model"
          ],
          "additionalProperties": false
        },
        "description": "You must always POST an array of task objects."
      },
      "ResponseBody": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "title": "Training Response",
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "taskType": {
                  "title": "Task Type",
                  "description": "Identifier for the type of task this response belongs to.",
                  "type": "string",
                  "const": "training"
                },
                "taskUUID": {
                  "title": "Task UUID",
                  "description": "UUID v4 identifier echoed from the original request, used to match async responses to their tasks.",
                  "type": "string",
                  "format": "uuid"
                },
                "cost": {
                  "title": "Cost",
                  "description": "Task cost in USD. Present when `includeCost` is set to `true` in the request.",
                  "type": "number"
                },
                "air": {
                  "title": "AIR",
                  "description": "AIR of the trained model produced by this run. Use it to run inference with the trained model.",
                  "type": "string"
                },
                "outputs": {
                  "title": "Outputs",
                  "description": "The trained model produced by the training run.",
                  "type": "object",
                  "properties": {
                    "files": {
                      "title": "Output Files",
                      "description": "The file or files that make up the trained model.",
                      "type": "array",
                      "minItems": 1,
                      "items": {
                        "type": "object",
                        "properties": {
                          "uuid": {
                            "title": "File UUID",
                            "description": "UUID of the output file.",
                            "type": "string",
                            "format": "uuid"
                          },
                          "url": {
                            "title": "File URL",
                            "description": "URL of the output file.",
                            "type": "string",
                            "format": "uri"
                          }
                        },
                        "required": [
                          "uuid",
                          "url"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "files"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "taskType",
                "taskUUID",
                "air",
                "outputs"
              ]
            }
          }
        }
      },
      "ErrorResponse": {
        "title": "Error Response",
        "description": "Standard error response returned by the Runware API.",
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "code",
                "message"
              ],
              "additionalProperties": true,
              "properties": {
                "code": {
                  "type": "string",
                  "description": "A short identifier for the error (e.g., invalidApiKey, timeoutProvider)."
                },
                "message": {
                  "type": "string",
                  "description": "A human-readable explanation of what went wrong."
                },
                "parameter": {
                  "type": "string",
                  "description": "The request parameter related to the error, if applicable."
                },
                "taskType": {
                  "type": "string",
                  "description": "The task type of the request that failed."
                },
                "taskUUID": {
                  "type": "string",
                  "description": "The unique identifier of the failed request."
                },
                "documentation": {
                  "type": "string",
                  "description": "A link to relevant documentation."
                }
              }
            }
          }
        },
        "required": [
          "errors"
        ],
        "additionalProperties": false
      }
    }
  },
  "paths": {
    "/": {
      "post": {
        "summary": "Run FLUX.2 [klein] 9B Style LoRA Training",
        "description": "FLUX.2 [klein] 9B Style LoRA Training is a Runware training workflow for producing style-focused LoRA adapters on top of the FLUX.2 Klein 9B architecture. It takes a zipped dataset together with a trigger word and training settings, then outputs a LoRA as a safetensors file that can be downloaded or uploaded directly to the platform for immediate use in downstream image generation workflows.",
        "operationId": "run_runware_flux_2_klein_9b_style_lora_training",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — Missing or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — No valid API key provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — Insufficient account balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — The API key lacks permissions for this request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server Error — Something went wrong on Runware's end.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable — Temporarily unavailable (maintenance or capacity).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ]
}