{
  "openapi": "3.1.0",
  "info": {
    "title": "CoreMind Public API",
    "version": "1.0.0",
    "description": "The read surface of the CoreMind generation hub. Every field name is snake_case, every collection answers `{ data, next_cursor }`, and every failure is `{ error: { code, message, user_message, request_id, details? } }`."
  },
  "servers": [
    {
      "url": "https://api.coremind.ru"
    }
  ],
  "security": [
    {
      "apiKey": []
    },
    {
      "sessionCookie": []
    },
    {
      "oauth2": [
        "me:read",
        "models:read",
        "generations:read",
        "generations:write",
        "library:read",
        "library:write",
        "billing:read",
        "support:read",
        "support:write",
        "uploads:write",
        "workflows:read",
        "workflows:write"
      ]
    }
  ],
  "paths": {
    "/v1/billing/subscription": {
      "get": {
        "operationId": "getBillingSubscription",
        "summary": "Read the caller’s live subscription",
        "description": "The subscription the account is still billed on, or `null` when it has none — never 404,\nthe singleton-read convention this API uses throughout. Payments, card data and provider\nids are never published: `status`, `amount`, `recurrent_amount`, `currency`,\n`next_payment_at` and `cancelled_at` are the whole of it.\n\nPlan, balance and free quotas are published by `GET /v1/me`, not here.",
        "tags": [
          "billing"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "billing:read"
            ]
          }
        ],
        "x-required-scope": [
          "billing:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingSubscriptionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/transactions": {
      "get": {
        "operationId": "getBillingTransactions",
        "summary": "List the caller’s credit ledger",
        "description": "The caller’s own transactions, newest first. Pass `next_cursor` back as `cursor` unchanged; it is opaque and must not be parsed. `limit` defaults to 20 and caps at 100 — over the cap is refused, never clamped.\n\n`amount_cc` is signed centi-credits: positive credits the balance, negative debits it.\n`generation_id` is the id `GET /v1/generations/{id}` accepts, or null for a row with no\nlink — including history written before the link existed. `reason` is a closed machine\nvocabulary derived from the internal ledger, null when none applies.\n\nPlan, balance and free quotas are published by `GET /v1/me`, not here.",
        "tags": [
          "billing"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "billing:read"
            ]
          }
        ],
        "x-required-scope": [
          "billing:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditTransactionCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_limit`, `invalid_cursor`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "getEvents",
        "summary": "Stream generation status changes",
        "description": "A server-sent event stream of the caller’s own generations. It carries one event type,\n`generation.status_changed`, whose `data` is a `GenerationEventDto`: which generation moved and\nto what status, never the full record — re-read that through `GET /v1/generations/{id}` or\n`POST /v1/generations/status`.\n\nEvery event carries an `id:`. It is opaque and must not be parsed. Send the last one you\nreceived back as `Last-Event-ID` when reconnecting, and the stream resumes right after it\nwithout losing a transition. Comment lines are heartbeats and carry nothing.\n\nWhen the presented `Last-Event-ID` cannot be resumed from — it is older than the retention\nwindow or is not a cursor of this stream — the first frame is a `reset` event whose `data` is\nan `EventStreamResetDto`. The stream still answers 200 and continues live after it; catch up on\nthe transitions in between through `POST /v1/generations/status`.\n\nA `terminated` event carrying the standard error body ends the stream when access is withdrawn\nwhile it is open — a revoked or expired key, a suspended account, a lost scope. The reconnect\nthat follows receives the same refusal as an ordinary error response.\n\nA cancelled generation arrives as `FAILED` with `deleted: true`. `types` narrows the stream to\nthe listed generation types; an unknown type is refused rather than silently matching nothing.\n\nOpening or reconnecting costs one request from the same rate-limit window every other endpoint\ndraws on. Concurrent streams per key are capped and one past the cap is refused with 429\n`too_many_streams`. The heartbeat interval, the cap and the retention window are published in\n`limits.json` under `events`.",
        "tags": [
          "events"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "generations:read"
            ]
          }
        ],
        "x-required-scope": [
          "generations:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "The `id:` of the last event received, to resume right after it. Browsers send it on their own when an EventSource reconnects.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An open event stream.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationEventDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`, `too_many_streams`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations": {
      "get": {
        "operationId": "getGenerations",
        "summary": "List the caller’s generations",
        "description": "The caller’s own history, newest first, ordered by creation time with the id as tiebreaker. Pass `next_cursor` back as `cursor` unchanged; it is opaque and must not be parsed. `limit` defaults to 20 and caps at 100 — over the cap is refused, never clamped.",
        "tags": [
          "generations"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "generations:read"
            ]
          }
        ],
        "x-required-scope": [
          "generations:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_limit`, `invalid_cursor`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postGenerations",
        "summary": "Submit a generation",
        "description": "Answers 202 and never 201: the row exists, the work does not. `Location` points at\n`GET /v1/generations/{id}`, the route to poll for the result.\n\n`Idempotency-Key` is mandatory. A replayed key answers the first submit’s row at its current\nstatus rather than a distinct \"already done\" shape, so a retry after a lost response is safe\nand charges once. The same key with a different body is refused.\n\nThe one surface with no shared request schema, the streaming `text` surface, answers\n`submit_unavailable` naming the `type`, and nothing is charged. Every other surface submits\nfor real.",
        "tags": [
          "generations"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "generations:write"
            ]
          }
        ],
        "x-required-scope": [
          "generations:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Caller-chosen key that makes a retry replay the first submit instead of charging twice.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "default": "",
                        "description": "The outer bound of the field. The limit that applies is the model's own `prompt_limit`, published per model by `GET /v1/models`, and it is lower for most models.",
                        "type": "string",
                        "maxLength": 100000
                      },
                      "model": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 80
                      },
                      "duration": {
                        "type": "integer",
                        "minimum": 2,
                        "maximum": 30
                      },
                      "aspect": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "resolution": {
                        "type": "string",
                        "maxLength": 10
                      },
                      "image_urls": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "video_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "video_urls": {
                        "maxItems": 10,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "audio_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "audio_urls": {
                        "maxItems": 10,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "sound": {
                        "type": "boolean"
                      },
                      "keyframe_times": {
                        "maxItems": 10,
                        "type": "array",
                        "items": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 20
                        }
                      },
                      "draft_generation_id": {
                        "type": "string",
                        "minLength": 20,
                        "maxLength": 40
                      },
                      "extend_generation_id": {
                        "type": "string",
                        "minLength": 20,
                        "maxLength": 40
                      },
                      "keep_original_sound": {
                        "type": "boolean"
                      },
                      "character_orientation": {
                        "type": "string",
                        "enum": [
                          "image",
                          "video"
                        ]
                      },
                      "video_duration": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 60
                      },
                      "video_duration_sig": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "ref_task_type": {
                        "type": "string",
                        "enum": [
                          "reference",
                          "edit",
                          "extend"
                        ]
                      },
                      "prompt_expansion": {
                        "description": "The model's prompt-expansion mode. A model takes only the values `GET /v1/models` publishes in its `prompt_expansion_modes`; omitted, it applies its `default_prompt_expansion`.",
                        "type": "string",
                        "enum": [
                          "disabled",
                          "fast",
                          "balanced",
                          "quality"
                        ]
                      },
                      "seed": {
                        "description": "The seed the render starts from. Accepted only where `GET /v1/models` publishes `has_seed`; omitted, the model picks its own.",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 2147483647
                      },
                      "negative_prompt": {
                        "type": "string",
                        "maxLength": 2500
                      },
                      "multi_shot": {
                        "type": "boolean"
                      },
                      "shot_type": {
                        "type": "string",
                        "enum": [
                          "customize",
                          "intelligence"
                        ]
                      },
                      "multi_prompt": {
                        "maxItems": 6,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "index": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 6
                            },
                            "prompt": {
                              "type": "string",
                              "maxLength": 2500
                            },
                            "duration": {
                              "type": "integer",
                              "minimum": 2,
                              "maximum": 30
                            }
                          },
                          "required": [
                            "index",
                            "prompt",
                            "duration"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "bypass_promo_queue": {
                        "type": "boolean"
                      },
                      "promo_mode": {
                        "type": "string",
                        "enum": [
                          "queue"
                        ]
                      },
                      "reference_face_mask": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "boolean"
                        }
                      },
                      "reference_hashes": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 64
                        }
                      },
                      "reference_audio": {
                        "maxItems": 5,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        }
                      },
                      "type": {
                        "type": "string",
                        "const": "video"
                      }
                    },
                    "required": [
                      "model",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "default": "",
                        "description": "The outer bound of the field. The limit that applies is the model's own `prompt_limit`, published per model by `GET /v1/models`, and it is lower for most models.",
                        "type": "string",
                        "maxLength": 100000
                      },
                      "model": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 80
                      },
                      "aspect": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "resolution": {
                        "type": "string",
                        "maxLength": 10
                      },
                      "negative": {
                        "type": "string",
                        "maxLength": 5000
                      },
                      "image_urls": {
                        "maxItems": 16,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "style_ref_urls": {
                        "maxItems": 5,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "char_ref_urls": {
                        "maxItems": 5,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "seed": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "n_variants": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 4
                      },
                      "image_size": {
                        "type": "string",
                        "maxLength": 30
                      },
                      "guidance_scale": {
                        "type": "number"
                      },
                      "output_format": {
                        "type": "string",
                        "maxLength": 10
                      },
                      "quality": {
                        "type": "string",
                        "enum": [
                          "low",
                          "medium",
                          "high"
                        ]
                      },
                      "background": {
                        "type": "string",
                        "enum": [
                          "opaque",
                          "transparent"
                        ]
                      },
                      "promo_mode": {
                        "type": "string",
                        "enum": [
                          "queue",
                          "unlimited"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "const": "image"
                      }
                    },
                    "required": [
                      "model",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "image_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "model": {
                        "default": "topaz-upscale",
                        "type": "string",
                        "enum": [
                          "topaz-upscale",
                          "topaz-video-upscale",
                          "topaz-video-starlight-fast",
                          "topaz-video-starlight-hq",
                          "topaz-video-astra",
                          "flux-upscale-precise",
                          "flux-upscale-creative"
                        ]
                      },
                      "scale": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "input_width": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 20000
                      },
                      "input_height": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 20000
                      },
                      "topaz_model": {
                        "type": "string",
                        "enum": [
                          "standard-v2",
                          "high-fidelity-v2",
                          "low-resolution-v2",
                          "cgi",
                          "text-refine"
                        ]
                      },
                      "face_recovery": {
                        "type": "boolean"
                      },
                      "face_strength": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "sharpen": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "denoise": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "fix_compression": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "creativity": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "type": {
                        "type": "string",
                        "const": "upscale"
                      }
                    },
                    "required": [
                      "image_url",
                      "scale",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "default": "",
                        "type": "string",
                        "maxLength": 2000
                      },
                      "model": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 80
                      },
                      "image_urls": {
                        "maxItems": 5,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "GLB",
                          "OBJ",
                          "USDZ",
                          "FBX",
                          "STL",
                          "MP4"
                        ]
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "1536",
                          "1536pro"
                        ]
                      },
                      "material": {
                        "type": "string",
                        "enum": [
                          "PBR",
                          "Shaded",
                          "None"
                        ]
                      },
                      "mesh_mode": {
                        "type": "string",
                        "enum": [
                          "Raw",
                          "Quad"
                        ]
                      },
                      "generate_type": {
                        "type": "string",
                        "enum": [
                          "Normal",
                          "Geometry"
                        ]
                      },
                      "enable_pbr": {
                        "type": "boolean"
                      },
                      "enable_geometry": {
                        "type": "boolean"
                      },
                      "face_count": {
                        "type": "integer",
                        "minimum": 1000,
                        "maximum": 2000000
                      },
                      "face": {
                        "type": "integer",
                        "minimum": 1000,
                        "maximum": 2000000
                      },
                      "quality": {
                        "type": "integer",
                        "minimum": 1000,
                        "maximum": 2000000
                      },
                      "subdivision_level": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 3
                      },
                      "type": {
                        "type": "string",
                        "const": "3d"
                      }
                    },
                    "required": [
                      "model",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "video_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "audio_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "video_duration_sec": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 10
                      },
                      "audio_duration_sec": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 30
                      },
                      "video_duration_sig": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "audio_duration_sig": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "type": {
                        "type": "string",
                        "const": "lipsync"
                      }
                    },
                    "required": [
                      "video_url",
                      "audio_url",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "audio_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "image_urls": {
                        "minItems": 1,
                        "maxItems": 1,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "prompt": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "auto_mask": {
                        "type": "boolean"
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "omnihuman-1.5",
                          "wan2.2-digital-human"
                        ]
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "480p",
                          "720p",
                          "1080p"
                        ]
                      },
                      "turbo_mode": {
                        "type": "boolean"
                      },
                      "audio_duration_sec": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 60
                      },
                      "audio_duration_sig": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "type": {
                        "type": "string",
                        "const": "omnihuman"
                      }
                    },
                    "required": [
                      "audio_url",
                      "image_urls",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "mode": {
                        "default": "std",
                        "type": "string",
                        "enum": [
                          "std",
                          "pro"
                        ]
                      },
                      "prompt": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "audio_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "audio_duration_sec": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 60
                      },
                      "audio_duration_sig": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "type": {
                        "type": "string",
                        "const": "avatar"
                      }
                    },
                    "required": [
                      "image_url",
                      "audio_url",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 40000
                      },
                      "voice_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "voice_name": {
                        "type": "string",
                        "maxLength": 60
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "text-to-speech-turbo-2-5",
                          "text-to-speech-flash-2-5",
                          "text-to-speech-multilingual-v2",
                          "text-to-speech-v3",
                          "text-to-speech-v4",
                          "text-to-speech-v4-turbo"
                        ]
                      },
                      "stability": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "similarity_boost": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "style": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "speed": {
                        "type": "number",
                        "minimum": 0.7,
                        "maximum": 1.2
                      },
                      "type": {
                        "type": "string",
                        "const": "voice"
                      }
                    },
                    "required": [
                      "text",
                      "voice_id",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "lyrics": {
                        "type": "string",
                        "maxLength": 5000
                      },
                      "style": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "model": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 80
                      },
                      "negative_tags": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "vocal_gender": {
                        "type": "string",
                        "enum": [
                          "m",
                          "f"
                        ]
                      },
                      "style_weight": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "type": {
                        "type": "string",
                        "const": "music"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "style": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "file_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2000
                      },
                      "instrumental": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "string",
                        "const": "music-cover"
                      }
                    },
                    "required": [
                      "file_url",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "type": "string",
                        "minLength": 5,
                        "maxLength": 500
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "V6",
                          "V6_WILD",
                          "V6_MINI"
                        ]
                      },
                      "instrumental": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "string",
                        "const": "song"
                      }
                    },
                    "required": [
                      "prompt",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "theme": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 200
                      },
                      "mood": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "type": {
                        "type": "string",
                        "const": "lyrics"
                      }
                    },
                    "required": [
                      "theme",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "marketplace": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      "category": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      "background": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      "text": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "prompt": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "nano-banana-pro",
                          "nano-banana-2",
                          "nano-banana-2.1"
                        ]
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "1k",
                          "2k",
                          "4k"
                        ]
                      },
                      "aspect": {
                        "type": "string",
                        "enum": [
                          "3:4",
                          "1:1"
                        ]
                      },
                      "image_urls": {
                        "minItems": 1,
                        "maxItems": 3,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "type": {
                        "type": "string",
                        "const": "card-design"
                      }
                    },
                    "required": [
                      "marketplace",
                      "category",
                      "background",
                      "model",
                      "image_urls",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "style": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 1000
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 5000
                      },
                      "file_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "type": {
                        "type": "string",
                        "const": "music-vocals"
                      }
                    },
                    "required": [
                      "style",
                      "prompt",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "style": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2000
                      },
                      "file_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "task_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "audio_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "source_generation_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "source_index": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                      },
                      "type": {
                        "type": "string",
                        "const": "music-instrumental"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "style": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2000
                      },
                      "file_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "task_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "audio_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "source_generation_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "source_index": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                      },
                      "type": {
                        "type": "string",
                        "const": "music-stems"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "text"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The generation row exists; `Location` names where its result will appear.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The generation to poll, as `/v1/generations/{id}`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "description": "Refused with `payment_required`, `insufficient_credits`, `key_spend_limit_reached`, `grant_spend_limit_reached`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `moderation_blocked`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `duplicate_key_conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`, `submit_unavailable`. Rate-limit headers are absent on `api_disabled`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations/status": {
      "post": {
        "operationId": "postGenerationsStatus",
        "summary": "Read the status of several generations at once",
        "description": "Answers several generations in one request. Follow progress through the stream at\n`GET /v1/events`; this route is the catch-up after a stream was lost or answered with a\n`reset`, and the way to read a known set of ids at any time. One generation reads through\nGET /v1/generations/{id}. It draws on the same request window every other endpoint does. DONE\nis the one status that never changes again; FAILED ends the attempt rather than the record,\nbecause a late provider answer can still recover such a row into DONE.\n\nThe body carries between 1 and 50 ids. Nothing is repaired: more ids than the\ncap is refused, an empty array is refused, a duplicated id is refused, and an id that is not a\nresource id is refused — none of them is trimmed, deduplicated or skipped.\n\nAn id belonging to another account, or one that never existed, is simply absent from `data`.\nAbsence is the only signal, which is what keeps the endpoint from confirming that somebody\nelse’s generation exists.\n\nIt is a POST because the id list does not belong in a URL. It reads, creates nothing, and\nanswers 200.",
        "tags": [
          "generations"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "generations:read"
            ]
          }
        ],
        "x-required-scope": [
          "generations:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 50,
                    "uniqueItems": true
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationStatusCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`, `invalid_limit`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations/{id}": {
      "delete": {
        "operationId": "deleteGenerationsById",
        "summary": "Cancel or delete one generation",
        "description": "The studio’s own cancel reached by key, on the one shared implementation: it cancels before\ndispatch and deletes once terminal. `refunded` reports whether this request actually moved\ncredits back — it never decides a refund, and a terminal row is never refunded because a\nprovider was already contacted.\n\nA claimed row answers `generation_in_flight`. A frozen row is cancelled only while `QUEUED`\nor `PENDING` with no provider task; otherwise `generation_frozen`. Repeating on a deleted\nrow is a success. Another account’s id answers 404, so a refusal never confirms it.",
        "tags": [
          "generations"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "generations:write"
            ]
          }
        ],
        "x-required-scope": [
          "generations:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation id, as published in `data[].id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationCancelDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "description": "Refused with `payment_required`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `generation_frozen`, `generation_in_flight`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getGenerationsById",
        "summary": "Read one generation",
        "description": "The same shape the collection publishes — there is no summary form beside a full one. An id belonging to another account answers 404 rather than 403, so a refusal never confirms that a generation exists.",
        "tags": [
          "generations"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "generations:read"
            ]
          }
        ],
        "x-required-scope": [
          "generations:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation id, as published in `data[].id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchGenerationsById",
        "summary": "Rename one generation",
        "description": "Edits the title only — generation metadata, under `library:write` rather than\n`generations:write`, because a rename spends nothing. The title is trimmed and stored as the\nstudio stores it; an empty one clears it. The answer is the id and the title only, as\n`GET /v1/generations/{id}` would serve it, so a title that read route withholds is withheld\nhere too; reading the rest of the generation takes `generations:read`. An id belonging to\nanother account answers 404, so a refusal never confirms it. Moving a generation into a\nfolder is `POST /v1/library/move`.",
        "tags": [
          "generations"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "library:write"
            ]
          }
        ],
        "x-required-scope": [
          "library:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation id, as published in `data[].id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 120
                  }
                },
                "required": [
                  "title"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryRenameDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations/{id}/outputs/{kind}/{index}": {
      "get": {
        "operationId": "getGenerationsByIdOutputsByKindByIndex",
        "summary": "Download one generation output",
        "description": "The file behind one entry of `output_urls`, streamed by this API with the caller’s own\ncredential — use the url exactly as published rather than assembling one. `kind` is the\n`output_urls` channel and `index` the position the url carries, which can differ from the\nentry’s place in that list when an earlier output is not served.\n\n`Content-Type` is the type the file was stored with, `Content-Length` its size. The answer is\n`Cache-Control: private, no-store`: it belongs to the credential that asked.\n\nA single `Range: bytes=…` is honoured with `206` and `Content-Range`, so a download resumes\nand a video seeks; a multi-range request, or one past the end of the file, gets the whole\nfile with `200`.\n\nA generation of another account, a deleted one, a position with no file behind it and an\noutput this API does not hold all answer the same 404, so a refusal never confirms a row.\n\nBesides a key and a `/v1` OAuth token, this route and the library content route accept an\nOAuth token issued for `/mcp`, so an MCP client can follow the url `get_output` hands back.",
        "tags": [
          "generations"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "generations:read"
            ]
          }
        ],
        "x-required-scope": [
          "generations:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation id, as published in `data[].id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "description": "The `output_urls` channel — `image`, `original`, `video`, `audio`, `download`, `wav` or `model3d`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "description": "The stored position the published url carries.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "required": false,
            "description": "One `bytes=` range to resume a download or seek a video. A multi-range request, or one past the end of the file, is answered with the whole file.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file itself.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/MediaContent"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Accept-Ranges": {
                "description": "Always `bytes`.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Range": {
                "description": "On a 206: the slice sent and the file’s full size.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "206": {
            "description": "The requested slice of the file; `Content-Range` names it.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/MediaContent"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Accept-Ranges": {
                "description": "Always `bytes`.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Range": {
                "description": "On a 206: the slice sent and the file’s full size.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generations/{id}/report": {
      "post": {
        "operationId": "postGenerationsByIdReport",
        "summary": "Report a problem with one generation",
        "description": "«Сообщить о проблеме» reached by key. It records and moves nothing: this is the route to a\n**manual** refund a human grants after diagnosis, never an automatic one. Filing a report\ntherefore never changes a balance, and the response carries no credit field.\n\n`reason: \"moderation\"` withdraws the generation as well as filing the report — except one\nalready held for review, which only an operator withdraws and whose report is still accepted;\n`\"failure\"`, the default, leaves it retryable. A new `\"failure\"` report on a generation already\nsettled automatically answers `generation_already_settled` — there is nothing left to ask for —\nwhile a `\"moderation\"` report and a replay of the same `client_msg_id` are accepted regardless.\n\nSend `client_msg_id` — a UUID — to make a retry after a lost response replay the first ticket\ninstead of filing a second one. The same id with different text is refused rather than\nsilently reused, and an id two callers could both pick would collide across accounts.",
        "tags": [
          "generations"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "generations:write"
            ]
          }
        ],
        "x-required-scope": [
          "generations:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The generation id the report is about.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "reason": {
                    "default": "failure",
                    "type": "string",
                    "enum": [
                      "failure",
                      "moderation"
                    ]
                  },
                  "client_msg_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  }
                },
                "required": [
                  "text"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The report was filed; the ticket it landed on is named.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationReportDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `report_replay_mismatch`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Refused with `generation_already_settled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/knowledge": {
      "get": {
        "operationId": "getKnowledge",
        "summary": "Search the public knowledge base",
        "description": "Public help articles and per-model prompting guides, matched on title and summary; without\n`q` it answers the first `limit` of the whole base, not all of it. Articles come first in\neditorial order, then guides; a specific slug is reached by searching its words, or read\ndirectly at `GET /v1/knowledge/{slug}`. Only content\npublished for users is ever returned — the support team’s internal notes are not part of this\nsurface. Each result carries `lang`: articles are served as written (mostly `ru`), guides in\n`en`. Upstream provider names are masked in every result.\n\nCapped, not paged: `limit` defaults to 20 and caps at 50, and `next_cursor` is always\nnull. Over the cap is refused, never clamped.",
        "tags": [
          "knowledge"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "models:read"
            ]
          }
        ],
        "x-required-scope": [
          "models:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`, `invalid_limit`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/knowledge/{slug}": {
      "get": {
        "operationId": "getKnowledgeBySlug",
        "summary": "Read one knowledge article",
        "description": "The full article behind a `slug` from `GET /v1/knowledge`, in the language it was written in\n(`lang`), with upstream provider names masked. A slug that is not published — unknown,\nwithdrawn, lapsed or never public — answers 404 the same way, so the refusal confirms nothing.",
        "tags": [
          "knowledge"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "models:read"
            ]
          }
        ],
        "x-required-scope": [
          "models:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The article slug, as published in `data[].slug`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeArticleDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/library/assets": {
      "get": {
        "operationId": "getLibraryAssets",
        "summary": "List the caller’s uploaded references",
        "description": "The caller’s own uploads, newest first. Pass `next_cursor` back as `cursor` unchanged; it is opaque and must not be parsed. `limit` defaults to 20 and caps at 100 — over the cap is refused, never clamped.",
        "tags": [
          "library"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "library:read"
            ]
          }
        ],
        "x-required-scope": [
          "library:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAssetCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_limit`, `invalid_cursor`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/library/assets/{id}": {
      "patch": {
        "operationId": "patchLibraryAssetsById",
        "summary": "Rename an uploaded reference",
        "description": "The title is trimmed and stored as the studio stores it; an empty one clears it. The answer\nis the id and the stored title only; reading the rest of the asset takes `library:read`. An\nasset of another account, a deleted one and one hidden from the caller’s library all answer\nthe same 404, and none of them is renamed.",
        "tags": [
          "library"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "library:write"
            ]
          }
        ],
        "x-required-scope": [
          "library:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The asset id, as published in `data[].id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 120
                  }
                },
                "required": [
                  "title"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryRenameDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/library/assets/{id}/content": {
      "get": {
        "operationId": "getLibraryAssetsByIdContent",
        "summary": "Download one uploaded reference",
        "description": "The file behind an asset’s `output_urls` entry, streamed by this API with the caller’s own\ncredential. The same headers as a generation output: the stored `Content-Type`, the size as\n`Content-Length`, and `Cache-Control: private, no-store`. A byte range is answered as on the\ngeneration output route.\n\nAn asset of another account, a deleted one, one hidden from the caller’s library and one\nthis API does not hold all answer the same 404. An OAuth token issued for `/mcp` is accepted\nhere as on the generation output route.",
        "tags": [
          "library"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "library:read"
            ]
          }
        ],
        "x-required-scope": [
          "library:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The asset id, as published in `data[].id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "required": false,
            "description": "One `bytes=` range to resume a download or seek a video. A multi-range request, or one past the end of the file, is answered with the whole file.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file itself.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/MediaContent"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Accept-Ranges": {
                "description": "Always `bytes`.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Range": {
                "description": "On a 206: the slice sent and the file’s full size.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "206": {
            "description": "The requested slice of the file; `Content-Range` names it.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/MediaContent"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Accept-Ranges": {
                "description": "Always `bytes`.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Range": {
                "description": "On a 206: the slice sent and the file’s full size.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/library/folders": {
      "get": {
        "operationId": "getLibraryFolders",
        "summary": "List the caller’s library folders",
        "description": "Folders are capped rather than paged, so this route takes no parameters and `next_cursor` is always null — the same envelope every other collection answers with. Ordered by `position`, then creation time, as the studio sidebar shows them.",
        "tags": [
          "library"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "library:read"
            ]
          }
        ],
        "x-required-scope": [
          "library:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryFolderCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postLibraryFolders",
        "summary": "Create a library folder",
        "description": "The studio’s own folder create, on the one shared implementation: the folder is placed last,\nnames are unique per account, and the account holds a capped number of folders. A name\nalready taken answers `folder_name_taken`; a full library answers `folder_limit_reached`.\nThe answer is the new id and the name as stored; the folder’s position and creation time\nare read through `GET /v1/library/folders`, which takes `library:read`. Spends nothing.",
        "tags": [
          "library"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "library:write"
            ]
          }
        ],
        "x-required-scope": [
          "library:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The folder was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryFolderWriteDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `folder_limit_reached`, `folder_name_taken`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/library/folders/{id}": {
      "delete": {
        "operationId": "deleteLibraryFoldersById",
        "summary": "Delete a library folder",
        "description": "Deletes the folder only: the generations and uploads in it survive and return to the root.\nA folder of another account answers 404, exactly as one that never existed.",
        "tags": [
          "library"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "library:write"
            ]
          }
        ],
        "x-required-scope": [
          "library:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The folder id, as published in `data[].id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchLibraryFoldersById",
        "summary": "Rename or reorder a library folder",
        "description": "Send `name`, `position` or both. `position` is the sort key the folder list reads, a\nnon-negative 32-bit integer; folders sharing one list in creation order. The caller owns the\nordering and nothing renumbers the other folders. The answer is the id and\nonly the fields sent, as stored; reading the rest of the folder takes `library:read`. A\nfolder of another account answers 404, exactly as one that never existed.",
        "tags": [
          "library"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "library:write"
            ]
          }
        ],
        "x-required-scope": [
          "library:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The folder id, as published in `data[].id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryFolderWriteDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `folder_name_taken`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/library/move": {
      "post": {
        "operationId": "postLibraryMove",
        "summary": "Move library items into a folder or back to the root",
        "description": "`item_ids` names generations and uploads alike; `folder_id: null` files them back to the\nroot. An id that is not the caller’s, or not live, is skipped rather than refused, as in the\nstudio, and `moved` counts only what was actually filed. A target folder of another account\nanswers 404, exactly as one that never existed.",
        "tags": [
          "library"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "library:write"
            ]
          }
        ],
        "x-required-scope": [
          "library:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "item_ids": {
                    "minItems": 1,
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "folder_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "item_ids",
                  "folder_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryMoveDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Read the caller’s account",
        "description": "Plan, credit balance and free quotas for whoever the credential resolved to. It takes no parameters at all: the subject is never named in the request, so another account cannot be read by typing its id.",
        "tags": [
          "me"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "me:read"
            ]
          }
        ],
        "x-required-scope": [
          "me:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "getModels",
        "summary": "List the selectable models and their prices",
        "description": "The machine-readable catalog: what each model accepts, and what it costs this caller — `price_cc` is quoted in the `unit` beside it, so a per-second rate must be multiplied by the billable duration before it is read as the price of a generation. A model whose `pricing.quote` is `\"estimate\"` publishes no rate: its charge is measured from the source, so `POST /v1/pricing/estimate` with the full request is its price. Any of it can change at any moment, so the response always revalidates: send the `ETag` back in `If-None-Match` and read the 304. The value is opaque — do not parse it.",
        "tags": [
          "models"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "models:read"
            ]
          }
        ],
        "x-required-scope": [
          "models:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "image",
                "video",
                "3d",
                "voice",
                "music"
              ]
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "The `ETag` of a previous response, to be answered with 304 when unchanged.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Send it back in `If-None-Match` to revalidate; opaque, never parsed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "The catalog is unchanged since the `ETag` sent in `If-None-Match`.",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Send it back in `If-None-Match` to revalidate; opaque, never parsed.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/pricing/estimate": {
      "post": {
        "operationId": "postPricingEstimate",
        "summary": "Price a submit before sending it",
        "description": "What `POST /v1/generations` would charge for this exact body, computed by the same function\nthat will charge it rather than by a second expression over the same tables. It takes the\nsubmit body itself, so a caller prices and submits one request rather than two shapes.\n\n`price_cc` is a **ceiling**, never an under-quote: a free quota and a provider promo run after\nit and can only lower what the ledger debits. No cost or margin figure appears anywhere in the\nresponse.\n\n`POST` for a body-carrying read, and 200 rather than 201 — nothing is created, no key is\nclaimed and nothing is spent, so a retry is free. It needs only `models:read`, and no paid\ngate: a caller must not have to pay to find out what paying costs.\n\nA surface priced on media — the clip a lipsync re-voices, the track an avatar or omnihuman\nanimates, the picture or clip an upscale enlarges, the reference clips a video edits or\nbills — is quoted by measuring the referenced files on the server exactly as the submit\nmeasures them; a length or size the caller declares is never read. The files must exist and\nbelong to the caller: one that cannot be read is refused with `invalid_request` rather than\nquoted as nothing, and nothing is touched, claimed or counted. A `promo_mode` submit, billed\nby entitlement rather than by a rate, answers `estimate_unavailable`.",
        "tags": [
          "pricing"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "models:read"
            ]
          }
        ],
        "x-required-scope": [
          "models:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "default": "",
                        "description": "The outer bound of the field. The limit that applies is the model's own `prompt_limit`, published per model by `GET /v1/models`, and it is lower for most models.",
                        "type": "string",
                        "maxLength": 100000
                      },
                      "model": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 80
                      },
                      "duration": {
                        "type": "integer",
                        "minimum": 2,
                        "maximum": 30
                      },
                      "aspect": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "resolution": {
                        "type": "string",
                        "maxLength": 10
                      },
                      "image_urls": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "video_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "video_urls": {
                        "maxItems": 10,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "audio_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "audio_urls": {
                        "maxItems": 10,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "sound": {
                        "type": "boolean"
                      },
                      "keyframe_times": {
                        "maxItems": 10,
                        "type": "array",
                        "items": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 20
                        }
                      },
                      "draft_generation_id": {
                        "type": "string",
                        "minLength": 20,
                        "maxLength": 40
                      },
                      "extend_generation_id": {
                        "type": "string",
                        "minLength": 20,
                        "maxLength": 40
                      },
                      "keep_original_sound": {
                        "type": "boolean"
                      },
                      "character_orientation": {
                        "type": "string",
                        "enum": [
                          "image",
                          "video"
                        ]
                      },
                      "video_duration": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 60
                      },
                      "video_duration_sig": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "ref_task_type": {
                        "type": "string",
                        "enum": [
                          "reference",
                          "edit",
                          "extend"
                        ]
                      },
                      "prompt_expansion": {
                        "description": "The model's prompt-expansion mode. A model takes only the values `GET /v1/models` publishes in its `prompt_expansion_modes`; omitted, it applies its `default_prompt_expansion`.",
                        "type": "string",
                        "enum": [
                          "disabled",
                          "fast",
                          "balanced",
                          "quality"
                        ]
                      },
                      "seed": {
                        "description": "The seed the render starts from. Accepted only where `GET /v1/models` publishes `has_seed`; omitted, the model picks its own.",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 2147483647
                      },
                      "negative_prompt": {
                        "type": "string",
                        "maxLength": 2500
                      },
                      "multi_shot": {
                        "type": "boolean"
                      },
                      "shot_type": {
                        "type": "string",
                        "enum": [
                          "customize",
                          "intelligence"
                        ]
                      },
                      "multi_prompt": {
                        "maxItems": 6,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "index": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 6
                            },
                            "prompt": {
                              "type": "string",
                              "maxLength": 2500
                            },
                            "duration": {
                              "type": "integer",
                              "minimum": 2,
                              "maximum": 30
                            }
                          },
                          "required": [
                            "index",
                            "prompt",
                            "duration"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "bypass_promo_queue": {
                        "type": "boolean"
                      },
                      "promo_mode": {
                        "type": "string",
                        "enum": [
                          "queue"
                        ]
                      },
                      "reference_face_mask": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "boolean"
                        }
                      },
                      "reference_hashes": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 64
                        }
                      },
                      "reference_audio": {
                        "maxItems": 5,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        }
                      },
                      "type": {
                        "type": "string",
                        "const": "video"
                      }
                    },
                    "required": [
                      "model",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "default": "",
                        "description": "The outer bound of the field. The limit that applies is the model's own `prompt_limit`, published per model by `GET /v1/models`, and it is lower for most models.",
                        "type": "string",
                        "maxLength": 100000
                      },
                      "model": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 80
                      },
                      "aspect": {
                        "type": "string",
                        "maxLength": 20
                      },
                      "resolution": {
                        "type": "string",
                        "maxLength": 10
                      },
                      "negative": {
                        "type": "string",
                        "maxLength": 5000
                      },
                      "image_urls": {
                        "maxItems": 16,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "style_ref_urls": {
                        "maxItems": 5,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "char_ref_urls": {
                        "maxItems": 5,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "seed": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "n_variants": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 4
                      },
                      "image_size": {
                        "type": "string",
                        "maxLength": 30
                      },
                      "guidance_scale": {
                        "type": "number"
                      },
                      "output_format": {
                        "type": "string",
                        "maxLength": 10
                      },
                      "quality": {
                        "type": "string",
                        "enum": [
                          "low",
                          "medium",
                          "high"
                        ]
                      },
                      "background": {
                        "type": "string",
                        "enum": [
                          "opaque",
                          "transparent"
                        ]
                      },
                      "promo_mode": {
                        "type": "string",
                        "enum": [
                          "queue",
                          "unlimited"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "const": "image"
                      }
                    },
                    "required": [
                      "model",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "image_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "model": {
                        "default": "topaz-upscale",
                        "type": "string",
                        "enum": [
                          "topaz-upscale",
                          "topaz-video-upscale",
                          "topaz-video-starlight-fast",
                          "topaz-video-starlight-hq",
                          "topaz-video-astra",
                          "flux-upscale-precise",
                          "flux-upscale-creative"
                        ]
                      },
                      "scale": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "input_width": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 20000
                      },
                      "input_height": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 20000
                      },
                      "topaz_model": {
                        "type": "string",
                        "enum": [
                          "standard-v2",
                          "high-fidelity-v2",
                          "low-resolution-v2",
                          "cgi",
                          "text-refine"
                        ]
                      },
                      "face_recovery": {
                        "type": "boolean"
                      },
                      "face_strength": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "sharpen": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "denoise": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "fix_compression": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "creativity": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "type": {
                        "type": "string",
                        "const": "upscale"
                      }
                    },
                    "required": [
                      "image_url",
                      "scale",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "default": "",
                        "type": "string",
                        "maxLength": 2000
                      },
                      "model": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 80
                      },
                      "image_urls": {
                        "maxItems": 5,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "GLB",
                          "OBJ",
                          "USDZ",
                          "FBX",
                          "STL",
                          "MP4"
                        ]
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "1536",
                          "1536pro"
                        ]
                      },
                      "material": {
                        "type": "string",
                        "enum": [
                          "PBR",
                          "Shaded",
                          "None"
                        ]
                      },
                      "mesh_mode": {
                        "type": "string",
                        "enum": [
                          "Raw",
                          "Quad"
                        ]
                      },
                      "generate_type": {
                        "type": "string",
                        "enum": [
                          "Normal",
                          "Geometry"
                        ]
                      },
                      "enable_pbr": {
                        "type": "boolean"
                      },
                      "enable_geometry": {
                        "type": "boolean"
                      },
                      "face_count": {
                        "type": "integer",
                        "minimum": 1000,
                        "maximum": 2000000
                      },
                      "face": {
                        "type": "integer",
                        "minimum": 1000,
                        "maximum": 2000000
                      },
                      "quality": {
                        "type": "integer",
                        "minimum": 1000,
                        "maximum": 2000000
                      },
                      "subdivision_level": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 3
                      },
                      "type": {
                        "type": "string",
                        "const": "3d"
                      }
                    },
                    "required": [
                      "model",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "video_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "audio_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "video_duration_sec": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 10
                      },
                      "audio_duration_sec": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 30
                      },
                      "video_duration_sig": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "audio_duration_sig": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "type": {
                        "type": "string",
                        "const": "lipsync"
                      }
                    },
                    "required": [
                      "video_url",
                      "audio_url",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "audio_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "image_urls": {
                        "minItems": 1,
                        "maxItems": 1,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "prompt": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "auto_mask": {
                        "type": "boolean"
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "omnihuman-1.5",
                          "wan2.2-digital-human"
                        ]
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "480p",
                          "720p",
                          "1080p"
                        ]
                      },
                      "turbo_mode": {
                        "type": "boolean"
                      },
                      "audio_duration_sec": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 60
                      },
                      "audio_duration_sig": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "type": {
                        "type": "string",
                        "const": "omnihuman"
                      }
                    },
                    "required": [
                      "audio_url",
                      "image_urls",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "mode": {
                        "default": "std",
                        "type": "string",
                        "enum": [
                          "std",
                          "pro"
                        ]
                      },
                      "prompt": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "audio_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "audio_duration_sec": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 60
                      },
                      "audio_duration_sig": {
                        "type": "string",
                        "maxLength": 128
                      },
                      "type": {
                        "type": "string",
                        "const": "avatar"
                      }
                    },
                    "required": [
                      "image_url",
                      "audio_url",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 40000
                      },
                      "voice_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "voice_name": {
                        "type": "string",
                        "maxLength": 60
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "text-to-speech-turbo-2-5",
                          "text-to-speech-flash-2-5",
                          "text-to-speech-multilingual-v2",
                          "text-to-speech-v3",
                          "text-to-speech-v4",
                          "text-to-speech-v4-turbo"
                        ]
                      },
                      "stability": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "similarity_boost": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "style": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "speed": {
                        "type": "number",
                        "minimum": 0.7,
                        "maximum": 1.2
                      },
                      "type": {
                        "type": "string",
                        "const": "voice"
                      }
                    },
                    "required": [
                      "text",
                      "voice_id",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "lyrics": {
                        "type": "string",
                        "maxLength": 5000
                      },
                      "style": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "model": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 80
                      },
                      "negative_tags": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "vocal_gender": {
                        "type": "string",
                        "enum": [
                          "m",
                          "f"
                        ]
                      },
                      "style_weight": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "type": {
                        "type": "string",
                        "const": "music"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "style": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "file_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2000
                      },
                      "instrumental": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "string",
                        "const": "music-cover"
                      }
                    },
                    "required": [
                      "file_url",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "prompt": {
                        "type": "string",
                        "minLength": 5,
                        "maxLength": 500
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "V6",
                          "V6_WILD",
                          "V6_MINI"
                        ]
                      },
                      "instrumental": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "string",
                        "const": "song"
                      }
                    },
                    "required": [
                      "prompt",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "theme": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 200
                      },
                      "mood": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "type": {
                        "type": "string",
                        "const": "lyrics"
                      }
                    },
                    "required": [
                      "theme",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "marketplace": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      "category": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      "background": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      "text": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "prompt": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "nano-banana-pro",
                          "nano-banana-2",
                          "nano-banana-2.1"
                        ]
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "1k",
                          "2k",
                          "4k"
                        ]
                      },
                      "aspect": {
                        "type": "string",
                        "enum": [
                          "3:4",
                          "1:1"
                        ]
                      },
                      "image_urls": {
                        "minItems": 1,
                        "maxItems": 3,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "type": {
                        "type": "string",
                        "const": "card-design"
                      }
                    },
                    "required": [
                      "marketplace",
                      "category",
                      "background",
                      "model",
                      "image_urls",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "style": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 1000
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 5000
                      },
                      "file_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "type": {
                        "type": "string",
                        "const": "music-vocals"
                      }
                    },
                    "required": [
                      "style",
                      "prompt",
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "style": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2000
                      },
                      "file_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "task_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "audio_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "source_generation_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "source_index": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                      },
                      "type": {
                        "type": "string",
                        "const": "music-instrumental"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "style": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2000
                      },
                      "file_url": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "task_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "audio_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "source_generation_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "source_index": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                      },
                      "type": {
                        "type": "string",
                        "const": "music-stems"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "text"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingEstimateDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Refused with `estimate_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/subscription/cancel": {
      "post": {
        "operationId": "postSubscriptionCancel",
        "summary": "Cancel the caller’s auto-renewal",
        "description": "The site’s own cancel, session only. The provider stops renewing at once; the plan runs to\n`plan_ends_at` — the end of the period already paid for — and `superseded` reports the one case\nwhere nothing ends, because a newer subscription already renews the plan. `reason` and\n`reason_text` feed the retention funnel and are optional.",
        "tags": [
          "subscription"
        ],
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-required-scope": [
          "billing:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "expensive",
                          "models",
                          "pause",
                          "other_service",
                          "other"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reason_text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionCancelDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`, `no_active_plan`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `subscription_not_linked`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`, `subscription_cancel_unsaved`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Refused with `subscription_cancel_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/subscription/card-change": {
      "post": {
        "operationId": "postSubscriptionCard-change",
        "summary": "Start changing the card an eligible subscription renews on",
        "description": "Session only. Opens a 1 RUB card check the browser runs through the payment widget as a\ntwo-stage authorization (`paymentSchema: \"Dual\"`): the sum is held, never captured, and released once the\nchange completes or expires on its own. The answer is what the widget needs — `payment_id` is\nits `invoiceId`. Any earlier unfinished check of the caller is abandoned by this call.\n\nRefused with `card_change_unavailable` when the subscription is not eligible for a card change,\nand with `checkout_in_progress` while a plan checkout is open.",
        "tags": [
          "subscription"
        ],
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-required-scope": [
          "billing:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The card check was opened.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardChangeBeginDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `card_change_unavailable`, `checkout_in_progress`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/subscription/card-change/complete": {
      "post": {
        "operationId": "postSubscriptionCard-changeComplete",
        "summary": "Finish a card change after the widget authorized the check",
        "description": "Session only. The authorization is read back from the provider — by `transaction_id` when the\nwidget reported one, otherwise by invoice — and must be this caller’s own 1 RUB `Authorized`\ncheck on a card, or `card_check_not_authorized` is answered and nothing changes. A new\nsubscription is then created on the new card and the old one cancelled; a subscription that\nis overdue is charged on the new card at once, which `charge` reports. The hold is released\non every outcome. Calling twice answers `card_change_in_progress`.",
        "tags": [
          "subscription"
        ],
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-required-scope": [
          "billing:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "payment_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "transaction_id": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "payment_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardChangeCompleteDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`, `plan_expired`, `renewal_already_on`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `subscription_not_linked`, `card_check_not_authorized`, `card_change_in_progress`, `card_change_unavailable`, `checkout_in_progress`, `subscription_superseded`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Refused with `card_change_failed`, `subscription_resume_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/subscription/resume": {
      "post": {
        "operationId": "postSubscriptionResume",
        "summary": "Turn the caller’s auto-renewal back on",
        "description": "The site’s own resume, reached over the session cookie only — no scope in the vocabulary names\nit, so a key or an OAuth grant answers `insufficient_scope`. The cancellation marker is lifted\nand renewal is re-enabled on the subscription’s saved payment method.\nNothing is charged by this call; `next_pay_date`\nis when the first renewal lands.\n\nA plan checkout still open on any provider refuses with `checkout_in_progress`; a newer\nsubscription that already renews the plan answers `subscription_superseded`.",
        "tags": [
          "subscription"
        ],
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "x-required-scope": [
          "billing:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionResumeDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `plan_expired`, `renewal_already_on`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `subscription_not_linked`, `card_token_missing`, `checkout_in_progress`, `subscription_superseded`, `subscription_recancelled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Refused with `subscription_resume_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/support/messages": {
      "get": {
        "operationId": "getSupportMessages",
        "summary": "Read the caller’s support thread",
        "description": "The caller’s one support ticket, exactly as the site shows it: staff notes and messages from\nbefore the thread was last archived are never included, and reading it marks it read the same\nway opening the chat does. An account with no ticket yet answers an empty list, never 404 —\nthe same singleton-read convention `GET /v1/billing/subscription` uses.\n\nEvery message names `from`: `\"user\"` for the caller’s own messages, `\"support\"` for anything a\nstaff role sent. `text` is exactly as authored — never translated, never rewritten — and\n`images` are the URLs the site itself renders.",
        "tags": [
          "support"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "support:read"
            ]
          }
        ],
        "x-required-scope": [
          "support:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportMessageCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postSupportMessages",
        "summary": "Send a message into the caller’s support thread",
        "description": "Raises the caller’s one support ticket the same way the site’s chat does — opening it if none\nexists yet, reopening it if it was closed. A message sent through this route posts **no chat\nnotification**: this service has no staff Telegram transport, so the ticket and its unread\ncount are raised exactly as a report filed through\n`POST /v1/generations/{id}/report` is, without a card appearing anywhere. Staff find it\nthrough the admin queue.\n\n`images` are `reference`s from `POST /v1/uploads`, never a public URL: each one is\nbyte-validated and ownership-checked at send, exactly like a submit reference, and a refusal\nnames the limit it hit rather than silently resizing or dropping the picture. A refused\nreference writes no message at all — the picture and the text arrive together or not at all.\n\nSend `client_msg_id` — a UUID — to make a retry after a lost response replay the first send\ninstead of posting a second message, with the same pictures it was answered with the first\ntime. The same id with different text or a different number of images answers\n`support_replay_mismatch` rather than being silently reused.",
        "tags": [
          "support"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "support:write"
            ]
          }
        ],
        "x-required-scope": [
          "support:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "default": "",
                    "type": "string",
                    "maxLength": 2000
                  },
                  "images": {
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "client_msg_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The message was sent (or, on a replay, was already sent); the thread it landed on is named.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportMessageSentDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `support_replay_mismatch`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/uploads": {
      "post": {
        "operationId": "postUploads",
        "summary": "Get a presigned PUT for a reference file",
        "description": "Signs a single PUT into the private bucket and tells you exactly what to send. A presign is\nnot a spend: it buys storage the retention sweep reclaims, never credits, so this route\ncarries no paid gate — only its own `uploads:write` scope, kept separate from\n`generations:write` so a key may not mint a write capability into our storage.\n\n200 and not 201: no object exists yet. It exists only once you complete the PUT with\nexactly the `headers` returned — the signature binds them, and R2 answers 403 on a mismatch.\n`content_length` is exact rather than a maximum, because a query-presigned PUT binds a length.\n\nThe ticket writes its key once: `If-None-Match: *` is signed with the rest, so a second PUT\nto the same url answers 412 rather than replacing bytes a submit may already have accepted.\nA PUT that must be retried takes a fresh ticket.\n\nThe ticket is registered in your library before it is handed over, which is what puts the\nobject on the retention clock. A ticket you never use leaves an empty library entry that the\nsame retention reclaims.\n\nSend `reference` back at submit time (e.g. in `image_urls`). The bytes are checked at submit,\nnot at upload, so a signature here is not an acceptance of the file.",
        "tags": [
          "uploads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "uploads:write"
            ]
          }
        ],
        "x-required-scope": [
          "uploads:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "image",
                      "video",
                      "audio",
                      "file"
                    ]
                  },
                  "content_type": {
                    "type": "string",
                    "minLength": 1
                  },
                  "content_length": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "kind",
                  "content_type",
                  "content_length"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadTicketDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`, `upload_unavailable`. Rate-limit headers are absent on `api_disabled`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/uploads/content": {
      "put": {
        "operationId": "putUploadsContent",
        "summary": "Complete an upload through this API instead of the store",
        "description": "The same ticket, finished against this host. Use it when a direct PUT to `url` cannot carry\nyour file: that url points at the object store’s own host, and some networks throttle it to\nthe point where anything but a tiny body fails to arrive. `proxy_path` on the ticket is this\nroute with the reference already filled in.\n\nSend the bytes as the raw body with the same `Content-Type` the ticket was issued for. The\nticket decides the type and the exact length, so a mismatch is refused rather than stored.\n\nOne ticket writes once, whichever path you use, so neither can replace bytes a submit may\nalready have accepted. The refusal differs by who answers it: a second completion here is 409\n`duplicate_key_conflict`, while a second PUT against `url` is refused by the store itself as\n412 — that condition is signed into the url and never reaches this API.\n\nThe answer echoes the reference and the byte count actually stored, so a client holding the\nticket and the file apart can match them without keeping the query it just sent.",
        "tags": [
          "uploads"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "uploads:write"
            ]
          }
        ],
        "x-required-scope": [
          "uploads:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reference",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "Content-Length",
            "in": "header",
            "required": true,
            "description": "The ticket's `content_length`, exactly. Judged before the body is read, so a chunked request carrying no length is refused rather than stored.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "image/webp": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "video/mp4": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "video/quicktime": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "video/webm": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "audio/mpeg": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "audio/mp3": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "audio/wav": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "audio/wave": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "audio/x-wav": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "audio/ogg": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            },
            "audio/aac": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 41943040
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadStoredDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `duplicate_key_conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/whoami": {
      "get": {
        "operationId": "getWhoami",
        "summary": "Read what the credential resolved to",
        "description": "The principal behind this request: which account, which channel, which credential, and the scopes it holds. A session carries the full scope set. `spend_limit` is the credential’s own monthly ceiling for the current calendar month in Moscow time — null on the session channel, and `monthly_limit_cc`/`remaining_cc` null on a credential with no ceiling set — so a caller can check its remaining budget before submitting.",
        "tags": [
          "whoami"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "me:read"
            ]
          }
        ],
        "x-required-scope": [
          "me:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhoamiDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/blocks": {
      "get": {
        "operationId": "getWorkflowsBlocks",
        "summary": "List the caller’s saved blocks",
        "description": "Reusable node groups saved out of a chain, newest-updated first, capped at 100 — `next_cursor` is always null.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:read"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowBlockCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postWorkflowsBlocks",
        "summary": "Save a new block",
        "description": "Stores a subgraph — one or more connected nodes selected out of a chain — under a caller- chosen id. The same reference-ownership and account-ceiling refusals as `POST /v1/workflows/templates` apply, against the block’s own 100-item ceiling.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "default": "",
                    "type": "string",
                    "maxLength": 500
                  },
                  "canvas": {
                    "type": "object",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "resultSelection": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        },
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "generationId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "outputIndex": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 99
                            }
                          },
                          "required": [
                            "generationId",
                            "outputIndex"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "viewport": {
                        "type": "object",
                        "properties": {
                          "x": {
                            "type": "number"
                          },
                          "y": {
                            "type": "number"
                          },
                          "zoom": {
                            "type": "number",
                            "minimum": 0.2,
                            "maximum": 2
                          }
                        },
                        "required": [
                          "x",
                          "y",
                          "zoom"
                        ],
                        "additionalProperties": false
                      },
                      "runIds": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "bypassedNodeIds": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        }
                      },
                      "nodes": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "array"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "arrayText": {
                                      "type": "string",
                                      "maxLength": 100000
                                    },
                                    "separator": {
                                      "type": "string",
                                      "maxLength": 32
                                    },
                                    "keepEmpty": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-to-mask"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "image-to-mask"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "luminance",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "matte"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "matte"
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": -20,
                                          "maximum": 20
                                        },
                                        "feather": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 20
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "radius",
                                        "feather",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "merge-alpha"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "merge-alpha"
                                        },
                                        "mode": {
                                          "type": "string",
                                          "enum": [
                                            "replace",
                                            "multiply"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "mode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "mask-to-image"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "mask-to-image"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "note"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "noteText": {
                                      "type": "string",
                                      "maxLength": 2000
                                    },
                                    "noteColor": {
                                      "type": "string",
                                      "enum": [
                                        "yellow",
                                        "pink",
                                        "blue",
                                        "green"
                                      ]
                                    },
                                    "noteSize": {
                                      "type": "string",
                                      "enum": [
                                        "small",
                                        "medium",
                                        "large"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "number"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "number": {
                                      "type": "object",
                                      "properties": {
                                        "value": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "min": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "max": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "decimals": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 6
                                        }
                                      },
                                      "required": [
                                        "value",
                                        "min",
                                        "max",
                                        "decimals"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "boolean"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "booleanValue": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "to-text"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "convertFrom": {
                                      "type": "string",
                                      "enum": [
                                        "number",
                                        "boolean"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "levels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "levels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "rgb",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "inputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "inputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "gamma": {
                                          "type": "number",
                                          "minimum": 0.1,
                                          "maximum": 10
                                        },
                                        "outputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "outputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "inputBlack",
                                        "inputWhite",
                                        "gamma",
                                        "outputBlack",
                                        "outputWhite"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "channels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "channels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "rotate"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "rotate"
                                        },
                                        "angle": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "flipHorizontal": {
                                          "type": "boolean"
                                        },
                                        "flipVertical": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "angle",
                                        "flipHorizontal",
                                        "flipVertical"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "color"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "color"
                                        },
                                        "hue": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "saturation": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "brightness": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "contrast": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "hue",
                                        "saturation",
                                        "brightness",
                                        "contrast"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "blur"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "blur"
                                        },
                                        "method": {
                                          "type": "string",
                                          "enum": [
                                            "gaussian",
                                            "box"
                                          ]
                                        },
                                        "sigma": {
                                          "type": "number",
                                          "minimum": 0.3,
                                          "maximum": 100
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 10
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "method",
                                        "sigma",
                                        "radius"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "invert"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "invert"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "crop"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "crop"
                                        },
                                        "x": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "y": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "width": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "height": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "longestSide": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "x",
                                        "y",
                                        "width",
                                        "height",
                                        "longestSide"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "resize"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "resize"
                                        },
                                        "width": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        },
                                        "height": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "width",
                                        "height"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "output"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "preview"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "router"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "routeType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "text",
                                        "video",
                                        "audio",
                                        "text-list",
                                        "number",
                                        "boolean",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "compare"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "compareMode": {
                                      "type": "string",
                                      "enum": [
                                        "slider",
                                        "toggle"
                                      ]
                                    },
                                    "comparePosition": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 100
                                    },
                                    "compareSide": {
                                      "type": "string",
                                      "enum": [
                                        "a",
                                        "b"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    },
                                    "images": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "url": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 4096
                                          },
                                          "name": {
                                            "type": "string",
                                            "maxLength": 160
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "url"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-list"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "items": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "text": {
                                            "type": "string",
                                            "maxLength": 2000
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "text"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "list-selector"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "selectedItemId": {
                                      "type": "string",
                                      "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "prompt",
                                    "concatenate"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "variables": {
                                      "maxItems": 8,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^var[1-9]\\d{0,5}$"
                                          },
                                          "label": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 40
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "label"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "promptDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "source",
                                        "value",
                                        "both"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "audio-file"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "audioUrl": {
                                      "type": "string",
                                      "maxLength": 4096
                                    },
                                    "audioName": {
                                      "type": "string",
                                      "maxLength": 160
                                    },
                                    "durationSec": {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "character"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "referenceType": {
                                      "type": "string",
                                      "enum": [
                                        "mask",
                                        "audio",
                                        "video"
                                      ]
                                    },
                                    "imageUrl": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "imageUrl"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video",
                                    "music",
                                    "voice"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "params": {
                                      "type": "object",
                                      "properties": {
                                        "aspect": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "resolution": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "duration": {
                                          "type": "string",
                                          "maxLength": 8
                                        },
                                        "sound": {
                                          "type": "boolean"
                                        },
                                        "nVariants": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4
                                        },
                                        "negativePrompt": {
                                          "type": "string",
                                          "maxLength": 20000
                                        },
                                        "instrumental": {
                                          "type": "boolean"
                                        },
                                        "voiceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "voiceName": {
                                          "type": "string",
                                          "maxLength": 60
                                        },
                                        "speed": {
                                          "type": "number",
                                          "minimum": 0.7,
                                          "maximum": 1.2
                                        },
                                        "scale": {
                                          "type": "string",
                                          "maxLength": 4
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "modelId"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            }
                          ]
                        }
                      },
                      "edges": {
                        "maxItems": 60,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "source": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "target": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "sourceHandle": {
                              "type": "string",
                              "maxLength": 32
                            },
                            "targetHandle": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "source",
                            "target"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "groups": {
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "titleSize": {
                              "type": "string",
                              "enum": [
                                "small",
                                "medium",
                                "large"
                              ]
                            },
                            "nodeIds": {
                              "maxItems": 30,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                              }
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "title": {
                              "type": "string",
                              "maxLength": 60
                            },
                            "x": {
                              "type": "number"
                            },
                            "y": {
                              "type": "number"
                            },
                            "width": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "height": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "color": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "title",
                            "x",
                            "y",
                            "width",
                            "height"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "nodes",
                      "edges"
                    ]
                  }
                },
                "required": [
                  "id",
                  "title",
                  "canvas"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The block was stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowBlockMutationDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `resource_conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/blocks/{id}": {
      "delete": {
        "operationId": "deleteWorkflowsBlocksById",
        "summary": "Delete one block",
        "description": "A soft delete — the block no longer appears in the list or is resolvable by id.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The block id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getWorkflowsBlocksById",
        "summary": "Read one block, or one of its saved revisions",
        "description": "Without `revision`: the current block plus its lightweight revision list. With it: that one historical revision in full, and no revision list beside it.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:read"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The block id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowBlockGetDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchWorkflowsBlocksById",
        "summary": "Update one block",
        "description": "The same optimistic-concurrency rule as chains: `expected_revision` must match the block’s current `revision`, or the write answers `revision_conflict`.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The block id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483646
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "default": "",
                    "type": "string",
                    "maxLength": 500
                  },
                  "canvas": {
                    "type": "object",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "resultSelection": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        },
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "generationId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "outputIndex": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 99
                            }
                          },
                          "required": [
                            "generationId",
                            "outputIndex"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "viewport": {
                        "type": "object",
                        "properties": {
                          "x": {
                            "type": "number"
                          },
                          "y": {
                            "type": "number"
                          },
                          "zoom": {
                            "type": "number",
                            "minimum": 0.2,
                            "maximum": 2
                          }
                        },
                        "required": [
                          "x",
                          "y",
                          "zoom"
                        ],
                        "additionalProperties": false
                      },
                      "runIds": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "bypassedNodeIds": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        }
                      },
                      "nodes": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "array"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "arrayText": {
                                      "type": "string",
                                      "maxLength": 100000
                                    },
                                    "separator": {
                                      "type": "string",
                                      "maxLength": 32
                                    },
                                    "keepEmpty": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-to-mask"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "image-to-mask"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "luminance",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "matte"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "matte"
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": -20,
                                          "maximum": 20
                                        },
                                        "feather": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 20
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "radius",
                                        "feather",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "merge-alpha"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "merge-alpha"
                                        },
                                        "mode": {
                                          "type": "string",
                                          "enum": [
                                            "replace",
                                            "multiply"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "mode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "mask-to-image"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "mask-to-image"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "note"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "noteText": {
                                      "type": "string",
                                      "maxLength": 2000
                                    },
                                    "noteColor": {
                                      "type": "string",
                                      "enum": [
                                        "yellow",
                                        "pink",
                                        "blue",
                                        "green"
                                      ]
                                    },
                                    "noteSize": {
                                      "type": "string",
                                      "enum": [
                                        "small",
                                        "medium",
                                        "large"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "number"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "number": {
                                      "type": "object",
                                      "properties": {
                                        "value": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "min": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "max": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "decimals": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 6
                                        }
                                      },
                                      "required": [
                                        "value",
                                        "min",
                                        "max",
                                        "decimals"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "boolean"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "booleanValue": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "to-text"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "convertFrom": {
                                      "type": "string",
                                      "enum": [
                                        "number",
                                        "boolean"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "levels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "levels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "rgb",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "inputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "inputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "gamma": {
                                          "type": "number",
                                          "minimum": 0.1,
                                          "maximum": 10
                                        },
                                        "outputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "outputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "inputBlack",
                                        "inputWhite",
                                        "gamma",
                                        "outputBlack",
                                        "outputWhite"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "channels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "channels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "rotate"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "rotate"
                                        },
                                        "angle": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "flipHorizontal": {
                                          "type": "boolean"
                                        },
                                        "flipVertical": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "angle",
                                        "flipHorizontal",
                                        "flipVertical"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "color"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "color"
                                        },
                                        "hue": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "saturation": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "brightness": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "contrast": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "hue",
                                        "saturation",
                                        "brightness",
                                        "contrast"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "blur"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "blur"
                                        },
                                        "method": {
                                          "type": "string",
                                          "enum": [
                                            "gaussian",
                                            "box"
                                          ]
                                        },
                                        "sigma": {
                                          "type": "number",
                                          "minimum": 0.3,
                                          "maximum": 100
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 10
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "method",
                                        "sigma",
                                        "radius"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "invert"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "invert"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "crop"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "crop"
                                        },
                                        "x": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "y": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "width": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "height": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "longestSide": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "x",
                                        "y",
                                        "width",
                                        "height",
                                        "longestSide"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "resize"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "resize"
                                        },
                                        "width": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        },
                                        "height": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "width",
                                        "height"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "output"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "preview"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "router"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "routeType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "text",
                                        "video",
                                        "audio",
                                        "text-list",
                                        "number",
                                        "boolean",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "compare"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "compareMode": {
                                      "type": "string",
                                      "enum": [
                                        "slider",
                                        "toggle"
                                      ]
                                    },
                                    "comparePosition": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 100
                                    },
                                    "compareSide": {
                                      "type": "string",
                                      "enum": [
                                        "a",
                                        "b"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    },
                                    "images": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "url": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 4096
                                          },
                                          "name": {
                                            "type": "string",
                                            "maxLength": 160
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "url"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-list"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "items": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "text": {
                                            "type": "string",
                                            "maxLength": 2000
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "text"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "list-selector"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "selectedItemId": {
                                      "type": "string",
                                      "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "prompt",
                                    "concatenate"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "variables": {
                                      "maxItems": 8,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^var[1-9]\\d{0,5}$"
                                          },
                                          "label": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 40
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "label"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "promptDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "source",
                                        "value",
                                        "both"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "audio-file"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "audioUrl": {
                                      "type": "string",
                                      "maxLength": 4096
                                    },
                                    "audioName": {
                                      "type": "string",
                                      "maxLength": 160
                                    },
                                    "durationSec": {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "character"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "referenceType": {
                                      "type": "string",
                                      "enum": [
                                        "mask",
                                        "audio",
                                        "video"
                                      ]
                                    },
                                    "imageUrl": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "imageUrl"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video",
                                    "music",
                                    "voice"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "params": {
                                      "type": "object",
                                      "properties": {
                                        "aspect": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "resolution": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "duration": {
                                          "type": "string",
                                          "maxLength": 8
                                        },
                                        "sound": {
                                          "type": "boolean"
                                        },
                                        "nVariants": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4
                                        },
                                        "negativePrompt": {
                                          "type": "string",
                                          "maxLength": 20000
                                        },
                                        "instrumental": {
                                          "type": "boolean"
                                        },
                                        "voiceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "voiceName": {
                                          "type": "string",
                                          "maxLength": 60
                                        },
                                        "speed": {
                                          "type": "number",
                                          "minimum": 0.7,
                                          "maximum": 1.2
                                        },
                                        "scale": {
                                          "type": "string",
                                          "maxLength": 4
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "modelId"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            }
                          ]
                        }
                      },
                      "edges": {
                        "maxItems": 60,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "source": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "target": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "sourceHandle": {
                              "type": "string",
                              "maxLength": 32
                            },
                            "targetHandle": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "source",
                            "target"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "groups": {
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "titleSize": {
                              "type": "string",
                              "enum": [
                                "small",
                                "medium",
                                "large"
                              ]
                            },
                            "nodeIds": {
                              "maxItems": 30,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                              }
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "title": {
                              "type": "string",
                              "maxLength": 60
                            },
                            "x": {
                              "type": "number"
                            },
                            "y": {
                              "type": "number"
                            },
                            "width": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "height": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "color": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "title",
                            "x",
                            "y",
                            "width",
                            "height"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "nodes",
                      "edges"
                    ]
                  }
                },
                "required": [
                  "expected_revision",
                  "title",
                  "canvas"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowBlockMutationDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `revision_conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/estimate": {
      "post": {
        "operationId": "postWorkflowsEstimate",
        "summary": "Price a chain before running it",
        "description": "What `POST /v1/workflows/runs` would charge for this exact graph: the sum of every node’s\nprice with the plan discount applied exactly as the run applies it — never an under-quote. A\nplan’s free generations never apply to a chain, so neither this estimate nor the run spends them.\nCarries no paid gate, the same reasoning as `POST /v1/pricing/estimate`.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:read"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "graph": {
                    "type": "object",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "resultSelection": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        },
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "generationId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "outputIndex": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 99
                            }
                          },
                          "required": [
                            "generationId",
                            "outputIndex"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "viewport": {
                        "type": "object",
                        "properties": {
                          "x": {
                            "type": "number"
                          },
                          "y": {
                            "type": "number"
                          },
                          "zoom": {
                            "type": "number",
                            "minimum": 0.2,
                            "maximum": 2
                          }
                        },
                        "required": [
                          "x",
                          "y",
                          "zoom"
                        ],
                        "additionalProperties": false
                      },
                      "runIds": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "bypassedNodeIds": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        }
                      },
                      "nodes": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "array"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "arrayText": {
                                      "type": "string",
                                      "maxLength": 100000
                                    },
                                    "separator": {
                                      "type": "string",
                                      "maxLength": 32
                                    },
                                    "keepEmpty": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-to-mask"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "image-to-mask"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "luminance",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "matte"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "matte"
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": -20,
                                          "maximum": 20
                                        },
                                        "feather": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 20
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "radius",
                                        "feather",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "merge-alpha"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "merge-alpha"
                                        },
                                        "mode": {
                                          "type": "string",
                                          "enum": [
                                            "replace",
                                            "multiply"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "mode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "mask-to-image"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "mask-to-image"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "note"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "noteText": {
                                      "type": "string",
                                      "maxLength": 2000
                                    },
                                    "noteColor": {
                                      "type": "string",
                                      "enum": [
                                        "yellow",
                                        "pink",
                                        "blue",
                                        "green"
                                      ]
                                    },
                                    "noteSize": {
                                      "type": "string",
                                      "enum": [
                                        "small",
                                        "medium",
                                        "large"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "number"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "number": {
                                      "type": "object",
                                      "properties": {
                                        "value": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "min": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "max": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "decimals": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 6
                                        }
                                      },
                                      "required": [
                                        "value",
                                        "min",
                                        "max",
                                        "decimals"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "boolean"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "booleanValue": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "to-text"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "convertFrom": {
                                      "type": "string",
                                      "enum": [
                                        "number",
                                        "boolean"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "levels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "levels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "rgb",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "inputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "inputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "gamma": {
                                          "type": "number",
                                          "minimum": 0.1,
                                          "maximum": 10
                                        },
                                        "outputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "outputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "inputBlack",
                                        "inputWhite",
                                        "gamma",
                                        "outputBlack",
                                        "outputWhite"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "channels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "channels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "rotate"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "rotate"
                                        },
                                        "angle": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "flipHorizontal": {
                                          "type": "boolean"
                                        },
                                        "flipVertical": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "angle",
                                        "flipHorizontal",
                                        "flipVertical"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "color"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "color"
                                        },
                                        "hue": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "saturation": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "brightness": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "contrast": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "hue",
                                        "saturation",
                                        "brightness",
                                        "contrast"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "blur"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "blur"
                                        },
                                        "method": {
                                          "type": "string",
                                          "enum": [
                                            "gaussian",
                                            "box"
                                          ]
                                        },
                                        "sigma": {
                                          "type": "number",
                                          "minimum": 0.3,
                                          "maximum": 100
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 10
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "method",
                                        "sigma",
                                        "radius"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "invert"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "invert"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "crop"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "crop"
                                        },
                                        "x": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "y": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "width": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "height": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "longestSide": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "x",
                                        "y",
                                        "width",
                                        "height",
                                        "longestSide"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "resize"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "resize"
                                        },
                                        "width": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        },
                                        "height": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "width",
                                        "height"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "output"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "preview"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "router"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "routeType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "text",
                                        "video",
                                        "audio",
                                        "text-list",
                                        "number",
                                        "boolean",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "compare"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "compareMode": {
                                      "type": "string",
                                      "enum": [
                                        "slider",
                                        "toggle"
                                      ]
                                    },
                                    "comparePosition": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 100
                                    },
                                    "compareSide": {
                                      "type": "string",
                                      "enum": [
                                        "a",
                                        "b"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    },
                                    "images": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "url": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 4096
                                          },
                                          "name": {
                                            "type": "string",
                                            "maxLength": 160
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "url"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-list"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "items": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "text": {
                                            "type": "string",
                                            "maxLength": 2000
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "text"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "list-selector"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "selectedItemId": {
                                      "type": "string",
                                      "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "prompt",
                                    "concatenate"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "variables": {
                                      "maxItems": 8,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^var[1-9]\\d{0,5}$"
                                          },
                                          "label": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 40
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "label"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "promptDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "source",
                                        "value",
                                        "both"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "audio-file"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "audioUrl": {
                                      "type": "string",
                                      "maxLength": 4096
                                    },
                                    "audioName": {
                                      "type": "string",
                                      "maxLength": 160
                                    },
                                    "durationSec": {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "character"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "referenceType": {
                                      "type": "string",
                                      "enum": [
                                        "mask",
                                        "audio",
                                        "video"
                                      ]
                                    },
                                    "imageUrl": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "imageUrl"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video",
                                    "music",
                                    "voice"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "params": {
                                      "type": "object",
                                      "properties": {
                                        "aspect": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "resolution": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "duration": {
                                          "type": "string",
                                          "maxLength": 8
                                        },
                                        "sound": {
                                          "type": "boolean"
                                        },
                                        "nVariants": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4
                                        },
                                        "negativePrompt": {
                                          "type": "string",
                                          "maxLength": 20000
                                        },
                                        "instrumental": {
                                          "type": "boolean"
                                        },
                                        "voiceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "voiceName": {
                                          "type": "string",
                                          "maxLength": 60
                                        },
                                        "speed": {
                                          "type": "number",
                                          "minimum": 0.7,
                                          "maximum": 1.2
                                        },
                                        "scale": {
                                          "type": "string",
                                          "maxLength": 4
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "modelId"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            }
                          ]
                        }
                      },
                      "edges": {
                        "maxItems": 60,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "source": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "target": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "sourceHandle": {
                              "type": "string",
                              "maxLength": 32
                            },
                            "targetHandle": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "source",
                            "target"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "groups": {
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "titleSize": {
                              "type": "string",
                              "enum": [
                                "small",
                                "medium",
                                "large"
                              ]
                            },
                            "nodeIds": {
                              "maxItems": 30,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                              }
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "title": {
                              "type": "string",
                              "maxLength": 60
                            },
                            "x": {
                              "type": "number"
                            },
                            "y": {
                              "type": "number"
                            },
                            "width": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "height": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "color": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "title",
                            "x",
                            "y",
                            "width",
                            "height"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "nodes",
                      "edges"
                    ]
                  }
                },
                "required": [
                  "graph"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowEstimateDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/retry-item": {
      "post": {
        "operationId": "postWorkflowsRetry-item",
        "summary": "Retry one failed iterator item, or preview its cost first",
        "description": "`action: \"preview\"` prices the retry without spending or claiming an `Idempotency-Key`;\n`action: \"run\"` requires the header and submits exactly like `POST /v1/workflows/runs`,\nanswering 202. Every sibling item sharing the same failed iterator retries alongside it.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Required on every call; only `action: \"run\"` uses it to dedupe a retry.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workflow_id": {
                    "type": "string"
                  },
                  "node_key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "template_id": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "preview",
                      "run"
                    ]
                  }
                },
                "required": [
                  "workflow_id",
                  "node_key",
                  "template_id",
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`action: \"preview\"` answers 200; `action: \"run\"` answers 202 instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowRetryItemResponseDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "description": "A submitted retry (`action: \"run\"`), same body shape.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowRetryItemResponseDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "description": "Refused with `payment_required`, `insufficient_credits`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `moderation_blocked`, `access_denied`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `resource_conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`, `submit_unavailable`. Rate-limit headers are absent on `api_disabled`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/runs": {
      "get": {
        "operationId": "getWorkflowsRuns",
        "summary": "List the caller’s runs",
        "description": "The caller’s own run history, newest first. Pass `next_cursor` back as `cursor` unchanged; it is opaque and must not be parsed. `limit` defaults to 20 and caps at 100 — over the cap is refused, never clamped.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:read"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowRunListDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_limit`, `invalid_cursor`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postWorkflowsRuns",
        "summary": "Run a chain",
        "description": "Compiles and submits a canvas graph over the shared submit pipeline — the same moderation,\nreference-trust and money edges `POST /v1/generations` composes. Root nodes are submitted\ninline; the rest release as their inputs finish, polled through `GET /v1/workflows/runs/{id}`.\n\n`Idempotency-Key` is mandatory and is this run’s durable identity: a replayed key with the\nsame graph answers the first submit’s row without moderating or charging a second time. A\nclosed canvas answers `not_found` on this route too.\n\nA session may run without an active paid plan; a non-staff key without one answers `payment_required` — the same\nsplit `POST /v1/generations` enforces.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Caller-chosen key that makes a retry replay the first run instead of a second one.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "graph": {
                    "type": "object",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "resultSelection": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        },
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "generationId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "outputIndex": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 99
                            }
                          },
                          "required": [
                            "generationId",
                            "outputIndex"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "viewport": {
                        "type": "object",
                        "properties": {
                          "x": {
                            "type": "number"
                          },
                          "y": {
                            "type": "number"
                          },
                          "zoom": {
                            "type": "number",
                            "minimum": 0.2,
                            "maximum": 2
                          }
                        },
                        "required": [
                          "x",
                          "y",
                          "zoom"
                        ],
                        "additionalProperties": false
                      },
                      "runIds": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "bypassedNodeIds": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        }
                      },
                      "nodes": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "array"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "arrayText": {
                                      "type": "string",
                                      "maxLength": 100000
                                    },
                                    "separator": {
                                      "type": "string",
                                      "maxLength": 32
                                    },
                                    "keepEmpty": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-to-mask"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "image-to-mask"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "luminance",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "matte"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "matte"
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": -20,
                                          "maximum": 20
                                        },
                                        "feather": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 20
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "radius",
                                        "feather",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "merge-alpha"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "merge-alpha"
                                        },
                                        "mode": {
                                          "type": "string",
                                          "enum": [
                                            "replace",
                                            "multiply"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "mode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "mask-to-image"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "mask-to-image"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "note"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "noteText": {
                                      "type": "string",
                                      "maxLength": 2000
                                    },
                                    "noteColor": {
                                      "type": "string",
                                      "enum": [
                                        "yellow",
                                        "pink",
                                        "blue",
                                        "green"
                                      ]
                                    },
                                    "noteSize": {
                                      "type": "string",
                                      "enum": [
                                        "small",
                                        "medium",
                                        "large"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "number"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "number": {
                                      "type": "object",
                                      "properties": {
                                        "value": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "min": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "max": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "decimals": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 6
                                        }
                                      },
                                      "required": [
                                        "value",
                                        "min",
                                        "max",
                                        "decimals"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "boolean"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "booleanValue": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "to-text"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "convertFrom": {
                                      "type": "string",
                                      "enum": [
                                        "number",
                                        "boolean"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "levels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "levels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "rgb",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "inputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "inputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "gamma": {
                                          "type": "number",
                                          "minimum": 0.1,
                                          "maximum": 10
                                        },
                                        "outputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "outputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "inputBlack",
                                        "inputWhite",
                                        "gamma",
                                        "outputBlack",
                                        "outputWhite"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "channels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "channels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "rotate"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "rotate"
                                        },
                                        "angle": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "flipHorizontal": {
                                          "type": "boolean"
                                        },
                                        "flipVertical": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "angle",
                                        "flipHorizontal",
                                        "flipVertical"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "color"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "color"
                                        },
                                        "hue": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "saturation": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "brightness": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "contrast": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "hue",
                                        "saturation",
                                        "brightness",
                                        "contrast"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "blur"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "blur"
                                        },
                                        "method": {
                                          "type": "string",
                                          "enum": [
                                            "gaussian",
                                            "box"
                                          ]
                                        },
                                        "sigma": {
                                          "type": "number",
                                          "minimum": 0.3,
                                          "maximum": 100
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 10
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "method",
                                        "sigma",
                                        "radius"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "invert"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "invert"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "crop"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "crop"
                                        },
                                        "x": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "y": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "width": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "height": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "longestSide": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "x",
                                        "y",
                                        "width",
                                        "height",
                                        "longestSide"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "resize"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "resize"
                                        },
                                        "width": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        },
                                        "height": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "width",
                                        "height"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "output"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "preview"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "router"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "routeType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "text",
                                        "video",
                                        "audio",
                                        "text-list",
                                        "number",
                                        "boolean",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "compare"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "compareMode": {
                                      "type": "string",
                                      "enum": [
                                        "slider",
                                        "toggle"
                                      ]
                                    },
                                    "comparePosition": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 100
                                    },
                                    "compareSide": {
                                      "type": "string",
                                      "enum": [
                                        "a",
                                        "b"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    },
                                    "images": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "url": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 4096
                                          },
                                          "name": {
                                            "type": "string",
                                            "maxLength": 160
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "url"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-list"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "items": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "text": {
                                            "type": "string",
                                            "maxLength": 2000
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "text"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "list-selector"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "selectedItemId": {
                                      "type": "string",
                                      "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "prompt",
                                    "concatenate"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "variables": {
                                      "maxItems": 8,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^var[1-9]\\d{0,5}$"
                                          },
                                          "label": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 40
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "label"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "promptDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "source",
                                        "value",
                                        "both"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "audio-file"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "audioUrl": {
                                      "type": "string",
                                      "maxLength": 4096
                                    },
                                    "audioName": {
                                      "type": "string",
                                      "maxLength": 160
                                    },
                                    "durationSec": {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "character"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "referenceType": {
                                      "type": "string",
                                      "enum": [
                                        "mask",
                                        "audio",
                                        "video"
                                      ]
                                    },
                                    "imageUrl": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "imageUrl"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video",
                                    "music",
                                    "voice"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "params": {
                                      "type": "object",
                                      "properties": {
                                        "aspect": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "resolution": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "duration": {
                                          "type": "string",
                                          "maxLength": 8
                                        },
                                        "sound": {
                                          "type": "boolean"
                                        },
                                        "nVariants": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4
                                        },
                                        "negativePrompt": {
                                          "type": "string",
                                          "maxLength": 20000
                                        },
                                        "instrumental": {
                                          "type": "boolean"
                                        },
                                        "voiceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "voiceName": {
                                          "type": "string",
                                          "maxLength": 60
                                        },
                                        "speed": {
                                          "type": "number",
                                          "minimum": 0.7,
                                          "maximum": 1.2
                                        },
                                        "scale": {
                                          "type": "string",
                                          "maxLength": 4
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "modelId"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            }
                          ]
                        }
                      },
                      "edges": {
                        "maxItems": 60,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "source": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "target": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "sourceHandle": {
                              "type": "string",
                              "maxLength": 32
                            },
                            "targetHandle": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "source",
                            "target"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "groups": {
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "titleSize": {
                              "type": "string",
                              "enum": [
                                "small",
                                "medium",
                                "large"
                              ]
                            },
                            "nodeIds": {
                              "maxItems": 30,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                              }
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "title": {
                              "type": "string",
                              "maxLength": 60
                            },
                            "x": {
                              "type": "number"
                            },
                            "y": {
                              "type": "number"
                            },
                            "width": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "height": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "color": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "title",
                            "x",
                            "y",
                            "width",
                            "height"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "nodes",
                      "edges"
                    ]
                  },
                  "template_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "graph"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The run exists; `Location` names where its status will appear.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowRunCreatedDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The run to poll, as `/v1/workflows/runs/{id}`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "description": "Refused with `payment_required`, `insufficient_credits`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `moderation_blocked`, `access_denied`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `resource_conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`, `submit_unavailable`. Rate-limit headers are absent on `api_disabled`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/runs/{id}": {
      "get": {
        "operationId": "getWorkflowsRunsById",
        "summary": "Read one run",
        "description": "The run and every node in it, in the same shape a fresh poll or the initial submit answers with. Answers 202 while the run is still `RUNNING`, 200 once it has settled. A foreign or unknown id answers `not_found`.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:read"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The run id, as published in `workflow_id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The run has settled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowRunDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "description": "The run is still `RUNNING`; the body is the same shape.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowRunDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/runs/{id}/cancel": {
      "post": {
        "operationId": "postWorkflowsRunsByIdCancel",
        "summary": "Cancel a running chain",
        "description": "Stops every node that has not started yet; a node already dispatched keeps going and still delivers into the caller’s history. Nothing here moves credits — an unstarted node was never charged, so there is nothing to refund. Moves no money, so this route carries no paid gate. A run already settled answers `resource_conflict`; a foreign or unknown id answers `not_found`.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The run id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `resource_conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/templates": {
      "get": {
        "operationId": "getWorkflowsTemplates",
        "summary": "List the caller’s saved chains",
        "description": "The caller’s own active chains, newest-updated first, capped rather than paged — up to 50 may exist at once, so `next_cursor` is always null, the same envelope every capped collection in this API answers with. A closed canvas (role or the environment flag) answers `not_found` on every route under this prefix, indistinguishable from one that does not exist.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:read"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTemplateCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postWorkflowsTemplates",
        "summary": "Save a new chain",
        "description": "Stores a canvas document under a title. `canvas` is carried exactly as the studio’s editor produces it — its own field names are not converted, only the envelope around it is snake_case. A reference inside the graph (an uploaded image or audio file) the caller does not own is refused as `invalid_request`; the account’s 50-document ceiling, or an id already held in the trash, answers `resource_conflict`.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "canvas": {
                    "type": "object",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "resultSelection": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        },
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "generationId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "outputIndex": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 99
                            }
                          },
                          "required": [
                            "generationId",
                            "outputIndex"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "viewport": {
                        "type": "object",
                        "properties": {
                          "x": {
                            "type": "number"
                          },
                          "y": {
                            "type": "number"
                          },
                          "zoom": {
                            "type": "number",
                            "minimum": 0.2,
                            "maximum": 2
                          }
                        },
                        "required": [
                          "x",
                          "y",
                          "zoom"
                        ],
                        "additionalProperties": false
                      },
                      "runIds": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "bypassedNodeIds": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        }
                      },
                      "nodes": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "array"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "arrayText": {
                                      "type": "string",
                                      "maxLength": 100000
                                    },
                                    "separator": {
                                      "type": "string",
                                      "maxLength": 32
                                    },
                                    "keepEmpty": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-to-mask"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "image-to-mask"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "luminance",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "matte"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "matte"
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": -20,
                                          "maximum": 20
                                        },
                                        "feather": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 20
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "radius",
                                        "feather",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "merge-alpha"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "merge-alpha"
                                        },
                                        "mode": {
                                          "type": "string",
                                          "enum": [
                                            "replace",
                                            "multiply"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "mode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "mask-to-image"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "mask-to-image"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "note"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "noteText": {
                                      "type": "string",
                                      "maxLength": 2000
                                    },
                                    "noteColor": {
                                      "type": "string",
                                      "enum": [
                                        "yellow",
                                        "pink",
                                        "blue",
                                        "green"
                                      ]
                                    },
                                    "noteSize": {
                                      "type": "string",
                                      "enum": [
                                        "small",
                                        "medium",
                                        "large"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "number"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "number": {
                                      "type": "object",
                                      "properties": {
                                        "value": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "min": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "max": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "decimals": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 6
                                        }
                                      },
                                      "required": [
                                        "value",
                                        "min",
                                        "max",
                                        "decimals"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "boolean"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "booleanValue": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "to-text"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "convertFrom": {
                                      "type": "string",
                                      "enum": [
                                        "number",
                                        "boolean"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "levels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "levels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "rgb",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "inputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "inputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "gamma": {
                                          "type": "number",
                                          "minimum": 0.1,
                                          "maximum": 10
                                        },
                                        "outputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "outputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "inputBlack",
                                        "inputWhite",
                                        "gamma",
                                        "outputBlack",
                                        "outputWhite"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "channels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "channels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "rotate"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "rotate"
                                        },
                                        "angle": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "flipHorizontal": {
                                          "type": "boolean"
                                        },
                                        "flipVertical": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "angle",
                                        "flipHorizontal",
                                        "flipVertical"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "color"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "color"
                                        },
                                        "hue": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "saturation": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "brightness": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "contrast": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "hue",
                                        "saturation",
                                        "brightness",
                                        "contrast"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "blur"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "blur"
                                        },
                                        "method": {
                                          "type": "string",
                                          "enum": [
                                            "gaussian",
                                            "box"
                                          ]
                                        },
                                        "sigma": {
                                          "type": "number",
                                          "minimum": 0.3,
                                          "maximum": 100
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 10
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "method",
                                        "sigma",
                                        "radius"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "invert"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "invert"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "crop"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "crop"
                                        },
                                        "x": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "y": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "width": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "height": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "longestSide": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "x",
                                        "y",
                                        "width",
                                        "height",
                                        "longestSide"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "resize"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "resize"
                                        },
                                        "width": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        },
                                        "height": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "width",
                                        "height"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "output"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "preview"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "router"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "routeType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "text",
                                        "video",
                                        "audio",
                                        "text-list",
                                        "number",
                                        "boolean",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "compare"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "compareMode": {
                                      "type": "string",
                                      "enum": [
                                        "slider",
                                        "toggle"
                                      ]
                                    },
                                    "comparePosition": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 100
                                    },
                                    "compareSide": {
                                      "type": "string",
                                      "enum": [
                                        "a",
                                        "b"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    },
                                    "images": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "url": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 4096
                                          },
                                          "name": {
                                            "type": "string",
                                            "maxLength": 160
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "url"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-list"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "items": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "text": {
                                            "type": "string",
                                            "maxLength": 2000
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "text"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "list-selector"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "selectedItemId": {
                                      "type": "string",
                                      "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "prompt",
                                    "concatenate"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "variables": {
                                      "maxItems": 8,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^var[1-9]\\d{0,5}$"
                                          },
                                          "label": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 40
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "label"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "promptDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "source",
                                        "value",
                                        "both"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "audio-file"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "audioUrl": {
                                      "type": "string",
                                      "maxLength": 4096
                                    },
                                    "audioName": {
                                      "type": "string",
                                      "maxLength": 160
                                    },
                                    "durationSec": {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "character"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "referenceType": {
                                      "type": "string",
                                      "enum": [
                                        "mask",
                                        "audio",
                                        "video"
                                      ]
                                    },
                                    "imageUrl": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "imageUrl"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video",
                                    "music",
                                    "voice"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "params": {
                                      "type": "object",
                                      "properties": {
                                        "aspect": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "resolution": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "duration": {
                                          "type": "string",
                                          "maxLength": 8
                                        },
                                        "sound": {
                                          "type": "boolean"
                                        },
                                        "nVariants": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4
                                        },
                                        "negativePrompt": {
                                          "type": "string",
                                          "maxLength": 20000
                                        },
                                        "instrumental": {
                                          "type": "boolean"
                                        },
                                        "voiceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "voiceName": {
                                          "type": "string",
                                          "maxLength": 60
                                        },
                                        "speed": {
                                          "type": "number",
                                          "minimum": 0.7,
                                          "maximum": 1.2
                                        },
                                        "scale": {
                                          "type": "string",
                                          "maxLength": 4
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "modelId"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            }
                          ]
                        }
                      },
                      "edges": {
                        "maxItems": 60,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "source": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "target": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "sourceHandle": {
                              "type": "string",
                              "maxLength": 32
                            },
                            "targetHandle": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "source",
                            "target"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "groups": {
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "titleSize": {
                              "type": "string",
                              "enum": [
                                "small",
                                "medium",
                                "large"
                              ]
                            },
                            "nodeIds": {
                              "maxItems": 30,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                              }
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "title": {
                              "type": "string",
                              "maxLength": 60
                            },
                            "x": {
                              "type": "number"
                            },
                            "y": {
                              "type": "number"
                            },
                            "width": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "height": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "color": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "title",
                            "x",
                            "y",
                            "width",
                            "height"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "nodes",
                      "edges"
                    ]
                  }
                },
                "required": [
                  "title",
                  "canvas"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The chain was stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTemplateDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `resource_conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/templates/trash": {
      "delete": {
        "operationId": "deleteWorkflowsTemplatesTrash",
        "summary": "Permanently delete one trashed chain",
        "description": "Purges a chain already in the trash — its versions and prompt history are removed with it. Only a trashed id qualifies; an active chain’s id, like a foreign or unknown one, answers `not_found`.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getWorkflowsTemplatesTrash",
        "summary": "List the caller’s trashed chains",
        "description": "Chains archived rather than deleted, newest-deleted first. Pass `next_cursor` back as `cursor` unchanged; it is opaque and must not be parsed. `limit` defaults to 20 and caps at 100 — over the cap is refused, never clamped.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:read"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTrashCollectionDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_limit`, `invalid_cursor`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/templates/{id}": {
      "delete": {
        "operationId": "deleteWorkflowsTemplatesById",
        "summary": "Move one chain to the trash",
        "description": "A soft delete: the chain, its versions and its prompt history all stay recoverable through `POST /v1/workflows/templates/{id}/restore` until it is purged from the trash.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The chain id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getWorkflowsTemplatesById",
        "summary": "Read one chain",
        "description": "The stored canvas document in full. A foreign id answers `not_found` rather than a refusal that would confirm it exists.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:read"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The chain id, as published in `data[].id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTemplateDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchWorkflowsTemplatesById",
        "summary": "Update one chain",
        "description": "Renames it, replaces its canvas, or both. `expected_revision` is mandatory: it must match the chain’s current `revision`, or the write is refused as `revision_conflict` rather than silently overwriting a change made from another tab or device. A no-op write (nothing actually differs) still answers 200 without bumping the revision.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The chain id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483647
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "canvas": {
                    "type": "object",
                    "properties": {
                      "documentId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "resultSelection": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        },
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "generationId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100
                            },
                            "outputIndex": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 99
                            }
                          },
                          "required": [
                            "generationId",
                            "outputIndex"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "viewport": {
                        "type": "object",
                        "properties": {
                          "x": {
                            "type": "number"
                          },
                          "y": {
                            "type": "number"
                          },
                          "zoom": {
                            "type": "number",
                            "minimum": 0.2,
                            "maximum": 2
                          }
                        },
                        "required": [
                          "x",
                          "y",
                          "zoom"
                        ],
                        "additionalProperties": false
                      },
                      "runIds": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "bypassedNodeIds": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                        }
                      },
                      "nodes": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "array"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "arrayText": {
                                      "type": "string",
                                      "maxLength": 100000
                                    },
                                    "separator": {
                                      "type": "string",
                                      "maxLength": 32
                                    },
                                    "keepEmpty": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-to-mask"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "image-to-mask"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "luminance",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "matte"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "matte"
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": -20,
                                          "maximum": 20
                                        },
                                        "feather": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 20
                                        },
                                        "invert": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "radius",
                                        "feather",
                                        "invert"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "merge-alpha"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "merge-alpha"
                                        },
                                        "mode": {
                                          "type": "string",
                                          "enum": [
                                            "replace",
                                            "multiply"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "mode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "mask-to-image"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "mask-to-image"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "note"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "noteText": {
                                      "type": "string",
                                      "maxLength": 2000
                                    },
                                    "noteColor": {
                                      "type": "string",
                                      "enum": [
                                        "yellow",
                                        "pink",
                                        "blue",
                                        "green"
                                      ]
                                    },
                                    "noteSize": {
                                      "type": "string",
                                      "enum": [
                                        "small",
                                        "medium",
                                        "large"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "number"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "number": {
                                      "type": "object",
                                      "properties": {
                                        "value": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "min": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "max": {
                                          "type": "string",
                                          "maxLength": 32
                                        },
                                        "decimals": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 6
                                        }
                                      },
                                      "required": [
                                        "value",
                                        "min",
                                        "max",
                                        "decimals"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "boolean"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "booleanValue": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "to-text"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "convertFrom": {
                                      "type": "string",
                                      "enum": [
                                        "number",
                                        "boolean"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "levels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "levels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "rgb",
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        },
                                        "inputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "inputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "gamma": {
                                          "type": "number",
                                          "minimum": 0.1,
                                          "maximum": 10
                                        },
                                        "outputBlack": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        },
                                        "outputWhite": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 255
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel",
                                        "inputBlack",
                                        "inputWhite",
                                        "gamma",
                                        "outputBlack",
                                        "outputWhite"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "channels"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "channels"
                                        },
                                        "channel": {
                                          "type": "string",
                                          "enum": [
                                            "red",
                                            "green",
                                            "blue",
                                            "alpha"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "channel"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "rotate"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "rotate"
                                        },
                                        "angle": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "flipHorizontal": {
                                          "type": "boolean"
                                        },
                                        "flipVertical": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "angle",
                                        "flipHorizontal",
                                        "flipVertical"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "color"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "color"
                                        },
                                        "hue": {
                                          "type": "number",
                                          "minimum": -180,
                                          "maximum": 180
                                        },
                                        "saturation": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "brightness": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        },
                                        "contrast": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 3
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "hue",
                                        "saturation",
                                        "brightness",
                                        "contrast"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "blur"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "blur"
                                        },
                                        "method": {
                                          "type": "string",
                                          "enum": [
                                            "gaussian",
                                            "box"
                                          ]
                                        },
                                        "sigma": {
                                          "type": "number",
                                          "minimum": 0.3,
                                          "maximum": 100
                                        },
                                        "radius": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 10
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "method",
                                        "sigma",
                                        "radius"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "invert"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "invert"
                                        }
                                      },
                                      "required": [
                                        "operation"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "crop"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "crop"
                                        },
                                        "x": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "y": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 99.99
                                        },
                                        "width": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "height": {
                                          "type": "number",
                                          "exclusiveMinimum": 0,
                                          "maximum": 100
                                        },
                                        "longestSide": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "x",
                                        "y",
                                        "width",
                                        "height",
                                        "longestSide"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "resize"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "transform": {
                                      "type": "object",
                                      "properties": {
                                        "operation": {
                                          "type": "string",
                                          "const": "resize"
                                        },
                                        "width": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        },
                                        "height": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4096
                                        }
                                      },
                                      "required": [
                                        "operation",
                                        "width",
                                        "height"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "output"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "preview"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "previewType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "video",
                                        "audio",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "router"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "routeType": {
                                      "type": "string",
                                      "enum": [
                                        "image",
                                        "text",
                                        "video",
                                        "audio",
                                        "text-list",
                                        "number",
                                        "boolean",
                                        "mask"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "compare"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "compareMode": {
                                      "type": "string",
                                      "enum": [
                                        "slider",
                                        "toggle"
                                      ]
                                    },
                                    "comparePosition": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 100
                                    },
                                    "compareSide": {
                                      "type": "string",
                                      "enum": [
                                        "a",
                                        "b"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "image-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    },
                                    "images": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "url": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 4096
                                          },
                                          "name": {
                                            "type": "string",
                                            "maxLength": 160
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "url"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-iterator"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "zipGroup": {
                                      "type": "string",
                                      "enum": [
                                        "zip1",
                                        "zip2",
                                        "zip3",
                                        "zip4",
                                        "zip5",
                                        "zip6",
                                        "zip7",
                                        "zip8"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "text-list"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "items": {
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                          },
                                          "text": {
                                            "type": "string",
                                            "maxLength": 2000
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "text"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "list-selector"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "selectedItemId": {
                                      "type": "string",
                                      "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "prompt",
                                    "concatenate"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    },
                                    "variables": {
                                      "maxItems": 8,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "pattern": "^var[1-9]\\d{0,5}$"
                                          },
                                          "label": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 40
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "label"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "promptDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "source",
                                        "value",
                                        "both"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "audio-file"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "audioUrl": {
                                      "type": "string",
                                      "maxLength": 4096
                                    },
                                    "audioName": {
                                      "type": "string",
                                      "maxLength": 160
                                    },
                                    "durationSec": {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "character"
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "referenceType": {
                                      "type": "string",
                                      "enum": [
                                        "mask",
                                        "audio",
                                        "video"
                                      ]
                                    },
                                    "imageUrl": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "imageUrl"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video",
                                    "music",
                                    "voice"
                                  ]
                                },
                                "position": {
                                  "type": "object",
                                  "properties": {
                                    "x": {
                                      "type": "number"
                                    },
                                    "y": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "x",
                                    "y"
                                  ]
                                },
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "maxLength": 20000
                                    },
                                    "params": {
                                      "type": "object",
                                      "properties": {
                                        "aspect": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "resolution": {
                                          "type": "string",
                                          "maxLength": 16
                                        },
                                        "duration": {
                                          "type": "string",
                                          "maxLength": 8
                                        },
                                        "sound": {
                                          "type": "boolean"
                                        },
                                        "nVariants": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 4
                                        },
                                        "negativePrompt": {
                                          "type": "string",
                                          "maxLength": 20000
                                        },
                                        "instrumental": {
                                          "type": "boolean"
                                        },
                                        "voiceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "voiceName": {
                                          "type": "string",
                                          "maxLength": 60
                                        },
                                        "speed": {
                                          "type": "number",
                                          "minimum": 0.7,
                                          "maximum": 1.2
                                        },
                                        "scale": {
                                          "type": "string",
                                          "maxLength": 4
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "resultDisplay": {
                                      "type": "string",
                                      "enum": [
                                        "single",
                                        "all"
                                      ]
                                    },
                                    "label": {
                                      "type": "string",
                                      "maxLength": 80
                                    },
                                    "toolInputHidden": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "modelId"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "type",
                                "position",
                                "data"
                              ]
                            }
                          ]
                        }
                      },
                      "edges": {
                        "maxItems": 60,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "source": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "target": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "sourceHandle": {
                              "type": "string",
                              "maxLength": 32
                            },
                            "targetHandle": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "source",
                            "target"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "groups": {
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "titleSize": {
                              "type": "string",
                              "enum": [
                                "small",
                                "medium",
                                "large"
                              ]
                            },
                            "nodeIds": {
                              "maxItems": 30,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                              }
                            },
                            "id": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
                            },
                            "title": {
                              "type": "string",
                              "maxLength": 60
                            },
                            "x": {
                              "type": "number"
                            },
                            "y": {
                              "type": "number"
                            },
                            "width": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "height": {
                              "type": "number",
                              "minimum": 40,
                              "maximum": 8000
                            },
                            "color": {
                              "type": "string",
                              "maxLength": 32
                            }
                          },
                          "required": [
                            "id",
                            "title",
                            "x",
                            "y",
                            "width",
                            "height"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "nodes",
                      "edges"
                    ]
                  }
                },
                "required": [
                  "expected_revision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTemplatePatchDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `revision_conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/templates/{id}/prompt-history": {
      "get": {
        "operationId": "getWorkflowsTemplatesByIdPrompt-history",
        "summary": "Read one prompt node’s text history",
        "description": "Every distinct version a prompt node’s text (and its variable bindings) has gone through, newest first. `before` pages further back by revision; `next_before` is the value to send next, or null once the history is exhausted.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:read"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "node_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9_-]{1,32}$"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The chain id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowPromptHistoryPageDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Refused with `invalid_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Refused with `unreadable_record`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/templates/{id}/restore": {
      "post": {
        "operationId": "postWorkflowsTemplatesByIdRestore",
        "summary": "Restore one chain out of the trash",
        "description": "Undoes `DELETE /v1/workflows/templates/{id}`. Refused as `resource_conflict` when the account is already at its 50-active-chain ceiling — restore the chain after archiving another, or delete something permanently first.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:write"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:write"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The chain id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTemplateRestoreDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`, `origin_mismatch`. Rate-limit headers are absent on `origin_mismatch`, which is refused before the limiter runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Refused with `resource_conflict`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workflows/templates/{id}/versions": {
      "get": {
        "operationId": "getWorkflowsTemplatesByIdVersions",
        "summary": "List or read a chain’s saved revisions",
        "description": "Without `revision`: the lightweight list of every kept revision, newest first, capped at 50. With it: that one revision in full, canvas included. An id belonging to another account, or a revision this chain never had, both answer `not_found`.",
        "tags": [
          "workflows"
        ],
        "security": [
          {
            "apiKey": []
          },
          {
            "sessionCookie": []
          },
          {
            "oauth2": [
              "workflows:read"
            ]
          }
        ],
        "x-required-scope": [
          "workflows:read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Correlation id to carry through logs; generated when absent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The chain id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowTemplateVersionsResponseDto"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Refused with `unauthorized`, `invalid_api_key`, `api_key_expired`, `api_key_revoked`, `invalid_token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Refused with `api_access_not_granted`, `account_suspended`, `legal_consent_required`, `insufficient_scope`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Refused with `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "description": "Refused with `request_too_large`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Refused with `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying, on a refusal that names a window.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "description": "Refused with `internal_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "The window that bound this request, as `\"<policy>\";r=<n>;t=<s>`.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The quota and window of that policy, as `\"<policy>\";q=<n>;w=<s>`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Refused with `api_disabled`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id of this request, echoed back whether the caller supplied it or not.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key sent as `Authorization: Bearer <key>`. The operations published here ask for me:read, models:read, generations:read, generations:write, library:read, library:write, billing:read, support:read, support:write, uploads:write, workflows:read, workflows:write — a key may hold scopes beyond that set — and every scope an operation names in `x-required-scope` is required, not any of them."
      },
      "sessionCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "cm_session",
        "description": "The first-party session cookie, accepted as an alternative to the key and carrying the full scope set. Browser-only: CORS is closed to the key channel, and a mutating request on this one is refused unless its `Origin` is allowlisted."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "The authorization server at this issuer (RFC 8414 discovery under the same origin). PKCE (S256) is required for every client; a granted access token is scoped exactly like an API key.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.coremind.ru/oauth/authorize",
            "tokenUrl": "https://api.coremind.ru/oauth/token",
            "scopes": {
              "me:read": "Read the caller account: plan, credit balance, free quotas.",
              "models:read": "Read the model catalog, its prices and constraints.",
              "generations:read": "Read generations: list, a single one by id, batch status, and their output files, including those of workflow steps.",
              "generations:write": "Submit a generation, cancel it, or report a problem.",
              "library:read": "Read the library: uploaded assets and folders.",
              "library:write": "Organize the library: create, rename, reorder and delete folders, move items, rename uploads, and edit generation metadata (title, folder). Spends nothing.",
              "billing:read": "Read credit transactions and subscription status (never plan/credits, which live under me:read).",
              "support:read": "Read the caller's own support thread.",
              "support:write": "Send a message into the caller's own support thread.",
              "uploads:write": "Sign an upload of a reference asset into storage.",
              "workflows:read": "Read canvas documents, blocks and run status.",
              "workflows:write": "Create, edit and run canvas chains; a run spends credits."
            }
          }
        }
      }
    },
    "schemas": {
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "api_disabled",
                  "unauthorized",
                  "invalid_api_key",
                  "api_key_expired",
                  "api_key_revoked",
                  "invalid_token",
                  "api_access_not_granted",
                  "account_suspended",
                  "access_denied",
                  "legal_consent_required",
                  "origin_mismatch",
                  "insufficient_scope",
                  "payment_required",
                  "insufficient_credits",
                  "insufficient_text_credits",
                  "context_limit_exceeded",
                  "duplicate_submission",
                  "duplicate_key_conflict",
                  "moderation_blocked",
                  "submit_unavailable",
                  "upload_unavailable",
                  "estimate_unavailable",
                  "key_spend_limit_reached",
                  "grant_spend_limit_reached",
                  "generation_frozen",
                  "generation_in_flight",
                  "generation_already_settled",
                  "report_replay_mismatch",
                  "support_replay_mismatch",
                  "folder_limit_reached",
                  "folder_name_taken",
                  "not_found",
                  "unreadable_record",
                  "revision_conflict",
                  "resource_conflict",
                  "gone",
                  "plan_expired",
                  "renewal_already_on",
                  "no_active_plan",
                  "subscription_not_linked",
                  "card_token_missing",
                  "checkout_in_progress",
                  "subscription_superseded",
                  "subscription_recancelled",
                  "subscription_resume_failed",
                  "subscription_cancel_failed",
                  "subscription_cancel_unsaved",
                  "card_change_unavailable",
                  "card_check_not_authorized",
                  "card_change_in_progress",
                  "card_change_failed",
                  "rate_limited",
                  "too_many_streams",
                  "request_too_large",
                  "internal_error",
                  "service_unavailable",
                  "request_aborted",
                  "invalid_request",
                  "invalid_limit",
                  "invalid_cursor"
                ]
              },
              "message": {
                "type": "string"
              },
              "user_message": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApiErrorDetail"
                }
              }
            },
            "required": [
              "code",
              "message",
              "user_message",
              "request_id"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "ApiErrorDetail": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "wrong_type",
              "not_allowed",
              "bad_format",
              "out_of_range",
              "unknown_field",
              "duplicate",
              "invalid",
              "required",
              "in_use",
              "exceeded",
              "request_rate",
              "submit_rate",
              "concurrency",
              "queue_full",
              "not_available",
              "unknown_model",
              "unsupported_model",
              "unsupported_resolution",
              "unsupported_duration",
              "unsupported_aspect",
              "unsupported_quality",
              "unsupported_scale",
              "unsupported_n_variants",
              "transparency_not_supported",
              "prompt_too_long",
              "image_required",
              "too_many_images",
              "refused",
              "extend_not_found",
              "extend_unavailable",
              "draft_missing",
              "draft_not_found",
              "draft_wrong_model",
              "draft_not_ready",
              "draft_cache_missing",
              "draft_expired",
              "draft_facts_missing",
              "untrusted_reference",
              "invalid_graph",
              "insufficient_credits",
              "foreign_reference",
              "reference_unavailable",
              "unfetchable_reference"
            ]
          },
          "message": {
            "type": "string"
          },
          "port_id": {
            "type": "string"
          },
          "user_message": {
            "type": "string"
          },
          "required_cc": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "balance_cc": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "suggested_topup_cc": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "confirm_token": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "limit": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "current": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "retry_after_seconds": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "field",
          "reason",
          "message"
        ],
        "additionalProperties": false
      },
      "BillingSubscriptionDto": {
        "type": "object",
        "properties": {
          "subscription": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SubscriptionDto"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "subscription"
        ],
        "additionalProperties": false
      },
      "CardChangeBeginDto": {
        "type": "object",
        "properties": {
          "payment_id": {
            "type": "string",
            "description": "The 1 RUB card-check payment; it is the widget `invoiceId`."
          },
          "public_id": {
            "type": "string",
            "description": "The payment terminal public id."
          },
          "account_id": {
            "type": "string",
            "description": "The widget `accountId`: the caller."
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "amount": {
            "type": "number",
            "description": "Always 1: the check is authorized, never charged."
          },
          "currency": {
            "type": "string",
            "const": "RUB"
          }
        },
        "required": [
          "payment_id",
          "public_id",
          "account_id",
          "email",
          "amount",
          "currency"
        ],
        "additionalProperties": false
      },
      "CardChangeCompleteDto": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "card": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "last4": {
                    "type": "string"
                  },
                  "brand": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "bank": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "last4",
                  "brand",
                  "bank"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "The card the subscription renews on from now."
          },
          "next_pay_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "charge": {
            "type": "string",
            "enum": [
              "none",
              "completed",
              "declined",
              "unknown"
            ],
            "description": "Whether an overdue period was charged on the new card: `none` when nothing was due."
          },
          "resumed": {
            "type": "boolean",
            "description": "True when renewal was off: the new card also turned it back on, charging from `next_pay_date`."
          }
        },
        "required": [
          "ok",
          "card",
          "next_pay_date",
          "charge",
          "resumed"
        ],
        "additionalProperties": false
      },
      "CreditTransactionCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditTransactionDto"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "CreditTransactionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "purchase",
              "spend",
              "refund",
              "adjustment",
              "referral_exchange",
              "team_transfer"
            ],
            "description": "The transaction kind, lowercased from the stored enum."
          },
          "amount_cc": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Signed centi-credits: positive credits the balance, negative debits it."
          },
          "created_at": {
            "type": "string"
          },
          "generation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The id `GET /v1/generations/{id}` accepts, or null for a row with no link — including history written before the link existed."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "plan_expired_frozen",
                  "plan_lost_frozen",
                  "credits_unfrozen",
                  "plan_refund_revoked",
                  "text_balance_move",
                  "upgrade_clawback",
                  "chat_estimate_hold",
                  "chat_overflow_charge",
                  "chat_overage_settled",
                  "chat_compress_hold",
                  "chat_compress_settled",
                  "chat_compress_refund",
                  "team_transfer_in",
                  "team_transfer_out",
                  "recurring_payment"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "A closed machine vocabulary derived from the internal ledger meta; null when none applies."
          }
        },
        "required": [
          "id",
          "type",
          "amount_cc",
          "created_at",
          "generation_id",
          "reason"
        ],
        "additionalProperties": false
      },
      "EventStreamResetDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "enum": [
              "cursor_expired",
              "cursor_unknown"
            ]
          },
          "catch_up": {
            "type": "string",
            "const": "/v1/generations/status"
          }
        },
        "required": [
          "reason",
          "catch_up"
        ],
        "additionalProperties": false,
        "description": "The presented Last-Event-ID cannot be resumed: it is past the retention window (cursor_expired) or is not a cursor of this stream (cursor_unknown). The stream continues live after this frame; catch up on the transitions in between with the batch status endpoint named in catch_up."
      },
      "FailureReason": {
        "type": "string",
        "enum": [
          "provider_error",
          "moderation_block",
          "timeout",
          "no_content",
          "invalid_input",
          "unknown"
        ]
      },
      "FreeQuotaConfigDto": {
        "type": "object",
        "properties": {
          "resolution": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "duration": {
            "type": "number"
          },
          "duration_max": {
            "type": "number"
          },
          "sound": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "FreeQuotaDto": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "counted",
              "timed",
              "unlimited"
            ]
          },
          "limit": {
            "type": "number"
          },
          "used": {
            "type": "number"
          },
          "remaining": {
            "type": "number"
          },
          "unlimited_expires_at": {
            "type": "string"
          },
          "daily_cap": {
            "type": "number"
          },
          "daily_used": {
            "type": "number"
          },
          "fallback_model": {
            "type": "string"
          },
          "free_config": {
            "$ref": "#/components/schemas/FreeQuotaConfigDto"
          }
        },
        "required": [
          "model",
          "type",
          "mode"
        ],
        "additionalProperties": false
      },
      "GenerationCancelDto": {
        "type": "object",
        "properties": {
          "refunded": {
            "type": "boolean"
          }
        },
        "required": [
          "refunded"
        ],
        "additionalProperties": false
      },
      "GenerationCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenerationDto"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "GenerationDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/GenerationStatus"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "style": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "input_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_cc": {
            "type": "number"
          },
          "refunded": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "output_urls": {
            "$ref": "#/components/schemas/NormalizedOutput"
          },
          "error": {
            "$ref": "#/components/schemas/GenerationErrorDto"
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "model_id",
          "title",
          "prompt",
          "style",
          "input_text",
          "folder_id",
          "cost_cc",
          "refunded",
          "created_at",
          "updated_at",
          "completed_at",
          "output_urls"
        ],
        "additionalProperties": false
      },
      "GenerationErrorDto": {
        "type": "object",
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/FailureReason"
          },
          "message": {
            "type": "string"
          },
          "user_message": {
            "type": "string"
          }
        },
        "required": [
          "reason",
          "message",
          "user_message"
        ],
        "additionalProperties": false
      },
      "GenerationEventDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The generation id."
          },
          "type": {
            "type": "string",
            "description": "The generation type, the same value GET /v1/generations/{id} returns."
          },
          "status": {
            "$ref": "#/components/schemas/GenerationStatus"
          },
          "deleted": {
            "type": "boolean",
            "description": "True once the generation is withdrawn. A cancelled generation arrives as status FAILED with deleted true."
          },
          "updated_at": {
            "type": "string",
            "description": "When this transition was recorded, ISO 8601."
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "deleted",
          "updated_at"
        ],
        "additionalProperties": false,
        "description": "One status transition. Re-read the full record via GET /v1/generations/{id} or POST /v1/generations/status."
      },
      "GenerationReportDto": {
        "type": "object",
        "properties": {
          "support_request_id": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          }
        },
        "required": [
          "support_request_id",
          "message_id"
        ],
        "additionalProperties": false
      },
      "GenerationStatus": {
        "type": "string",
        "enum": [
          "QUEUED",
          "PENDING",
          "RUNNING",
          "MODERATION_PENDING",
          "DONE",
          "FAILED"
        ],
        "description": "DONE is the only status that never changes again. FAILED ends the attempt, not the record: a late provider answer can recover such a generation into DONE, so a caller that still wants the result re-reads the row later instead of polling on."
      },
      "GenerationStatusCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenerationDto"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "KnowledgeArticleDto": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "ru"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "article",
              "guide"
            ]
          },
          "body": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "valid_until": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "slug",
          "title",
          "summary",
          "lang",
          "source",
          "body",
          "updated_at",
          "valid_until"
        ],
        "additionalProperties": false
      },
      "KnowledgeCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KnowledgeHitDto"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "KnowledgeHitDto": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lang": {
            "type": "string",
            "enum": [
              "en",
              "ru"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "article",
              "guide"
            ]
          }
        },
        "required": [
          "slug",
          "title",
          "summary",
          "lang",
          "source"
        ],
        "additionalProperties": false
      },
      "LibraryAssetCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryAssetDto"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "LibraryAssetDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "width": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "height": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_sec": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "folder_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "output_urls": {
            "type": "object",
            "properties": {
              "image": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "video": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "audio": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "download": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "kind",
          "title",
          "width",
          "height",
          "duration_sec",
          "folder_id",
          "created_at",
          "expires_at",
          "output_urls"
        ],
        "additionalProperties": false
      },
      "LibraryFolderCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryFolderDto"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "LibraryFolderDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "number"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "position",
          "created_at"
        ],
        "additionalProperties": false
      },
      "LibraryFolderWriteDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "number"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false
      },
      "LibraryMoveDto": {
        "type": "object",
        "properties": {
          "moved": {
            "type": "number"
          }
        },
        "required": [
          "moved"
        ],
        "additionalProperties": false
      },
      "LibraryRenameDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "title"
        ],
        "additionalProperties": false
      },
      "MeCreditsDto": {
        "type": "object",
        "properties": {
          "main_cc": {
            "type": "number"
          },
          "frozen_cc": {
            "type": "number"
          },
          "text_cc": {
            "type": "number"
          }
        },
        "required": [
          "main_cc",
          "frozen_cc",
          "text_cc"
        ],
        "additionalProperties": false
      },
      "MeDto": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string"
          },
          "plan": {
            "$ref": "#/components/schemas/MePlanDto"
          },
          "credits": {
            "$ref": "#/components/schemas/MeCreditsDto"
          },
          "free_quotas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FreeQuotaDto"
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "requests": {
                "type": "object",
                "properties": {
                  "per_credential": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "per_account": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "window_seconds": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "per_credential",
                  "per_account",
                  "window_seconds"
                ],
                "additionalProperties": false
              },
              "submissions": {
                "type": "object",
                "properties": {
                  "api": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "studio": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "window_seconds": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "api",
                  "studio",
                  "window_seconds"
                ],
                "additionalProperties": false
              },
              "concurrency": {
                "type": "object",
                "properties": {
                  "image": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "video": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "kling": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "veo": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "image",
                  "video",
                  "kling",
                  "veo"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "requests",
              "submissions",
              "concurrency"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "user_id",
          "plan",
          "credits",
          "free_quotas",
          "limits"
        ],
        "additionalProperties": false
      },
      "MePlanDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "ends_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "cancel_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "started_at",
          "ends_at",
          "cancel_at"
        ],
        "additionalProperties": false
      },
      "MediaContent": {
        "type": "string",
        "format": "binary",
        "contentEncoding": "binary"
      },
      "ModelCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelDto"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ModelConstraints": {
        "type": "object",
        "properties": {
          "image_input": {
            "type": "string",
            "enum": [
              "none",
              "optional",
              "required"
            ]
          },
          "min_reference_images": {
            "type": "number"
          },
          "max_reference_images": {
            "type": "number"
          },
          "requires_prompt": {
            "type": "boolean"
          },
          "requires_video": {
            "type": "boolean"
          },
          "requires_audio": {
            "type": "boolean"
          },
          "accepts_video_ref": {
            "type": "boolean"
          },
          "video_ref_satisfies_image": {
            "type": "boolean"
          },
          "creator_only": {
            "type": "boolean"
          },
          "aspect_ratios": {
            "description": "The values the request field `aspect` accepts.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "resolutions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "durations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "default_duration": {
            "type": "number"
          },
          "duration_from_source": {
            "type": "boolean"
          },
          "duration_min": {
            "type": "number"
          },
          "duration_max": {
            "type": "number"
          },
          "fixed_duration": {
            "type": "string"
          },
          "resolution_durations": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "default_resolution": {
            "type": "string"
          },
          "resolution_param": {
            "type": "string"
          },
          "resolution_values": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "has_sound": {
            "type": "boolean"
          },
          "sound_from_source": {
            "type": "boolean"
          },
          "default_sound": {
            "type": "boolean"
          },
          "max_video_refs": {
            "type": "number"
          },
          "max_audio_refs": {
            "type": "number"
          },
          "voices": {
            "description": "The values the request field `referenceAudio` accepts.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "max_voices": {
            "description": "How many entries `referenceAudio` takes; a voice-tagging model binds them to `@voice1`… in order.",
            "type": "number"
          },
          "max_references_total": {
            "description": "Reference images, clips and voices together: refused past this even when each kind is inside its own cap.",
            "type": "number"
          },
          "audio_min_sec": {
            "type": "number"
          },
          "audio_max_sec": {
            "type": "number"
          },
          "ref_video_min_sec": {
            "type": "number"
          },
          "ref_video_max_sec": {
            "type": "number"
          },
          "ref_video_total_max_sec": {
            "type": "number"
          },
          "ref_video_min_dimension": {
            "type": "number"
          },
          "ref_video_min_frames": {
            "type": "number"
          },
          "ref_video_max_bytes": {
            "type": "number"
          },
          "ref_audio_total_max_sec": {
            "type": "number"
          },
          "ref_task_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ref_video_min_sec_by_task": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "number"
            }
          },
          "multi_shot": {
            "$ref": "#/components/schemas/MultiShotConstraint"
          },
          "prompt_expansion_modes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "default_prompt_expansion": {
            "type": "string"
          },
          "has_seed": {
            "type": "boolean"
          },
          "has_negative_prompt": {
            "type": "boolean"
          },
          "negative_prompt_limit": {
            "type": "number"
          },
          "has_variants": {
            "type": "boolean"
          },
          "max_variants": {
            "type": "number"
          },
          "max_style_refs": {
            "type": "number"
          },
          "max_char_refs": {
            "type": "number"
          },
          "prompt_limit": {
            "type": "number"
          },
          "image_ref_mention_limit": {
            "type": "number"
          },
          "prompt_param": {
            "type": "string"
          },
          "prompt_min": {
            "type": "number"
          },
          "transparent_background": {
            "type": "boolean"
          },
          "fixed_quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "qualities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "default_quality": {
            "type": "string"
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "generate_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "materials": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mesh_modes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "input_kind": {
            "type": "string",
            "enum": [
              "portrait",
              "video"
            ]
          },
          "fixed_durations": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "scales": {
            "description": "The values the request field `scale` accepts.",
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "source_kind": {
            "description": "The medium an upscaler's source must be. It rides in `source_param`, not among the references.",
            "type": "string",
            "enum": [
              "image",
              "video"
            ]
          },
          "source_param": {
            "description": "The request field an upscaler's source is read from.",
            "type": "string",
            "const": "image_url"
          },
          "source_max_width": {
            "description": "The widest source frame accepted, in pixels.",
            "type": "number"
          },
          "source_max_height": {
            "description": "The tallest source frame accepted, in pixels.",
            "type": "number"
          },
          "source_max_sec": {
            "description": "The longest source clip accepted, in seconds.",
            "type": "number"
          }
        },
        "required": [
          "image_input",
          "min_reference_images",
          "requires_prompt",
          "requires_video",
          "requires_audio",
          "accepts_video_ref",
          "creator_only"
        ],
        "additionalProperties": false
      },
      "ModelDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "submit_type": {
            "type": "string"
          },
          "constraints": {
            "$ref": "#/components/schemas/ModelConstraints"
          },
          "pricing": {
            "$ref": "#/components/schemas/ModelPricingDto"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "submit_type",
          "constraints",
          "pricing"
        ],
        "additionalProperties": false
      },
      "ModelPricingDto": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "const": "credits"
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceVariantDto"
            }
          },
          "quote": {
            "description": "Present when the charge is measured from the source rather than read off a rate — an upscaler bills the output size and length the server measures. `variants` is then empty, and `POST /v1/pricing/estimate` with the full request is the price.",
            "type": "string",
            "const": "estimate"
          },
          "surcharges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceSurchargeDto"
            }
          },
          "minimum_cc": {
            "type": "number"
          },
          "free_lead_seconds": {
            "type": "number"
          },
          "amount_rounding": {
            "type": "string",
            "const": "ceil_cc"
          },
          "variant_selection": {
            "type": "string",
            "const": "ceil_to_variant"
          },
          "discount_pct": {
            "type": "number"
          }
        },
        "required": [
          "currency",
          "variants",
          "surcharges",
          "amount_rounding"
        ],
        "additionalProperties": false
      },
      "MultiShotConstraint": {
        "type": "object",
        "properties": {
          "transport": {
            "type": "string",
            "enum": [
              "api",
              "prompt-timecodes"
            ]
          },
          "total_min_sec": {
            "type": "number"
          },
          "total_max_sec": {
            "type": "number"
          },
          "max_shots": {
            "type": "number"
          },
          "shot_prompt_limit": {
            "type": "number"
          },
          "silent": {
            "type": "boolean"
          },
          "text_only": {
            "type": "boolean"
          }
        },
        "required": [
          "transport",
          "total_min_sec",
          "total_max_sec",
          "max_shots",
          "shot_prompt_limit"
        ],
        "additionalProperties": false
      },
      "NormalizedOutput": {
        "type": "object",
        "properties": {
          "audio": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "download": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "wav": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "image": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "video": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "model3d": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "original": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "OAuthInteractionDetailsDto": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "enum": [
              "login",
              "consent"
            ]
          },
          "client": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "host": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "host"
            ],
            "additionalProperties": false
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "monthly_spend_limit": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "prompt",
          "client",
          "scopes",
          "monthly_spend_limit"
        ],
        "additionalProperties": false
      },
      "OAuthInteractionRedirectDto": {
        "type": "object",
        "properties": {
          "redirect_to": {
            "type": "string"
          }
        },
        "required": [
          "redirect_to"
        ],
        "additionalProperties": false
      },
      "OkDto": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": false
      },
      "PriceSurchargeDto": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "variant": {
            "type": "string"
          },
          "price_cc": {
            "type": "number"
          },
          "unit": {
            "$ref": "#/components/schemas/PriceUnit"
          },
          "rounding": {
            "type": "string",
            "enum": [
              "ceil_per_item",
              "ceil_total"
            ]
          },
          "free_units": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "kind",
          "variant",
          "price_cc",
          "unit"
        ],
        "additionalProperties": false
      },
      "PriceUnit": {
        "type": "string",
        "enum": [
          "per_second",
          "per_video",
          "per_image",
          "per_generation",
          "per_1000_characters",
          "per_reference_second",
          "per_reference_image"
        ]
      },
      "PriceVariantDto": {
        "type": "object",
        "properties": {
          "variant": {
            "type": "string"
          },
          "price_cc": {
            "type": "number"
          },
          "unit": {
            "$ref": "#/components/schemas/PriceUnit"
          }
        },
        "required": [
          "variant",
          "price_cc",
          "unit"
        ],
        "additionalProperties": false
      },
      "PricingEstimateBreakdownDto": {
        "type": "object",
        "properties": {
          "variant": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "units": {
            "type": "number"
          },
          "surcharge_cc": {
            "type": "number"
          }
        },
        "required": [
          "variant",
          "units",
          "surcharge_cc"
        ],
        "additionalProperties": false
      },
      "PricingEstimateDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "video",
              "image",
              "upscale",
              "3d",
              "card-design",
              "lipsync",
              "omnihuman",
              "avatar",
              "voice",
              "music",
              "music-cover",
              "music-vocals",
              "music-instrumental",
              "music-stems",
              "song",
              "lyrics"
            ]
          },
          "model_id": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "const": "credits"
          },
          "price_cc": {
            "type": "number"
          },
          "breakdown": {
            "$ref": "#/components/schemas/PricingEstimateBreakdownDto"
          }
        },
        "required": [
          "type",
          "model_id",
          "currency",
          "price_cc",
          "breakdown"
        ],
        "additionalProperties": false
      },
      "SubscriptionCancelDto": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "superseded": {
            "type": "boolean",
            "description": "True when a newer subscription already renews the plan, so nothing is ending."
          },
          "plan_ends_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The end of the paid period the plan now runs out at, ISO 8601."
          }
        },
        "required": [
          "ok",
          "superseded",
          "plan_ends_at"
        ],
        "additionalProperties": false
      },
      "SubscriptionDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "active",
              "past_due"
            ]
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "recurrent_amount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "next_payment_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "cancelled_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "status",
          "amount",
          "recurrent_amount",
          "currency",
          "next_payment_at",
          "cancelled_at"
        ],
        "additionalProperties": false,
        "description": "Amounts are whole units of `currency`, not centi-credits."
      },
      "SubscriptionResumeDto": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "next_pay_date": {
            "type": "string",
            "description": "When the renewed subscription charges next, ISO 8601."
          }
        },
        "required": [
          "ok",
          "next_pay_date"
        ],
        "additionalProperties": false
      },
      "SupportMessageCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupportMessageDto"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "SupportMessageDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "enum": [
              "user",
              "support"
            ]
          },
          "text": {
            "type": "string",
            "description": "As authored by the user or by support staff, never translated or rewritten."
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "from",
          "text",
          "images",
          "created_at"
        ],
        "additionalProperties": false
      },
      "SupportMessageSentDto": {
        "type": "object",
        "properties": {
          "support_request_id": {
            "type": "string"
          },
          "message": {
            "$ref": "#/components/schemas/SupportMessageDto"
          }
        },
        "required": [
          "support_request_id",
          "message"
        ],
        "additionalProperties": false
      },
      "UploadStoredDto": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string"
          },
          "bytes_stored": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "reference",
          "bytes_stored"
        ],
        "additionalProperties": false
      },
      "UploadTicketDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "headers": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "For the direct `PUT` to `url`: send every entry back verbatim — `Content-Type`, `Content-Length` and `If-None-Match`, all bound by the signature, so composing your own set or dropping one is a 403 from the store. The `proxy_path` completion does not take this map; it reads `Content-Type` and `Content-Length` and needs your `Authorization`."
          },
          "reference": {
            "type": "string"
          },
          "proxy_path": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "headers",
          "reference",
          "proxy_path",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "WhoamiDto": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "channel": {
            "type": "string",
            "enum": [
              "session",
              "api_key",
              "oauth"
            ]
          },
          "key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The API key or OAuth grant that authenticated the call; null on the session channel — read `channel` to tell which."
          },
          "scopes": {
            "readOnly": true,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "me:read",
                "models:read",
                "generations:read",
                "generations:write",
                "library:read",
                "library:write",
                "billing:read",
                "support:read",
                "support:write",
                "uploads:write",
                "workflows:read",
                "workflows:write"
              ]
            }
          },
          "may_spend": {
            "type": "boolean",
            "description": "Whether this caller may start generations right now. False when the account holds no active paid plan: every new generation is then refused with payment_required, free quotas and promo modes included, while an exact retry of an Idempotency-Key already answered still returns its stored response. Always true on the session channel and for staff."
          },
          "spend_limit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WhoamiSpendLimitDto"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "user_id",
          "role",
          "channel",
          "key_id",
          "scopes",
          "may_spend",
          "spend_limit"
        ],
        "additionalProperties": false
      },
      "WhoamiSpendLimitDto": {
        "type": "object",
        "properties": {
          "monthly_limit_cc": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "spent_cc": {
            "type": "number"
          },
          "remaining_cc": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "resets_at": {
            "type": "string"
          }
        },
        "required": [
          "monthly_limit_cc",
          "spent_cc",
          "remaining_cc",
          "resets_at"
        ],
        "additionalProperties": false
      },
      "WorkflowBlockCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowBlockSummaryDto"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WorkflowBlockDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "canvas": {
            "description": "The canvas document exactly as stored — its own field names are the studio’s camelCase, never converted."
          },
          "revision": {
            "type": "number"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "canvas",
          "revision",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "WorkflowBlockGetDto": {
        "type": "object",
        "properties": {
          "block": {
            "$ref": "#/components/schemas/WorkflowBlockDto"
          },
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowBlockVersionEntryDto"
            }
          }
        },
        "required": [
          "block"
        ],
        "additionalProperties": false
      },
      "WorkflowBlockMutationDto": {
        "type": "object",
        "properties": {
          "block": {
            "$ref": "#/components/schemas/WorkflowBlockDto"
          }
        },
        "required": [
          "block"
        ],
        "additionalProperties": false
      },
      "WorkflowBlockSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "revision": {
            "type": "number"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "revision",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "WorkflowBlockVersionEntryDto": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "number"
          },
          "title": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "revision",
          "title",
          "created_at"
        ],
        "additionalProperties": false
      },
      "WorkflowCompileErrorDto": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "node_id": {
            "type": "string"
          },
          "port_id": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": false
      },
      "WorkflowEstimateDto": {
        "type": "object",
        "properties": {
          "per_node": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "number"
            }
          },
          "item_counts": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "number"
            }
          },
          "total": {
            "type": "number"
          },
          "price_basis": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string",
              "enum": [
                "second",
                "from"
              ]
            }
          }
        },
        "required": [
          "per_node",
          "item_counts",
          "total"
        ],
        "additionalProperties": false
      },
      "WorkflowPromptHistoryEntryDto": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "number"
          },
          "created_at": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "label"
              ],
              "additionalProperties": false
            }
          },
          "bindings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string"
                },
                "source_handle": {
                  "type": "string"
                },
                "target_handle": {
                  "type": "string"
                }
              },
              "required": [
                "source"
              ],
              "additionalProperties": false
            }
          },
          "resolved": {
            "type": "string"
          },
          "resolution_error": {
            "type": "string"
          }
        },
        "required": [
          "revision",
          "created_at",
          "prompt",
          "variables",
          "bindings"
        ],
        "additionalProperties": false
      },
      "WorkflowPromptHistoryPageDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowPromptHistoryEntryDto"
            }
          },
          "next_before": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_before"
        ],
        "additionalProperties": false
      },
      "WorkflowRetryItemResponseDto": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/WorkflowRetryPreviewDto"
          },
          {
            "$ref": "#/components/schemas/WorkflowRetryRunDto"
          }
        ]
      },
      "WorkflowRetryPreviewDto": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "preview"
          },
          "total": {
            "type": "number"
          },
          "steps": {
            "type": "number"
          },
          "node_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "input_kind": {
            "type": "string",
            "enum": [
              "parameters",
              "prompt"
            ]
          },
          "prompt": {
            "type": "string"
          },
          "item_index": {
            "type": "number"
          }
        },
        "required": [
          "kind",
          "total",
          "steps",
          "node_ids",
          "input_kind",
          "prompt",
          "item_index"
        ],
        "additionalProperties": false
      },
      "WorkflowRetryRunDto": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "run"
          },
          "workflow_id": {
            "type": "string"
          },
          "total_cost": {
            "type": "number"
          }
        },
        "required": [
          "kind",
          "workflow_id",
          "total_cost"
        ],
        "additionalProperties": false
      },
      "WorkflowRunCanvasItemDto": {
        "type": "object",
        "properties": {
          "node_id": {
            "type": "string"
          },
          "iterator_id": {
            "type": "string"
          },
          "item_id": {
            "type": "string"
          },
          "item_index": {
            "type": "number"
          },
          "item_count": {
            "type": "number"
          }
        },
        "required": [
          "node_id",
          "iterator_id",
          "item_id",
          "item_index",
          "item_count"
        ],
        "additionalProperties": false
      },
      "WorkflowRunCreatedDto": {
        "type": "object",
        "properties": {
          "workflow_id": {
            "type": "string"
          },
          "total_cost": {
            "type": "number"
          }
        },
        "required": [
          "workflow_id",
          "total_cost"
        ],
        "additionalProperties": false
      },
      "WorkflowRunDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "client_request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipe_id": {
            "type": "string"
          },
          "retry_of": {
            "type": "object",
            "properties": {
              "workflow_id": {
                "type": "string"
              },
              "node_key": {
                "type": "string"
              }
            },
            "required": [
              "workflow_id",
              "node_key"
            ],
            "additionalProperties": false
          },
          "status": {
            "type": "string"
          },
          "total_cost_estimate": {
            "type": "number"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowRunNodeDto"
            }
          }
        },
        "required": [
          "id",
          "client_request_id",
          "recipe_id",
          "status",
          "total_cost_estimate",
          "error",
          "created_at",
          "nodes"
        ],
        "additionalProperties": false
      },
      "WorkflowRunListDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowRunDto"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WorkflowRunNodeDto": {
        "type": "object",
        "properties": {
          "node_key": {
            "type": "string"
          },
          "canvas_item": {
            "$ref": "#/components/schemas/WorkflowRunCanvasItemDto"
          },
          "kind": {
            "type": "string"
          },
          "model_label": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "generation_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "generation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "parameters": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "created_at": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "frozen": {
            "type": "boolean"
          },
          "wait": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "const": "model-cap"
              },
              "limit": {
                "type": "number"
              }
            },
            "required": [
              "reason",
              "limit"
            ],
            "additionalProperties": false
          },
          "cost_credits": {
            "type": "number"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "output_urls": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "audio": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "download": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "wav": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "image": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "video": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "model3d": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "original": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "node_key",
          "kind",
          "model_label",
          "status",
          "generation_status",
          "generation_id",
          "parameters",
          "created_at",
          "prompt",
          "frozen",
          "cost_credits",
          "error",
          "output_urls"
        ],
        "additionalProperties": false
      },
      "WorkflowTemplateCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowTemplateSummaryDto"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WorkflowTemplateDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "canvas": {
            "description": "The canvas document exactly as stored — its own field names are the studio’s camelCase, never converted."
          },
          "revision": {
            "type": "number"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "canvas",
          "revision",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "WorkflowTemplatePatchDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "revision": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "title",
          "revision"
        ],
        "additionalProperties": false
      },
      "WorkflowTemplateRestoreDto": {
        "type": "object",
        "properties": {
          "template": {
            "$ref": "#/components/schemas/WorkflowTemplateDto"
          }
        },
        "required": [
          "template"
        ],
        "additionalProperties": false
      },
      "WorkflowTemplateSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "node_count": {
            "type": "number"
          },
          "counts": {
            "type": "object",
            "properties": {
              "character": {
                "type": "number"
              },
              "image": {
                "type": "number"
              },
              "video": {
                "type": "number"
              },
              "audio": {
                "type": "number"
              }
            },
            "required": [
              "character",
              "image",
              "video",
              "audio"
            ],
            "additionalProperties": false
          },
          "sketch": {
            "type": "object",
            "properties": {
              "nodes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "image",
                        "video",
                        "text",
                        "sound",
                        "tool"
                      ]
                    },
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    },
                    "w": {
                      "type": "number"
                    },
                    "h": {
                      "type": "number"
                    },
                    "image": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "kind",
                    "x",
                    "y",
                    "w",
                    "h"
                  ],
                  "additionalProperties": false
                }
              },
              "edges": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "from",
                    "to"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "nodes",
              "edges"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "title",
          "updated_at",
          "node_count",
          "counts",
          "sketch"
        ],
        "additionalProperties": false
      },
      "WorkflowTemplateVersionCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowTemplateVersionEntryDto"
            }
          },
          "next_cursor": {
            "type": "null"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WorkflowTemplateVersionDto": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "number"
          },
          "title": {
            "type": "string"
          },
          "canvas": {
            "description": "The canvas document exactly as stored — its own field names are the studio’s camelCase, never converted."
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "revision",
          "title",
          "canvas",
          "created_at"
        ],
        "additionalProperties": false
      },
      "WorkflowTemplateVersionEntryDto": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "number"
          },
          "title": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "revision",
          "title",
          "created_at"
        ],
        "additionalProperties": false
      },
      "WorkflowTemplateVersionsResponseDto": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/WorkflowTemplateVersionCollectionDto"
          },
          {
            "$ref": "#/components/schemas/WorkflowTemplateVersionDto"
          }
        ]
      },
      "WorkflowTrashCollectionDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowTrashEntryDto"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WorkflowTrashEntryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "deleted_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "deleted_at"
        ],
        "additionalProperties": false
      }
    }
  }
}
