{
  "openapi": "3.1.0",
  "info": {
    "title": "Smolny Provider API",
    "version": "1.2.0",
    "description": "Project-scoped Incus virtual machines, Firecracker microVMs and durable workspaces through the Smolny HTTPS edge. An agent key must hold every scope listed in x-smolny-scopes, plus scopes required by any supplied options. Project features and limits still apply. Use GET /v1/permissions for the active credential. API versioning uses the /v1 path prefix; breaking changes will be introduced under a new major path version. Deprecated endpoints announce retirement via standard Deprecation and Sunset HTTP response headers with at least a 90-day notice window before removal."
  },
  "servers": [
    {
      "url": "https://api.smolny.tech",
      "description": "Public Smolny API"
    },
    {
      "url": "/",
      "description": "Current deployment"
    },
    {
      "url": "https://smolny.tech/sandbox/",
      "description": "Self-serve Sandbox & Test Environment (2,000 RUB free starter credit via Agent Sign-up)"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/healthz": {
      "get": {
        "operationId": "getHealth",
        "summary": "Check the API process",
        "security": [],
        "responses": {
          "200": {
            "description": "API process is serving requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "const": "ok"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getAgentQuickstart",
        "summary": "Read the public starter instructions for an agent",
        "security": [],
        "responses": {
          "200": {
            "description": "Agent instructions and OpenAPI link",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApi",
        "summary": "Read the OpenAPI contract",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/dashboard/api/auth/yandex": {
      "get": {
        "operationId": "getYandexBrowserSignIn",
        "summary": "Check availability of Yandex ID sign-in for the trusted dashboard",
        "security": [],
        "parameters": [
          {
            "name": "X-Smolny-Dashboard",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "1"
            },
            "description": "Required CSRF protection header for Smolny Dashboard requests (must be '1')."
          }
        ],
        "responses": {
          "200": {
            "description": "Provider availability and linking status for the active customer session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "enabled",
                    "linked"
                  ],
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "linked": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "beginYandexBrowserSignIn",
        "summary": "Begin a browser-bound Yandex ID authorization-code flow",
        "description": "This route is available only from the trusted dashboard. Register requires a private smr_ invitation. Link requires an existing authenticated customer cookie and an explicit account linking request. Login returns to the project bound to the verified Yandex ID. Navigate the same browser to authorization_url.",
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://api.smolny.tech"
            },
            "description": "Origin header matching the Smolny API host for dashboard CSRF validation."
          },
          {
            "name": "X-Smolny-Dashboard",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "1"
            },
            "description": "Required CSRF protection header for Smolny Dashboard requests (must be '1')."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "mode"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "mode": {
                        "enum": [
                          "login",
                          "link"
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "mode",
                      "invitation"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "mode": {
                        "const": "register"
                      },
                      "invitation": {
                        "type": "string",
                        "format": "password",
                        "pattern": "^smr_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One-time redirect URL and temporary browser cookie",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "authorization_url"
                  ],
                  "properties": {
                    "authorization_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/auth/yandex/callback": {
      "get": {
        "operationId": "finishYandexBrowserSignIn",
        "summary": "Accept the Yandex ID browser callback at the canonical HTTPS origin",
        "description": "Called by Yandex OAuth through the initiating browser. Requires its one-time browser cookie and state. Exchanges a code server-side, or handles denied consent. Redirects to the dashboard with a fixed destination and issues a customer session on success.",
        "security": [],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Opaque OAuth state token returned by Yandex ID to prevent CSRF."
          },
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "password"
            },
            "description": "One-time OAuth authorization code issued by Yandex ID."
          },
          {
            "name": "error",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "OAuth error code returned when authorization is denied or fails."
          },
          {
            "name": "error_description",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Human-readable OAuth error description from Yandex ID."
          }
        ],
        "responses": {
          "303": {
            "description": "Return to the dashboard. The browser receives a session cookie on success.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/account/register": {
      "post": {
        "operationId": "registerCustomer",
        "summary": "Register a customer account with a pilot invitation",
        "description": "Send the registration-only smr_ invitation to https://api.smolny.tech. Generate and retain a fresh recovery_secret from 32 cryptographically random bytes encoded as unpadded base64url. The same proof can recover a lost response until the invitation expires. Store the account credential privately and use it with GET /v1/permissions to sign in by API. Exchange it for a separate scoped agent key using POST /v1/project/keys.",
        "security": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/RegistrationProof"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CustomerRegistration"
          },
          "201": {
            "$ref": "#/components/responses/CustomerRegistration"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/permissions": {
      "get": {
        "operationId": "getProjectPermissions",
        "x-smolny-scopes": [],
        "summary": "Sign in and inspect the current project credential and enabled features",
        "description": "Returns the project, role, scopes, credential expiry and feature flags for the presented bearer token. Read resource quotas and present usage at /v1/usage with the read scope.",
        "responses": {
          "200": {
            "description": "Authenticated permissions",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ProjectAccess"
                    },
                    {
                      "type": "object",
                      "required": [
                        "scope_catalog",
                        "features"
                      ],
                      "properties": {
                        "scope_catalog": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "features": {
                          "type": "object",
                          "required": [
                            "fast_compute",
                            "durable_workspaces",
                            "fast_images",
                            "custom_images",
                            "incus_snapshots",
                            "key_management",
                            "webhooks"
                          ],
                          "properties": {
                            "fast_compute": {
                              "type": "boolean"
                            },
                            "durable_workspaces": {
                              "type": "boolean"
                            },
                            "fast_images": {
                              "type": "boolean"
                            },
                            "custom_images": {
                              "type": "boolean"
                            },
                            "incus_snapshots": {
                              "type": "boolean"
                            },
                            "key_management": {
                              "type": "boolean"
                            },
                            "webhooks": {
                              "type": "boolean",
                              "description": "This project is configured for workspace webhooks."
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/storage": {
      "get": {
        "operationId": "listProjectStorage",
        "x-smolny-scopes": [
          "read"
        ],
        "summary": "List project work volumes and their snapshots",
        "description": "Reads background storage observations and associates registered workspaces with their volumes. Partial or unavailable coverage can omit resources. This request does not refresh the broker inventory.",
        "responses": {
          "200": {
            "description": "Cached work volume inventory",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectStorageInventory"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/previews": {
      "get": {
        "operationId": "listProjectPreviews",
        "x-smolny-scopes": [
          "read"
        ],
        "summary": "List metadata for active project previews",
        "description": "Includes ID, port, expiration, and customer resource identity. A share URL is returned only by a preview creation operation.",
        "responses": {
          "200": {
            "description": "Project preview metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "previews"
                  ],
                  "properties": {
                    "previews": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectPreview"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/usage": {
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "getProjectUsage",
        "summary": "Read observed resource usage and admission limits for the authenticated project",
        "description": "Reads a background cache. Coverage timestamps and gaps describe partial history. Direct IP and proxy-payload bytes are independent measurements. Byte-milliseconds are decimal strings.",
        "responses": {
          "200": {
            "description": "Project quota and observed usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectUsage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/templates": {
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "listTemplates",
        "description": "Lists templates and the authenticated project's warm reserve capacity. Ready counts are snapshots for the standard template shape without an idle timeout. Concurrent requests can consume the last reserve before a create arrives.",
        "responses": {
          "200": {
            "description": "Available templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "templates"
                  ],
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Template"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/images": {
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "listCustomImages",
        "description": "List raw VM disks imported by the authenticated project. The operator must enable custom images for the project.",
        "responses": {
          "200": {
            "description": "Imported project images",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "images"
                  ],
                  "properties": {
                    "images": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomImage"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/images/{image}": {
      "parameters": [
        {
          "name": "image",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "maxLength": 56,
            "pattern": "^[a-z](?:[a-z0-9-]{0,54}[a-z0-9])?$"
          },
          "description": "Custom VM image name (lowercase alphanumeric and hyphens)."
        }
      ],
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "getCustomImage",
        "responses": {
          "200": {
            "description": "Imported image",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomImage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "image",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 56,
              "pattern": "^[a-z](?:[a-z0-9-]{0,54}[a-z0-9])?$"
            },
            "description": "Custom VM image name (lowercase alphanumeric and hyphens)."
          }
        ]
      },
      "put": {
        "x-smolny-scopes": [
          "storage"
        ],
        "operationId": "importCustomImage",
        "description": "Import a raw, bootable Ubuntu VM disk with the Incus VM agent installed. Use the host architecture and a UEFI Secure Boot-compatible image. Include a fixed Content-Length that is a positive multiple of 512 bytes. The maximum size is 10 GiB or the project disk cap, whichever is lower. Use the returned template to create a VM with a root disk large enough for the imported image. The image identifier is immutable while present. If an upload ends without a response, retrieve the image and compare its SHA-256 and byte size before attempting another upload. An import pending response means Incus is still reconciling an earlier upload.",
        "parameters": [
          {
            "name": "X-Image-SHA256",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "description": "Hex-encoded SHA-256 checksum of the uploaded image stream."
          },
          {
            "name": "image",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 56,
              "pattern": "^[a-z](?:[a-z0-9-]{0,54}[a-z0-9])?$"
            },
            "description": "Custom VM image name (lowercase alphanumeric and hyphens)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Imported image",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomImage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "x-smolny-scopes": [
          "storage",
          "destroy"
        ],
        "operationId": "deleteCustomImage",
        "description": "Remove the project image from the launch catalog. Existing VM disks remain available.",
        "responses": {
          "204": {
            "description": "Image deleted"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "image",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 56,
              "pattern": "^[a-z](?:[a-z0-9-]{0,54}[a-z0-9])?$"
            },
            "description": "Custom VM image name (lowercase alphanumeric and hyphens)."
          }
        ]
      }
    },
    "/v1/invitations/redeem": {
      "post": {
        "operationId": "redeemPilotInvitation",
        "description": "Accepts a private invitation for an operator-provisioned project. Generate a fresh recovery_secret from 32 cryptographically random bytes encoded as unpadded base64url. If the response is lost, retry with the same payload while the invitation and issued key are valid. A different recovery secret cannot recover an issued key. Request and response secrets must stay out of URLs and logs.",
        "security": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/InvitationProof"
        },
        "responses": {
          "200": {
            "description": "Recovered the same active project credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PilotInvitationReceipt"
                }
              }
            }
          },
          "201": {
            "description": "Issued the single project credential for this invitation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PilotInvitationReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "description": "Invitation unknown, expired, revoked, or already redeemed with a different recovery secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/project/keys": {
      "get": {
        "operationId": "listProjectKeys",
        "description": "A customer account sees active agent keys that it issued. A configured project owner sees all active keys for the project. The response contains metadata only.",
        "responses": {
          "200": {
            "description": "Active access keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "keys"
                  ],
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectKey"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createProjectKey",
        "description": "Issues a separate bearer credential for this project. Customer accounts must supply scopes. Configured project owners may omit scopes to create a legacy delegated key. The project can have up to 16 active keys.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "$ref": "#/components/schemas/Name"
                  },
                  "scopes": {
                    "$ref": "#/components/schemas/KeyScopes"
                  },
                  "ttl_seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2592000,
                    "default": 86400
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/IssuedProjectKey"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/project/keys/{key}": {
      "parameters": [
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ProjectKeyId"
          },
          "description": "Project API key identifier."
        }
      ],
      "delete": {
        "operationId": "revokeProjectKey",
        "description": "Revokes a key issued by the authenticated customer account, or any key in the project when using the configured owner credential. Subsequent requests using the revoked key receive HTTP 401.",
        "responses": {
          "204": {
            "description": "Access key revoked"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProjectKeyId"
            },
            "description": "Project API key identifier."
          }
        ]
      }
    },
    "/v1/project/keys/{key}/rotate": {
      "parameters": [
        {
          "name": "key",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ProjectKeyId"
          },
          "description": "Project API key identifier."
        }
      ],
      "post": {
        "operationId": "rotateProjectKey",
        "description": "Atomically replaces an active scoped agent key with a new key, keeping its name and scopes. The old token immediately stops authenticating. The customer can rotate keys it issued. A project owner can rotate any scoped key in the project.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "ttl_seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2592000,
                    "default": 86400
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/IssuedProjectKey"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProjectKeyId"
            },
            "description": "Project API key identifier."
          }
        ]
      }
    },
    "/v1/microvm-images": {
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "listMicroVMImages",
        "description": "List prepared and pending Firecracker images in the authenticated project.",
        "responses": {
          "200": {
            "description": "Project image catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "images"
                  ],
                  "properties": {
                    "images": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MicroVMImage"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/microvm-images/{digest}": {
      "parameters": [
        {
          "name": "digest",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/ImageDigest"
          },
          "description": "SHA-256 digest identifying the microVM image artifact."
        }
      ],
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "getMicroVMImage",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MicroVMImage"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "digest",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ImageDigest"
            },
            "description": "SHA-256 digest identifying the microVM image artifact."
          }
        ]
      },
      "delete": {
        "x-smolny-scopes": [
          "storage",
          "destroy"
        ],
        "operationId": "deleteMicroVMImage",
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "digest",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ImageDigest"
            },
            "description": "SHA-256 digest identifying the microVM image artifact."
          }
        ]
      }
    },
    "/v1/microvm-images/{format}/{digest}": {
      "put": {
        "x-smolny-scopes": [
          "storage"
        ],
        "operationId": "uploadMicroVMImage",
        "description": "Upload a Linux amd64 OCI archive or raw ext4 root disk of up to 2 GiB under its source SHA-256 digest. A single-host project can explicitly reprepare an existing ready image by resubmitting the original bytes with If-Match. During repreparation the current disk stays ready and the reprepare field reports progress.",
        "parameters": [
          {
            "name": "format",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "oci",
                "ext4"
              ]
            },
            "description": "Uploaded microVM image format ('oci' or 'ext4')."
          },
          {
            "name": "digest",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ImageDigest"
            },
            "description": "SHA-256 digest identifying the microVM image artifact."
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "One quoted prepared_digest from the current ready image. Omit for an initial upload.",
            "schema": {
              "type": "string",
              "pattern": "^\"sha256:[0-9a-f]{64}\"$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Fast image upload accepted for asynchronous preparation",
            "headers": {
              "Location": {
                "description": "URL to poll the status of this asynchronous operation.",
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/MicroVMImage"
                    }
                  ],
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "description": "Identifier of the accepted asynchronous job or delivery."
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri-reference",
                      "description": "Relative or absolute URL to poll for asynchronous operation status."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "412": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "507": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/project/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "summary": "List project webhook endpoints and supported event types",
        "x-smolny-scopes": [
          "webhooks:read"
        ],
        "responses": {
          "200": {
            "description": "List project webhook endpoints and supported event types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "webhooks",
                    "event_types",
                    "limit",
                    "dropped_deliveries"
                  ],
                  "properties": {
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookEndpoint"
                      }
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WorkspaceWebhookEvent"
                      }
                    },
                    "limit": {
                      "type": "integer",
                      "const": 5
                    },
                    "dropped_deliveries": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createWebhook",
        "summary": "Register an operator-approved HTTPS URL and return the signing secret once",
        "x-smolny-scopes": [
          "webhooks:write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "events"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 512
                  },
                  "events": {
                    "$ref": "#/components/schemas/WebhookSubscriptions"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Register an operator-approved HTTPS URL and return the signing secret once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuedWebhook"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/project/webhooks/{hook}": {
      "parameters": [
        {
          "name": "hook",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^wh_[a-f0-9]{32}$"
          },
          "description": "Project webhook endpoint identifier."
        }
      ],
      "get": {
        "operationId": "inspectWebhook",
        "summary": "Get webhook endpoint metadata",
        "x-smolny-scopes": [
          "webhooks:read"
        ],
        "responses": {
          "200": {
            "description": "Get webhook endpoint metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "hook",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wh_[a-f0-9]{32}$"
            },
            "description": "Project webhook endpoint identifier."
          }
        ]
      },
      "put": {
        "operationId": "updateWebhook",
        "summary": "Replace subscriptions on a webhook endpoint",
        "x-smolny-scopes": [
          "webhooks:write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "events"
                ],
                "properties": {
                  "events": {
                    "$ref": "#/components/schemas/WebhookSubscriptions"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replace subscriptions on a webhook endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "hook",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wh_[a-f0-9]{32}$"
            },
            "description": "Project webhook endpoint identifier."
          }
        ]
      },
      "delete": {
        "operationId": "revokeWebhook",
        "summary": "Revoke a webhook endpoint and cancel queued deliveries",
        "x-smolny-scopes": [
          "webhooks:write"
        ],
        "responses": {
          "204": {
            "description": "Revoke a webhook endpoint and cancel queued deliveries"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "hook",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wh_[a-f0-9]{32}$"
            },
            "description": "Project webhook endpoint identifier."
          }
        ]
      }
    },
    "/v1/project/webhooks/{hook}/rotate": {
      "parameters": [
        {
          "name": "hook",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^wh_[a-f0-9]{32}$"
          },
          "description": "Project webhook endpoint identifier."
        }
      ],
      "post": {
        "operationId": "rotateWebhookSecret",
        "summary": "Replace the signing secret and return it once",
        "x-smolny-scopes": [
          "webhooks:write"
        ],
        "responses": {
          "200": {
            "description": "Replace the signing secret and return it once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuedWebhook"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "hook",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wh_[a-f0-9]{32}$"
            },
            "description": "Project webhook endpoint identifier."
          }
        ]
      }
    },
    "/v1/project/webhooks/{hook}/test": {
      "parameters": [
        {
          "name": "hook",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^wh_[a-f0-9]{32}$"
          },
          "description": "Project webhook endpoint identifier."
        }
      ],
      "post": {
        "operationId": "testWebhook",
        "summary": "Queue a signed test delivery to this endpoint",
        "x-smolny-scopes": [
          "webhooks:write"
        ],
        "responses": {
          "202": {
            "description": "Queue a signed test delivery to this endpoint",
            "headers": {
              "Location": {
                "description": "URL to poll the status of this asynchronous operation.",
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/WebhookDelivery"
                    }
                  ],
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "description": "Identifier of the accepted asynchronous job or delivery."
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri-reference",
                      "description": "Relative or absolute URL to poll for asynchronous operation status."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "hook",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wh_[a-f0-9]{32}$"
            },
            "description": "Project webhook endpoint identifier."
          }
        ]
      }
    },
    "/v1/project/webhooks/{hook}/deliveries": {
      "parameters": [
        {
          "name": "hook",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^wh_[a-f0-9]{32}$"
          },
          "description": "Project webhook endpoint identifier."
        }
      ],
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "List metadata for the 50 most recent deliveries",
        "x-smolny-scopes": [
          "webhooks:read"
        ],
        "responses": {
          "200": {
            "description": "List metadata for the 50 most recent deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deliveries"
                  ],
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      },
                      "maxItems": 50
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hook",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wh_[a-f0-9]{32}$"
            },
            "description": "Project webhook endpoint identifier."
          }
        ]
      }
    },
    "/v1/project/webhooks/{hook}/deliveries/{delivery}": {
      "parameters": [
        {
          "name": "hook",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^wh_[a-f0-9]{32}$"
          },
          "description": "Project webhook endpoint identifier."
        },
        {
          "name": "delivery",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^wd_[a-f0-9]{32}$"
          },
          "description": "Webhook delivery attempt record identifier (wd_...)."
        }
      ],
      "get": {
        "operationId": "inspectWebhookDelivery",
        "summary": "Get delivery and attempt metadata",
        "x-smolny-scopes": [
          "webhooks:read"
        ],
        "responses": {
          "200": {
            "description": "Get delivery and attempt metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "hook",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wh_[a-f0-9]{32}$"
            },
            "description": "Project webhook endpoint identifier."
          },
          {
            "name": "delivery",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wd_[a-f0-9]{32}$"
            },
            "description": "Webhook delivery attempt record identifier (wd_...)."
          }
        ]
      }
    },
    "/v1/project/webhooks/{hook}/deliveries/{delivery}/replay": {
      "parameters": [
        {
          "name": "hook",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^wh_[a-f0-9]{32}$"
          },
          "description": "Project webhook endpoint identifier."
        },
        {
          "name": "delivery",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^wd_[a-f0-9]{32}$"
          },
          "description": "Webhook delivery attempt record identifier (wd_...)."
        }
      ],
      "post": {
        "operationId": "replayWebhookDelivery",
        "summary": "Queue one more attempt with the same event ID",
        "x-smolny-scopes": [
          "webhooks:write"
        ],
        "responses": {
          "202": {
            "description": "Queue one more attempt with the same event ID",
            "headers": {
              "Location": {
                "description": "URL to poll the status of this asynchronous operation.",
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/WebhookDelivery"
                    }
                  ],
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "description": "Identifier of the accepted asynchronous job or delivery."
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri-reference",
                      "description": "Relative or absolute URL to poll for asynchronous operation status."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "hook",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wh_[a-f0-9]{32}$"
            },
            "description": "Project webhook endpoint identifier."
          },
          {
            "name": "delivery",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wd_[a-f0-9]{32}$"
            },
            "description": "Webhook delivery attempt record identifier (wd_...)."
          }
        ]
      }
    },
    "/v1/project/egress-proxy": {
      "get": {
        "operationId": "getProjectEgressProxy",
        "description": "Reports whether credentials are stored for the authenticated proxy-enabled project. Requires the owner bearer token on a non-clustered project.",
        "responses": {
          "200": {
            "description": "Credential configuration status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "configured"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "configured": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "description": "Clustered project credentials must be configured by the operator on each node.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "put": {
        "operationId": "setProjectEgressProxy",
        "description": "Replaces the upstream Basic credentials for the authenticated proxy-enabled project and closes its open tunnels. Requires the owner bearer token on a non-clustered project.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "username",
                  "password"
                ],
                "additionalProperties": false,
                "properties": {
                  "username": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "writeOnly": true
                  },
                  "password": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "writeOnly": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Credentials stored"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "description": "Clustered project credentials must be configured by the operator on each node.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteProjectEgressProxy",
        "description": "Removes upstream credentials and closes the authenticated project's open proxy tunnels. Requires the owner bearer token on a non-clustered project.",
        "responses": {
          "204": {
            "description": "Credentials removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "description": "Clustered project credentials must be configured by the operator on each node.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/microvms": {
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "listMicroVMs",
        "description": "Lists active Firecracker VMs in the authenticated project. The MicroVM routes require a project with the feature enabled.",
        "responses": {
          "200": {
            "description": "Active MicroVMs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "machines"
                  ],
                  "properties": {
                    "machines": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MicroVM"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "x-smolny-conditional-scopes": {
          "command": [
            "exec"
          ],
          "desktop": [
            "exec"
          ],
          "volume": [
            "storage"
          ]
        },
        "operationId": "createMicroVM",
        "description": "Boots Ubuntu from a clean disk with a fresh kernel when template=ubuntu-microvm, or restores a minimal BusyBox environment from a snapshot when template=microvm. With command, executes the command once in that new guest before returning 201. A completed command with a nonzero exit code is returned normally and the MicroVM remains allocated. A dispatch, guest transport, or command timeout error discards the new allocation. After a lost HTTP response, inspect the requested name before retrying. Clustered projects require an Idempotency-Key. A successful retry returns the stored response for 24 hours without dispatching another create or command.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Required for clustered microVMs and scoped to the project.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._~-]{1,128}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MicroVMCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Guest ready and, if supplied, the command has completed",
            "headers": {
              "Server-Timing": {
                "$ref": "#/components/headers/MicroVMCreateTiming"
              },
              "Idempotency-Replayed": {
                "description": "Present only when returning a stored clustered create response.",
                "schema": {
                  "type": "string",
                  "const": "true"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MicroVMCreateResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "504": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/microvms/snapshots": {
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "listMicroVMSnapshots",
        "description": "List saved Firecracker memory and disk snapshots for this project.",
        "responses": {
          "200": {
            "description": "Saved microVM snapshots",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "snapshots": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/microvms/snapshots/{snapshot_id}": {
      "delete": {
        "x-smolny-scopes": [
          "destroy"
        ],
        "operationId": "deleteMicroVMSnapshot",
        "description": "Delete a saved Firecracker memory and disk snapshot.",
        "responses": {
          "204": {
            "description": "Snapshot deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "snapshot_id",
            "in": "path",
            "required": true,
            "description": "Unique microVM snapshot identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "snapshot_id",
          "in": "path",
          "required": true,
          "description": "Unique microVM snapshot identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{machine}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "getMicroVM",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MicroVM"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      },
      "delete": {
        "x-smolny-scopes": [
          "compute",
          "destroy"
        ],
        "operationId": "deleteMicroVM",
        "responses": {
          "204": {
            "description": "MicroVM deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "x-smolny-conditional-scopes": {
          "force=true": [
            "destroy"
          ]
        },
        "operationId": "stopMicroVMWithWorkVolume",
        "description": "Unmounts the work disk, retires the MicroVM and its boot-bound links, and releases the disk. Subsequent reads of that MicroVM return 404. A forced stop kills the guest without unmounting, so the guest filesystem recovers on reattach.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "force": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Compute stopped and work volume detached"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/workspaces": {
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "listWorkspaces",
        "description": "List the authenticated project's registered workspaces and their last recorded lifecycle states. Use getWorkspace to check availability of the active guest.",
        "responses": {
          "200": {
            "description": "Project workspaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "workspaces"
                  ],
                  "properties": {
                    "workspaces": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Workspace"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/workspaces/{workspace}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkspaceId"
        }
      ],
      "put": {
        "x-smolny-scopes": [
          "storage"
        ],
        "operationId": "createWorkspace",
        "description": "Register the caller-selected ID and an existing project work volume without starting compute. Retrying the same configuration returns the existing workspace. An ID is never reused after deletion. Only one workspace can claim a volume.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Workspace"
          },
          "201": {
            "$ref": "#/components/responses/Workspace"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ]
      },
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "getWorkspace",
        "description": "Read a workspace even when it is parked. A running workspace identifies the current guest when that guest answers.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Workspace"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ]
      },
      "delete": {
        "x-smolny-scopes": [
          "compute",
          "storage",
          "destroy"
        ],
        "operationId": "deleteWorkspace",
        "description": "Stop workspace compute gracefully and retire the logical ID. The work volume and its snapshots remain in the project. A successful repeat returns 204.",
        "responses": {
          "204": {
            "description": "Workspace retired and work volume retained"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ]
      }
    },
    "/v1/workspaces/{workspace}/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkspaceId"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "operationId": "startWorkspace",
        "description": "Start a fresh Ubuntu guest with the registered image, shape, network setting and volume mounted at /work. A retry returns or completes the same running lease. Start after a successful stop opens a fresh boot under the same workspace ID.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Workspace"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ]
      }
    },
    "/v1/workspaces/{workspace}/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkspaceId"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "x-smolny-conditional-scopes": {
          "force=true": [
            "destroy"
          ]
        },
        "operationId": "stopWorkspace",
        "description": "Stop compute, retire its preview links and retain the volume. A normal stop rejects a busy mount. A forced stop can discard uncommitted writes. Repeating stop on a parked workspace succeeds.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "force": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Workspace"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ]
      }
    },
    "/v1/workspaces/{workspace}/ssh": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkspaceId"
        }
      ],
      "post": {
        "operationId": "createWorkspaceSshSession",
        "x-smolny-scopes": [
          "exec"
        ],
        "description": "Authorize one SSH connection to this running guest generation. Connect with the same bearer credential and verify the returned guest host key.",
        "requestBody": {
          "$ref": "#/components/requestBodies/SshPublicKey"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/SshSession"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ]
      }
    },
    "/v1/workspaces/{workspace}/ssh/{session}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkspaceId"
        },
        {
          "$ref": "#/components/parameters/SshSessionId"
        }
      ],
      "get": {
        "operationId": "openWorkspaceSshSession",
        "x-smolny-scopes": [
          "exec"
        ],
        "description": "Upgrade an empty HTTP/1.1 request to a native OpenSSH stream. A session can be used once. It expires after 30 minutes, 120 seconds without traffic or 64 MiB in either direction.",
        "parameters": [
          {
            "name": "Connection",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "Upgrade"
            },
            "description": "HTTP upgrade connection header (must be 'Upgrade')."
          },
          {
            "name": "Upgrade",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "smolny-ssh"
            },
            "description": "Custom Smolny SSH upgrade protocol header (must be 'smolny-ssh')."
          },
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "101": {
            "description": "Switched to the Smolny SSH tunnel"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "revokeWorkspaceSshSession",
        "x-smolny-scopes": [
          "exec"
        ],
        "description": "Revoke the SSH session and close its connection.",
        "responses": {
          "204": {
            "description": "SSH session revoked"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ]
      }
    },
    "/v1/workspaces/{workspace}/exec": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkspaceId"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "executeWorkspaceCommand",
        "description": "Execute in the running workspace's current guest generation. Start parked compute explicitly before executing.",
        "requestBody": {
          "$ref": "#/components/requestBodies/Exec"
        },
        "responses": {
          "200": {
            "description": "Guest command result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecResult"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ]
      }
    },
    "/v1/workspaces/{workspace}/git-checkouts": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkspaceId"
        }
      ],
      "post": {
        "operationId": "createWorkspaceGitCheckout",
        "description": "Project owner only. Grant read-only Git smart HTTP access to one canonical HTTPS repository from the current boot of an enabled workspace. The returned handle is sent as X-Smolny-Checkout to the returned private guest gateway URL.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GitCheckoutCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ephemeral checkout grant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitCheckout"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "410": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "504": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ]
      }
    },
    "/v1/workspaces/{workspace}/git-checkouts/{checkout}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkspaceId"
        },
        {
          "in": "path",
          "name": "checkout",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[0-9a-f]{32}$"
          },
          "description": "Hexadecimal git checkout identifier within the workspace."
        }
      ],
      "delete": {
        "operationId": "revokeWorkspaceGitCheckout",
        "description": "Project owner only. Revoke a checkout on the current running boot and interrupt active transfers. Revoking a missing or already expired grant on that boot succeeds.",
        "responses": {
          "204": {
            "description": "Git checkout revoked"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "in": "path",
            "name": "checkout",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            },
            "description": "Hexadecimal git checkout identifier within the workspace."
          }
        ]
      }
    },
    "/v1/workspaces/{workspace}/preview-links": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkspaceId"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "preview"
        ],
        "operationId": "createWorkspacePreviewLink",
        "description": "Issue an expiring GET-only link to the running guest. The link is bound to its boot and is retired on stop.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "port"
                ],
                "properties": {
                  "port": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535
                  },
                  "path": {
                    "type": "string",
                    "default": "/"
                  },
                  "ttl_seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 900,
                    "default": 300
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Expiring browser link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewLinkResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ]
      }
    },
    "/v1/workspaces/{workspace}/preview-links/{link}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkspaceId"
        },
        {
          "name": "link",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/PreviewLinkId"
          },
          "description": "Temporary preview or live-desktop link identifier."
        }
      ],
      "delete": {
        "x-smolny-scopes": [
          "preview"
        ],
        "operationId": "revokeWorkspacePreviewLink",
        "responses": {
          "204": {
            "description": "Workspace browser link revoked"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "link",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PreviewLinkId"
            },
            "description": "Temporary preview or live-desktop link identifier."
          }
        ]
      }
    },
    "/v1/microvolumes/{volume}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkVolumeName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "storage"
        ],
        "operationId": "createMicroVMWorkVolume",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "size_gib": {
                    "type": "integer",
                    "minimum": 20,
                    "maximum": 40,
                    "default": 20
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/WorkVolume"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkVolumeName"
          }
        ]
      },
      "delete": {
        "x-smolny-scopes": [
          "storage",
          "destroy"
        ],
        "operationId": "deleteMicroVMWorkVolume",
        "responses": {
          "204": {
            "description": "Detached work volume with no remaining snapshots deleted"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkVolumeName"
          }
        ]
      }
    },
    "/v1/microvolumes/{volume}/snapshots": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkVolumeName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "storage"
        ],
        "operationId": "createMicroVMWorkVolumeSnapshot",
        "requestBody": {
          "$ref": "#/components/requestBodies/WorkVolumeName"
        },
        "responses": {
          "201": {
            "description": "Named snapshot of the detached work disk",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name"
                  ],
                  "properties": {
                    "name": {
                      "$ref": "#/components/schemas/Name"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkVolumeName"
          }
        ]
      }
    },
    "/v1/microvolumes/{volume}/snapshots/{snapshot}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkVolumeName"
        },
        {
          "$ref": "#/components/parameters/WorkSnapshotName"
        }
      ],
      "delete": {
        "x-smolny-scopes": [
          "storage",
          "destroy"
        ],
        "operationId": "deleteMicroVMWorkVolumeSnapshot",
        "responses": {
          "204": {
            "description": "Snapshot deleted"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkVolumeName"
          }
        ]
      }
    },
    "/v1/microvolumes/{volume}/snapshots/{snapshot}/clone": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkVolumeName"
        },
        {
          "$ref": "#/components/parameters/WorkSnapshotName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "storage"
        ],
        "operationId": "cloneMicroVMWorkVolumeSnapshot",
        "requestBody": {
          "$ref": "#/components/requestBodies/WorkVolumeName"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/WorkVolume"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkVolumeName"
          }
        ]
      }
    },
    "/v1/microvolumes/{volume}/snapshots/{snapshot}/restore": {
      "parameters": [
        {
          "$ref": "#/components/parameters/WorkVolumeName"
        },
        {
          "$ref": "#/components/parameters/WorkSnapshotName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "storage",
          "destroy"
        ],
        "operationId": "restoreMicroVMWorkVolumeSnapshot",
        "description": "Atomically replaces the detached work volume data with a copy of the named snapshot.",
        "responses": {
          "204": {
            "description": "Snapshot restored"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkVolumeName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/ssh": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "operationId": "createMicroVMSandboxSshSession",
        "x-smolny-scopes": [
          "exec"
        ],
        "description": "Authorize one SSH connection to this running guest generation. Connect with the same bearer credential and verify the returned guest host key.",
        "requestBody": {
          "$ref": "#/components/requestBodies/SshPublicKey"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/SshSession"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/ssh/{session}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "$ref": "#/components/parameters/SshSessionId"
        }
      ],
      "get": {
        "operationId": "openMicroVMSandboxSshSession",
        "x-smolny-scopes": [
          "exec"
        ],
        "description": "Upgrade an empty HTTP/1.1 request to a native OpenSSH stream. A session can be used once. It expires after 30 minutes, 120 seconds without traffic or 64 MiB in either direction.",
        "parameters": [
          {
            "name": "Connection",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "Upgrade"
            },
            "description": "HTTP upgrade connection header (must be 'Upgrade')."
          },
          {
            "name": "Upgrade",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "smolny-ssh"
            },
            "description": "Custom Smolny SSH upgrade protocol header (must be 'smolny-ssh')."
          },
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ],
        "responses": {
          "101": {
            "description": "Switched to the Smolny SSH tunnel"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "revokeMicroVMSandboxSshSession",
        "x-smolny-scopes": [
          "exec"
        ],
        "description": "Revoke the SSH session and close its connection.",
        "responses": {
          "204": {
            "description": "SSH session revoked"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/exec": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "executeMicroVMCommand",
        "requestBody": {
          "$ref": "#/components/requestBodies/Exec"
        },
        "responses": {
          "200": {
            "description": "Guest command result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/preview-links": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "preview"
        ],
        "operationId": "createMicroVMPreviewLink",
        "description": "Issue an expiring, revocable grant for one Ubuntu microVM boot and one guest loopback port. Preview mode serves bounded read-only GET. App mode accepts bounded JSON POST or a WebSocket upgrade on the preview origin. Explicit public visibility puts the capability in the URL. Private visibility returns an access_token for the Authorization header and a URL containing the grant ID only. Stop, deletion and revocation close active app WebSockets.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "port"
                ],
                "properties": {
                  "port": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535
                  },
                  "path": {
                    "type": "string",
                    "default": "/"
                  },
                  "ttl_seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 900,
                    "default": 300
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "preview",
                      "app"
                    ],
                    "default": "preview"
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "private"
                    ]
                  }
                },
                "if": {
                  "required": [
                    "mode"
                  ],
                  "properties": {
                    "mode": {
                      "const": "app"
                    }
                  }
                },
                "then": {
                  "required": [
                    "visibility"
                  ]
                },
                "else": {
                  "properties": {
                    "visibility": {
                      "const": "public"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Expiring preview or app grant. Store a private access_token separately from its URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewLinkResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/preview-links/{link}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "name": "link",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/PreviewLinkId"
          },
          "description": "Temporary preview or live-desktop link identifier."
        }
      ],
      "delete": {
        "x-smolny-scopes": [
          "preview"
        ],
        "operationId": "revokeMicroVMPreviewLink",
        "responses": {
          "204": {
            "description": "Browser link revoked"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          },
          {
            "name": "link",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PreviewLinkId"
            },
            "description": "Temporary preview or live-desktop link identifier."
          }
        ]
      }
    },
    "/v1/microvms/{machine}/desktop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "captureMicroVMDesktop",
        "description": "Apply up to 32 desktop input events and return a fresh 800 × 600 JPEG from the same running desktop-enabled Ubuntu microVM. Use an empty array to capture without input. The body limit is 16 KiB.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MicroVMDesktopEvents"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JPEG desktop frame",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/desktop-links": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "exec",
          "preview"
        ],
        "operationId": "createMicroVMDesktopLink",
        "description": "Issue a temporary HTTPS browser link to the current boot of a desktop-enabled Ubuntu microVM. Desktop gives keyboard and mouse control. Desktop-view shares the screen. The link expires on schedule and cannot access a later VM with the same name.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "mode": {
                    "enum": [
                      "desktop",
                      "desktop-view"
                    ],
                    "default": "desktop"
                  },
                  "ttl_seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 900,
                    "default": 300
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Expiring desktop link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewLinkResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/desktop-links/{link}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "name": "link",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/PreviewLinkId"
          },
          "description": "Temporary preview or live-desktop link identifier."
        }
      ],
      "delete": {
        "x-smolny-scopes": [
          "exec",
          "preview"
        ],
        "operationId": "revokeMicroVMDesktopLink",
        "responses": {
          "204": {
            "description": "Desktop link revoked"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          },
          {
            "name": "link",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PreviewLinkId"
            },
            "description": "Temporary preview or live-desktop link identifier."
          }
        ]
      }
    },
    "/v1/microvms/{machine}/files": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "$ref": "#/components/parameters/GuestFilePath"
        }
      ],
      "get": {
        "x-smolny-scopes": [
          "files:read"
        ],
        "operationId": "downloadMicroVMFile",
        "description": "Downloads up to 1048576 bytes.",
        "responses": {
          "200": {
            "description": "Raw file contents",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      },
      "put": {
        "x-smolny-scopes": [
          "files:write"
        ],
        "operationId": "uploadMicroVMFile",
        "description": "Uploads up to 1048576 bytes with Content-Length.",
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "File written"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines": {
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "listMachines",
        "responses": {
          "200": {
            "description": "Machines in the authenticated project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "machines"
                  ],
                  "properties": {
                    "machines": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Machine"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "x-smolny-conditional-scopes": {
          "command": [
            "exec"
          ]
        },
        "operationId": "createMachine",
        "description": "Creates a VM using warm or cold allocation. An optional first command is validated before allocation and runs on the created VM. A 201 response confirms creation. A confirmed command exit, including a nonzero exit, returns command_result. If no command result can be confirmed, command_error describes the outcome and the VM remains available for inspection. With an Idempotency-Key, retry the same JSON in the same project for up to 24 hours after completion to retrieve the original 201 response without allocating a VM or running its command again. A retry can return idempotency_in_progress while the first request runs. If the provider cannot establish the original outcome after an interruption, the key stays reserved and a retry returns idempotency_outcome_unknown. Inspect the requested machine by name in that case.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Supply one key per create attempt. The key is scoped to the authenticated project. Each project can hold up to 32 keys.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._~-]{1,128}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MachineCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Guest created with the outcome of the optional first command",
            "headers": {
              "Server-Timing": {
                "$ref": "#/components/headers/VMReady"
              },
              "Idempotency-Replayed": {
                "description": "Present only when returning a stored create response.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MachineCreateResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, including invalid_idempotency_key for a malformed or repeated header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "Create conflict. Idempotency errors include idempotency_conflict for different JSON, idempotency_in_progress for an active original request, idempotency_outcome_unknown for an unresolved original outcome, and idempotency_quota when a new key would exceed project or provider storage capacity. A project can retain up to 256 live keys, including at most 32 unresolved attempts. Byte limits can reduce capacity for large responses. Limits on new keys do not evict existing keys.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "description": "Provider busy or unavailable, including idempotency_store_unavailable when a keyed request cannot access the store",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/machines/{machine}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "getMachine",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Machine"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      },
      "delete": {
        "x-smolny-scopes": [
          "compute",
          "destroy"
        ],
        "operationId": "deleteMachine",
        "responses": {
          "204": {
            "description": "Machine deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/exec": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "executeCommand",
        "description": "Runs an argv command in the guest and wakes a VM automatically paused by idle policy. An explicit pause requires explicit resume. A guest exit code is part of the result.",
        "requestBody": {
          "$ref": "#/components/requestBodies/Exec"
        },
        "responses": {
          "200": {
            "description": "Guest command result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "504": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/jobs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "startJob",
        "description": "Starts a background argv command and returns without waiting for it to finish. Retry with the same machine, ID and command options to recover a submission after disconnecting. Changing command options for an existing ID returns job_conflict.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "argv"
                ],
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Name"
                  },
                  "argv": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 128,
                    "prefixItems": [
                      {
                        "type": "string",
                        "minLength": 1
                      }
                    ],
                    "items": {
                      "type": "string"
                    },
                    "description": "Nonempty executable followed by its arguments. The UTF-8 bytes across all arguments are limited to 32768. NUL characters are rejected."
                  },
                  "timeout": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 86400,
                    "default": 3600,
                    "description": "Guest command time limit in seconds."
                  },
                  "cwd": {
                    "type": "string",
                    "pattern": "^/",
                    "description": "Absolute guest directory with no NUL, up to 4096 UTF-8 bytes."
                  },
                  "env": {
                    "type": "object",
                    "maxProperties": 64,
                    "propertyNames": {
                      "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
                    },
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Process-only environment overrides up to 8192 UTF-8 bytes total."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Background job accepted and queued",
            "headers": {
              "Location": {
                "description": "URL to poll the status of this asynchronous operation.",
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Job"
                    }
                  ],
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "description": "Identifier of the accepted asynchronous job or delivery."
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri-reference",
                      "description": "Relative or absolute URL to poll for asynchronous operation status."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/jobs/{job}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "$ref": "#/components/parameters/JobId"
        }
      ],
      "get": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "getJob",
        "description": "Read the current job state. Poll to observe completion after reconnecting.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Job"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      },
      "delete": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "cancelJob",
        "description": "Request cancellation and return the resulting job state.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Job"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/jobs/{job}/logs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "$ref": "#/components/parameters/JobId"
        }
      ],
      "get": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "getJobLogs",
        "description": "Read a snapshot of the retained output. Each stream is limited to 256 KiB.",
        "responses": {
          "200": {
            "description": "Retained output",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobLogs"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/ssh": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "get": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "openSshTunnel",
        "description": "Upgrades an authenticated HTTP/1.1 connection to a bidirectional SSH byte stream to IPv4 loopback port 22 in the selected VM. The guest SSH server authenticates the user independently. Requests must have an empty body. Sessions are limited to 30 minutes, 120 seconds of inactivity, and 64 MiB in each direction.",
        "parameters": [
          {
            "name": "Connection",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "Upgrade"
            },
            "description": "HTTP upgrade connection header (must be 'Upgrade')."
          },
          {
            "name": "Upgrade",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "smolny-ssh"
            },
            "description": "Custom Smolny SSH upgrade protocol header (must be 'smolny-ssh')."
          },
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ],
        "responses": {
          "101": {
            "description": "Switched to the Smolny SSH tunnel",
            "headers": {
              "Connection": {
                "schema": {
                  "type": "string",
                  "const": "Upgrade"
                }
              },
              "Upgrade": {
                "schema": {
                  "type": "string",
                  "const": "smolny-ssh"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/machines/{machine}/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "preview"
        ],
        "operationId": "previewService",
        "description": "Makes an HTTP GET request to the selected port on the guest's IPv4 loopback. Returns the guest response status and up to 256 KiB of body data. Guest redirects are returned without being followed.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Guest HTTP response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "body_base64"
                  ],
                  "properties": {
                    "status": {
                      "type": "integer",
                      "minimum": 200,
                      "maximum": 599
                    },
                    "body_base64": {
                      "type": "string",
                      "contentEncoding": "base64"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "504": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/preview-links": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "preview"
        ],
        "x-smolny-conditional-scopes": {
          "mode=desktop or desktop-view": [
            "exec"
          ]
        },
        "operationId": "createPreviewLink",
        "description": "Issues a bearer link to a fixed guest loopback HTTP port. Preview mode allows read-only browsing. Explicit app mode allows scoped JSON POST and WebSocket upgrades on the public preview origin, with a 64 KiB JSON request limit. Desktop and desktop-view require a desktop VM, port 6080, path /, and a temporary lifetime. Desktop mode returns an interactive HTTPS viewer. Desktop-view delivers 800 × 600 JPEG frames through a dedicated read-only endpoint. The default link is temporary. Opt in to lifetime=machine for a URL that survives API restarts and VM stop/start and is invalidated by revocation, deletion, or an in-place snapshot restore. Each project may have up to 64 active links, with up to 1024 across the service.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewLinkRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Preview link issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewLinkResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/preview-links/{link}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "name": "link",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/PreviewLinkId"
          },
          "description": "Temporary preview or live-desktop link identifier."
        }
      ],
      "delete": {
        "x-smolny-scopes": [
          "preview"
        ],
        "operationId": "deletePreviewLink",
        "description": "Revoke a previously issued temporary or machine-lifetime preview link scoped to this project and VM.",
        "responses": {
          "204": {
            "description": "Preview link revoked"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          },
          {
            "name": "link",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PreviewLinkId"
            },
            "description": "Temporary preview or live-desktop link identifier."
          }
        ]
      }
    },
    "/v1/machines/{machine}/files": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "$ref": "#/components/parameters/GuestFilePath"
        }
      ],
      "get": {
        "x-smolny-scopes": [
          "files:read"
        ],
        "operationId": "downloadFile",
        "description": "Downloads up to 1048576 bytes. Wakes an automatically paused VM.",
        "responses": {
          "200": {
            "description": "Raw file contents",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      },
      "put": {
        "x-smolny-scopes": [
          "files:write"
        ],
        "operationId": "uploadFile",
        "description": "Uploads up to 1048576 bytes with Content-Length. Wakes an automatically paused VM.",
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "File written"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/pause": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "operationId": "pauseMachine",
        "description": "Explicitly freezes a VM. If already automatically frozen, switches it to explicit pause.",
        "requestBody": {
          "$ref": "#/components/requestBodies/OptionalEmptyObject"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Machine"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/resume": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "operationId": "resumeMachine",
        "description": "Resumes a frozen VM and restarts its idle clock if enabled.",
        "requestBody": {
          "$ref": "#/components/requestBodies/OptionalEmptyObject"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Machine"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "operationId": "stopMachine",
        "description": "Gracefully shuts down a running Linux VM and retains its disk, snapshots, and project slot. An already stopped VM is returned unchanged. Frozen VMs require explicit resume before shutdown. Active jobs block shutdown with active_jobs. After a timed-out request, read the machine's state before retrying.",
        "requestBody": {
          "$ref": "#/components/requestBodies/OptionalEmptyObject"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Machine",
            "description": "VM is stopped"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "504": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "operationId": "startMachine",
        "description": "Boots a stopped Linux VM from its existing disk and waits for guest readiness. For an already running VM, waits for readiness without rebooting. Frozen VMs require explicit resume. After a timed-out request, read the machine's state before retrying.",
        "requestBody": {
          "$ref": "#/components/requestBodies/OptionalEmptyObject"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Machine",
            "description": "VM is running and the guest is ready"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "504": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/restart": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "operationId": "restartMachine",
        "description": "Gracefully shuts down a running Linux VM, then boots it from the same disk and waits for guest readiness. Active jobs block restart with active_jobs. Stopped VMs require start and frozen VMs require resume. If the operation fails after shutdown, the VM can remain stopped. After a timed-out request, read its state before retrying.",
        "requestBody": {
          "$ref": "#/components/requestBodies/OptionalEmptyObject"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Machine",
            "description": "VM is running on a fresh boot and the guest is ready"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "504": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/fork": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute",
          "storage"
        ],
        "operationId": "forkMachine",
        "description": "Creates and starts a new machine from the source VM or a named snapshot.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "$ref": "#/components/schemas/Name"
                  },
                  "snapshot": {
                    "$ref": "#/components/schemas/Name"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/Machine"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/snapshots": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "get": {
        "x-smolny-scopes": [
          "read"
        ],
        "operationId": "listSnapshots",
        "responses": {
          "200": {
            "description": "Snapshots of this machine",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "snapshots"
                  ],
                  "properties": {
                    "snapshots": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Snapshot"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      },
      "post": {
        "x-smolny-scopes": [
          "storage"
        ],
        "operationId": "createSnapshot",
        "requestBody": {
          "$ref": "#/components/requestBodies/Name"
        },
        "responses": {
          "201": {
            "description": "Snapshot created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Snapshot"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/snapshots/{snapshot}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "$ref": "#/components/parameters/SnapshotName"
        }
      ],
      "delete": {
        "x-smolny-scopes": [
          "storage",
          "destroy"
        ],
        "operationId": "deleteSnapshot",
        "responses": {
          "204": {
            "description": "Snapshot deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/snapshots/{snapshot}/restore": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "$ref": "#/components/parameters/SnapshotName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute",
          "storage"
        ],
        "operationId": "restoreSnapshot",
        "description": "Creates and starts a new machine from the snapshot using the supplied destination name.",
        "requestBody": {
          "$ref": "#/components/requestBodies/Name"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/Machine"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/snapshots/{snapshot}/restore-in-place": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        },
        {
          "$ref": "#/components/parameters/SnapshotName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "storage",
          "destroy"
        ],
        "operationId": "restoreSnapshotInPlace",
        "summary": "Replace a machine's disk with one of its snapshots",
        "description": "Stops the machine, discards disk changes made after the named disk snapshot, and starts the same machine with the restored disk. The machine name and project stay the same. RAM state is discarded. Active jobs, SSH tunnels, and frozen machines block the restore. Preview links and job IDs issued before the restore become invalid. If the restore fails after stopping, the machine can remain stopped. The restore-to-new endpoint keeps the original disk unchanged.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Machine"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{name}/jobs": {
      "get": {
        "summary": "List retained jobs in this microVM boot",
        "operationId": "listMicroVMBootJobs",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Name"
            },
            "description": "Target resource or microVM name."
          },
          {
            "name": "generation",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/BootGeneration"
            },
            "description": "Monotonic microVM boot generation number."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List retained jobs in this microVM boot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BootJobIndex"
                }
              }
            }
          },
          "400": {
            "description": "Invalid generation, command or byte offset."
          },
          "404": {
            "description": "The project resource or job was not found."
          },
          "409": {
            "description": "The boot changed, is unavailable, or has reached a limit."
          }
        },
        "x-smolny-scopes": [
          "exec"
        ]
      },
      "post": {
        "summary": "Start a detached job in this microVM boot",
        "operationId": "startMicroVMBootJob",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Name"
            },
            "description": "Target resource or microVM name."
          },
          {
            "name": "generation",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/BootGeneration"
            },
            "description": "Monotonic microVM boot generation number."
          }
        ],
        "responses": {
          "202": {
            "description": "Start a detached job in this microVM boot",
            "headers": {
              "Location": {
                "description": "URL to poll the status of this asynchronous operation.",
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BootJob"
                    }
                  ],
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "description": "Identifier of the accepted asynchronous job or delivery."
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri-reference",
                      "description": "Relative or absolute URL to poll for asynchronous operation status."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid generation, command or byte offset."
          },
          "404": {
            "description": "The project resource or job was not found."
          },
          "409": {
            "description": "The boot changed, is unavailable, or has reached a limit."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BootJobCreate"
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ]
      }
    },
    "/v1/microvms/{name}/jobs/{job_id}": {
      "get": {
        "summary": "Get a detached job result",
        "operationId": "getMicroVMBootJob",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Name"
            },
            "description": "Target resource or microVM name."
          },
          {
            "name": "generation",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/BootGeneration"
            },
            "description": "Monotonic microVM boot generation number."
          },
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"
            },
            "description": "Detached boot job identifier."
          }
        ],
        "responses": {
          "200": {
            "description": "Get a detached job result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BootJob"
                }
              }
            }
          },
          "400": {
            "description": "Invalid generation, command or byte offset."
          },
          "404": {
            "description": "The project resource or job was not found."
          },
          "409": {
            "description": "The boot changed, is unavailable, or has reached a limit."
          }
        },
        "x-smolny-scopes": [
          "exec"
        ]
      },
      "delete": {
        "summary": "Request cancellation of the job and its descendants",
        "operationId": "cancelMicroVMBootJob",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Name"
            },
            "description": "Target resource or microVM name."
          },
          {
            "name": "generation",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/BootGeneration"
            },
            "description": "Monotonic microVM boot generation number."
          },
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"
            },
            "description": "Detached boot job identifier."
          }
        ],
        "responses": {
          "200": {
            "description": "Request cancellation of the job and its descendants",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BootJob"
                }
              }
            }
          },
          "400": {
            "description": "Invalid generation, command or byte offset."
          },
          "404": {
            "description": "The project resource or job was not found."
          },
          "409": {
            "description": "The boot changed, is unavailable, or has reached a limit."
          }
        },
        "x-smolny-scopes": [
          "exec"
        ]
      }
    },
    "/v1/microvms/{name}/jobs/{job_id}/logs": {
      "get": {
        "summary": "Read separate retained output streams from byte offsets",
        "operationId": "readMicroVMBootJob",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Name"
            },
            "description": "Target resource or microVM name."
          },
          {
            "name": "generation",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/BootGeneration"
            },
            "description": "Monotonic microVM boot generation number."
          },
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"
            },
            "description": "Detached boot job identifier."
          },
          {
            "name": "stdout_offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 65536,
              "default": 0
            },
            "description": "Byte offset into retained stdout log stream (0-65536)."
          },
          {
            "name": "stderr_offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 65536,
              "default": 0
            },
            "description": "Byte offset into retained stderr log stream (0-65536)."
          }
        ],
        "responses": {
          "200": {
            "description": "Read separate retained output streams from byte offsets",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BootJobLogs"
                }
              }
            }
          },
          "400": {
            "description": "Invalid generation, command or byte offset."
          },
          "404": {
            "description": "The project resource or job was not found."
          },
          "409": {
            "description": "The boot changed, is unavailable, or has reached a limit."
          }
        },
        "x-smolny-scopes": [
          "exec"
        ]
      }
    },
    "/v1/microvms/{machine}/pause": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "operationId": "pauseMicroVM",
        "description": "Pause a running Firecracker microVM, save its memory and disk snapshot, and release host RAM/CPU.",
        "responses": {
          "200": {
            "description": "MicroVM paused and snapshot saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "snapshot_id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/resume": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "operationId": "resumeMicroVM",
        "description": "Resume a paused Firecracker microVM from its saved memory and disk snapshot.",
        "responses": {
          "200": {
            "description": "MicroVM resumed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/snapshot": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "storage"
        ],
        "operationId": "snapshotMicroVM",
        "description": "Create a Firecracker memory and disk snapshot of a running microVM.",
        "responses": {
          "201": {
            "description": "Snapshot created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "snapshot_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/clone": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "compute"
        ],
        "operationId": "cloneMicroVM",
        "description": "Fork a new independent Firecracker microVM from a live microVM or saved snapshot.",
        "responses": {
          "201": {
            "description": "Cloned microVM running",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/microvms/{machine}/exec/stream": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "streamMicroVMCommand",
        "description": "Execute a command inside a Firecracker microVM and stream stdout/stderr/exit events over Server-Sent Events.",
        "requestBody": {
          "$ref": "#/components/requestBodies/Exec"
        },
        "responses": {
          "200": {
            "description": "SSE stream of stdout, stderr, and exit events",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/v1/machines/{machine}/exec/stream": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MachineName"
        }
      ],
      "post": {
        "x-smolny-scopes": [
          "exec"
        ],
        "operationId": "streamMachineCommand",
        "description": "Execute a command inside an Incus VM and stream stdout/stderr/exit events over Server-Sent Events.",
        "requestBody": {
          "$ref": "#/components/requestBodies/Exec"
        },
        "responses": {
          "200": {
            "description": "SSE stream of stdout, stderr, and exit events",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/MachineName"
          }
        ]
      }
    },
    "/install": {
      "get": {
        "operationId": "getInstallerScript",
        "summary": "Download Smolny CLI installer shell script",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/regions": {
      "get": {
        "operationId": "listRegions",
        "summary": "List configured compute regions and health status",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "regions": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/presets": {
      "get": {
        "operationId": "listMicroVMPresets",
        "summary": "List available microVM presets",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "presets": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/presets/{preset}": {
      "get": {
        "operationId": "getMicroVMPreset",
        "summary": "Inspect a microVM preset",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "cpu": {
                      "type": "integer"
                    },
                    "memory_mib": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "preset",
            "in": "path",
            "required": true,
            "description": "MicroVM hardware/image preset name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "preset",
          "in": "path",
          "required": true,
          "description": "MicroVM hardware/image preset name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/auth/agent-signup": {
      "post": {
        "operationId": "startAgentSignup",
        "summary": "Start agent device-flow sign-up",
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "poll_token": {
                      "type": "string"
                    },
                    "verification_url": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Initiate an Agent Sign-up approval request for an autonomous client.",
                "properties": {
                  "client": {
                    "type": "string",
                    "description": "Client or agent identifier requesting access (e.g. 'codex', 'claude-code')."
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Requested API scopes for the issued key."
                  },
                  "label": {
                    "type": "string",
                    "description": "Human-readable label shown to the approving operator."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/agent-signup/{request_id}": {
      "get": {
        "operationId": "getAgentSignupStatus",
        "summary": "Poll agent sign-up status with poll_token",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "api_key": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "description": "Agent Sign-up request identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "request_id",
          "in": "path",
          "required": true,
          "description": "Agent Sign-up request identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/auth/agent-signup/{request_id}/approve": {
      "post": {
        "operationId": "approveAgentSignup",
        "summary": "Approve an agent sign-up request",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "compute"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Approve a pending Agent Sign-up request with optional scope and TTL overrides.",
                "properties": {
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Approved API scopes to grant to the agent key."
                  },
                  "ttl_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "description": "Optional API key lifetime in seconds."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "description": "Agent Sign-up request identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "request_id",
          "in": "path",
          "required": true,
          "description": "Agent Sign-up request identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/auth/agent-signup/{request_id}/deny": {
      "post": {
        "operationId": "denyAgentSignup",
        "summary": "Deny an agent sign-up request",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "compute"
        ],
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "description": "Agent Sign-up request identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "request_id",
          "in": "path",
          "required": true,
          "description": "Agent Sign-up request identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/project/secrets": {
      "get": {
        "operationId": "listProjectSecrets",
        "summary": "List project secret metadata (write-only vault)",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "secrets": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "upsertProjectSecret",
        "summary": "Create or update an encrypted project secret",
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "allowed_domains": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "placeholder": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "compute"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "value",
                  "allowed_domains"
                ],
                "description": "Create or update a write-only Direct Secret bound to allowed outbound domains.",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Unique secret identifier within the project (e.g. 'OPENAI_API_KEY')."
                  },
                  "value": {
                    "type": "string",
                    "description": "Raw secret value stored write-only on the control plane."
                  },
                  "allowed_domains": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Allowed outbound hostnames where the host proxy may inject the secret."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/project/secrets/{name}": {
      "delete": {
        "operationId": "deleteProjectSecret",
        "summary": "Delete a project secret",
        "responses": {
          "204": {
            "description": "Success"
          }
        },
        "x-smolny-scopes": [
          "destroy"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/project/secrets/upload-link": {
      "post": {
        "operationId": "createSecretUploadLink",
        "summary": "Create a one-time browser upload link for a secret",
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "compute"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "allowed_domains"
                ],
                "description": "Create a one-time HTTPS upload link so a human can submit a Direct Secret out of band.",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Secret identifier to populate via the upload link."
                  },
                  "allowed_domains": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Allowed outbound hostnames for the secret."
                  },
                  "ttl_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 86400,
                    "description": "Upload link expiry duration in seconds."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/project/secrets/inject-check": {
      "post": {
        "operationId": "checkSecretInjection",
        "summary": "Dry-run domain-scoped secret placeholder injection",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "allowed": {
                      "type": "boolean"
                    },
                    "matched_secrets": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "target_host",
                  "text"
                ],
                "description": "Dry-run check whether Direct Secret placeholders in text are permitted for target_host.",
                "properties": {
                  "target_host": {
                    "type": "string",
                    "description": "Destination hostname to evaluate against each secret's allowed_domains."
                  },
                  "text": {
                    "type": "string",
                    "description": "Payload or header text containing smolny_sec_... placeholders to inspect."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/microvms/bulk": {
      "post": {
        "operationId": "bulkMicroVMAction",
        "summary": "Run pause, resume, or delete across matching microVMs",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "action": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "compute"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "description": "Apply a lifecycle action across multiple microVMs matched by selector or explicit names.",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "pause",
                      "resume",
                      "stop",
                      "start",
                      "delete"
                    ],
                    "description": "Bulk lifecycle operation to apply."
                  },
                  "selector": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Optional label selector (key-value map) matching target microVMs."
                  },
                  "machines": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Optional explicit list of microVM names to target."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/microvms/{name}/labels": {
      "get": {
        "operationId": "getMicroVMLabels",
        "summary": "Get labels attached to a microVM",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "put": {
        "operationId": "replaceMicroVMLabels",
        "summary": "Replace all labels on a microVM",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "compute"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "labels"
                ],
                "description": "Replace all key-value labels attached to a microVM.",
                "properties": {
                  "labels": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Complete map of label keys to string values."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "mergeMicroVMLabels",
        "summary": "Merge labels on a microVM",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "labels": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "compute"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "labels"
                ],
                "description": "Merge or delete (with null) key-value labels attached to a microVM.",
                "properties": {
                  "labels": {
                    "type": "object",
                    "additionalProperties": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": "Partial map of label keys to string values or null to remove."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/resize": {
      "post": {
        "operationId": "resizeMicroVM",
        "summary": "Resize a microVM while preserving /workspace and /work",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "cpu": {
                      "type": "integer"
                    },
                    "memory_mib": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "compute"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Resize vCPU and/or memory allocation of a microVM.",
                "properties": {
                  "cpu": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 16,
                    "description": "Target vCPU count (1-16)."
                  },
                  "memory_mib": {
                    "type": "integer",
                    "minimum": 256,
                    "maximum": 32768,
                    "description": "Target RAM allocation in MiB (256-32768)."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/auto-sleep": {
      "get": {
        "operationId": "getMicroVMAutoSleep",
        "summary": "Get auto-sleep policy and wake stats",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "idle_timeout_seconds": {
                      "type": "integer"
                    },
                    "always_on": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateMicroVMAutoSleep",
        "summary": "Update idle_timeout_seconds and/or always_on",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "idle_timeout_seconds": {
                      "type": "integer"
                    },
                    "always_on": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "compute"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Update idle auto-sleep timeout or always-on policy for a microVM.",
                "properties": {
                  "idle_timeout_seconds": {
                    "type": "integer",
                    "minimum": 30,
                    "description": "Seconds of inactivity before automatically pausing the microVM."
                  },
                  "always_on": {
                    "type": "boolean",
                    "description": "When true, disables idle auto-sleep so the microVM remains continuously running."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/domains": {
      "get": {
        "operationId": "listMicroVMDomains",
        "summary": "List custom domains bound to a microVM",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "bindMicroVMDomain",
        "summary": "Bind a custom domain to a microVM port",
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string"
                    },
                    "port": {
                      "type": "integer"
                    },
                    "verified": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "preview"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain",
                  "port"
                ],
                "description": "Bind a custom HTTPS domain to a guest TCP port on a microVM.",
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "Fully qualified domain name to bind (e.g. 'app.example.com')."
                  },
                  "port": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535,
                    "description": "Guest TCP port inside the microVM to route traffic to."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/domains/{domain}": {
      "delete": {
        "operationId": "unbindMicroVMDomain",
        "summary": "Unbind a custom domain",
        "responses": {
          "204": {
            "description": "Success"
          }
        },
        "x-smolny-scopes": [
          "preview"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "Custom domain name bound to the microVM.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "domain",
          "in": "path",
          "required": true,
          "description": "Custom domain name bound to the microVM.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/domains/{domain}/verify": {
      "post": {
        "operationId": "verifyMicroVMDomain",
        "summary": "Verify CNAME DNS resolution for a custom domain",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "preview"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "Custom domain name bound to the microVM.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "domain",
          "in": "path",
          "required": true,
          "description": "Custom domain name bound to the microVM.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/computer": {
      "post": {
        "operationId": "executeMicroVMComputerAction",
        "summary": "Execute a Computer Use GUI action (screenshot, click, type, key, scroll)",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "action": {
                      "type": "string"
                    },
                    "image_base64": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "description": "Execute a Computer Use GUI action on a desktop-enabled microVM.",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "screenshot",
                      "click",
                      "double_click",
                      "move",
                      "type",
                      "key",
                      "scroll"
                    ],
                    "description": "GUI action to execute."
                  },
                  "x": {
                    "type": "integer",
                    "description": "Horizontal pixel coordinate for pointer actions."
                  },
                  "y": {
                    "type": "integer",
                    "description": "Vertical pixel coordinate for pointer actions."
                  },
                  "button": {
                    "type": "string",
                    "enum": [
                      "left",
                      "middle",
                      "right"
                    ],
                    "description": "Mouse button for click actions (default 'left')."
                  },
                  "text": {
                    "type": "string",
                    "description": "UTF-8 text string to type when action is 'type'."
                  },
                  "key": {
                    "type": "string",
                    "description": "Key symbol or shortcut (e.g. 'Return', 'ctrl+l') when action is 'key'."
                  },
                  "ctrl": {
                    "type": "boolean",
                    "description": "Hold Control modifier during key or click action."
                  },
                  "alt": {
                    "type": "boolean",
                    "description": "Hold Alt modifier during key or click action."
                  },
                  "shift": {
                    "type": "boolean",
                    "description": "Hold Shift modifier during key or click action."
                  },
                  "delta_y": {
                    "type": "integer",
                    "description": "Vertical scroll delta when action is 'scroll'."
                  },
                  "direction": {
                    "type": "string",
                    "enum": [
                      "up",
                      "down",
                      "left",
                      "right"
                    ],
                    "description": "Scroll direction when action is 'scroll'."
                  },
                  "include_screenshot": {
                    "type": "boolean",
                    "description": "Return a post-action base64 PNG screenshot in the response."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/cdp": {
      "get": {
        "operationId": "getMicroVMCdpVersion",
        "summary": "Ensure Chrome CDP is running and return rewritten /json/version",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webSocketDebuggerUrl": {
                      "type": "string"
                    },
                    "Browser": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/cdp/json/{endpoint}": {
      "get": {
        "operationId": "getMicroVMCdpJson",
        "summary": "Fetch Chrome CDP /json/{version|list|new|protocol} with rewritten ws_url",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": true
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endpoint",
            "in": "path",
            "required": true,
            "description": "Chrome DevTools Protocol JSON endpoint name (version, list, new, protocol).",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "endpoint",
          "in": "path",
          "required": true,
          "description": "Chrome DevTools Protocol JSON endpoint name (version, list, new, protocol).",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/cdp/ws/{path}": {
      "get": {
        "operationId": "proxyMicroVMCdpWebSocket",
        "summary": "WebSocket proxy tunnel to guest Chrome CDP on port 9222",
        "responses": {
          "101": {
            "description": "Success"
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "Chrome DevTools Protocol WebSocket path segment.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "path",
          "in": "path",
          "required": true,
          "description": "Chrome DevTools Protocol WebSocket path segment.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/browser-use": {
      "post": {
        "operationId": "runMicroVMBrowserUse",
        "summary": "Run browser-use task or return ready Chrome CDP URLs",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cdp_url": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "task"
                ],
                "description": "Run an autonomous Browser Use task against Chrome inside the microVM.",
                "properties": {
                  "task": {
                    "type": "string",
                    "description": "Natural-language browser automation goal to accomplish."
                  },
                  "model": {
                    "type": "string",
                    "description": "LLM model identifier used to drive browser steps."
                  },
                  "max_steps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "description": "Maximum number of browser agent steps before stopping."
                  },
                  "port": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535,
                    "description": "Guest Chrome CDP port (default 9222)."
                  },
                  "proxy": {
                    "type": "string",
                    "description": "Optional HTTP/SOCKS proxy URL for browser traffic."
                  },
                  "timeout": {
                    "type": "integer",
                    "minimum": 5,
                    "maximum": 1800,
                    "description": "Overall task timeout in seconds."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/agent-sessions": {
      "get": {
        "operationId": "listAgentSessions",
        "summary": "List background agent sessions",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sessions": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "startAgentSession",
        "summary": "Start a detached background agent session in a microVM",
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "microvm": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "machine"
                ],
                "description": "Start a detached background coding agent session inside a microVM.",
                "properties": {
                  "machine": {
                    "type": "string",
                    "description": "Target microVM name."
                  },
                  "agent": {
                    "type": "string",
                    "description": "Agent preset to run (e.g. 'claude', 'codex', 'opencode', 'shell')."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Task prompt for the coding agent."
                  },
                  "command": {
                    "type": "string",
                    "description": "Explicit shell command to run when using custom/shell mode."
                  },
                  "repo_url": {
                    "type": "string",
                    "description": "Optional Git repository URL to clone before starting."
                  },
                  "branch": {
                    "type": "string",
                    "description": "Optional Git branch to check out."
                  },
                  "env": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Optional environment variables passed into the session."
                  },
                  "workdir": {
                    "type": "string",
                    "description": "Working directory inside the microVM (default '/workspace')."
                  },
                  "timeout": {
                    "type": "integer",
                    "minimum": 10,
                    "maximum": 86400,
                    "description": "Maximum session duration in seconds."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent-sessions/{session_id}": {
      "get": {
        "operationId": "getAgentSession",
        "summary": "Get background agent session status and steer summary",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "microvm": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "description": "Background agent session identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "session_id",
          "in": "path",
          "required": true,
          "description": "Background agent session identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/agent-sessions/{session_id}/logs": {
      "get": {
        "operationId": "getAgentSessionLogs",
        "summary": "Stream agent session SSE logs and structured steps (pass ?follow=false for snapshot)",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "description": "Background agent session identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "session_id",
          "in": "path",
          "required": true,
          "description": "Background agent session identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/agent-sessions/steer-bulk": {
      "post": {
        "operationId": "steerAgentSessionsBulk",
        "summary": "Broadcast a live steering instruction to selected or all active agent sessions",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message"
                ],
                "description": "Broadcast a mid-turn steering instruction to multiple active agent sessions.",
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "Steering instruction to deliver to each matched session."
                  },
                  "session_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Optional list of specific session IDs; omits or empty targets all active sessions."
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "normal",
                      "high",
                      "urgent"
                    ],
                    "description": "Delivery priority for the steering message."
                  },
                  "source": {
                    "type": "string",
                    "description": "Optional caller identifier recorded in the session audit log."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent-sessions/{session_id}/steer": {
      "post": {
        "operationId": "steerAgentSession",
        "summary": "Send a live steering instruction to a running agent session",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "steer_id": {
                      "type": "string"
                    },
                    "session_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message"
                ],
                "description": "Send a mid-turn steering instruction to a running background agent session.",
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "Steering instruction or updated guidance for the agent."
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "normal",
                      "high",
                      "urgent"
                    ],
                    "description": "Delivery priority for the steering message (default 'normal')."
                  },
                  "source": {
                    "type": "string",
                    "description": "Optional caller identifier recorded in the session audit log."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "description": "Background agent session identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "session_id",
          "in": "path",
          "required": true,
          "description": "Background agent session identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/agent-sessions/{session_id}/steers": {
      "get": {
        "operationId": "listAgentSessionSteers",
        "summary": "List steering instructions sent to an agent session",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "steers": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "description": "Background agent session identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "session_id",
          "in": "path",
          "required": true,
          "description": "Background agent session identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/agent-sessions/{session_id}/steps": {
      "get": {
        "operationId": "listAgentSessionSteps",
        "summary": "List structured steps (thought, tool_call, command, diff, steer, abort) for an agent session",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "description": "Background agent session identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "session_id",
          "in": "path",
          "required": true,
          "description": "Background agent session identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/agent-sessions/{session_id}/abort": {
      "post": {
        "operationId": "abortAgentSession",
        "summary": "Abort a running agent session cleanly",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Abort a running background agent session with an optional reason.",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Optional human-readable reason for aborting the session."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "description": "Background agent session identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "session_id",
          "in": "path",
          "required": true,
          "description": "Background agent session identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/agent-sessions/{session_id}/stop": {
      "post": {
        "operationId": "stopAgentSession",
        "summary": "Stop a running agent session",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "exec"
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "description": "Background agent session identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "session_id",
          "in": "path",
          "required": true,
          "description": "Background agent session identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/billing/balance": {
      "get": {
        "operationId": "getBillingBalance",
        "summary": "Get project billing balance and rates",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "balance_rub": {
                      "type": "number"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/billing/usage": {
      "get": {
        "operationId": "getBillingUsage",
        "summary": "Get live and historical VM billing usage",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "usage": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "total_rub": {
                      "type": "number"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/billing/ledger": {
      "get": {
        "operationId": "getBillingLedger",
        "summary": "Get project billing ledger entries",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/billing/topup": {
      "post": {
        "operationId": "createBillingTopup",
        "summary": "Create a balance top-up request",
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "topup_id": {
                      "type": "string"
                    },
                    "amount_rub": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-smolny-scopes": [
          "compute"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount_rub"
                ],
                "description": "Create a RUB balance top-up checkout session for the project.",
                "properties": {
                  "amount_rub": {
                    "type": "number",
                    "minimum": 1,
                    "description": "Top-up amount in Russian rubles (RUB)."
                  },
                  "provider": {
                    "type": "string",
                    "description": "Payment provider identifier (e.g. 'yookassa', 'invoice')."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/desktop-swarm/health": {
      "get": {
        "operationId": "desktopSwarmHealth",
        "summary": "Check high-density drumsd desktop swarm health",
        "x-smolny-scope": "read",
        "responses": {
          "200": {
            "description": "Desktop swarm health and capacity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "healthy": {
                      "type": "boolean"
                    },
                    "capacity": {
                      "type": "integer"
                    },
                    "active_slots": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/desktop-swarm/desktops": {
      "get": {
        "operationId": "listDesktopSwarm",
        "summary": "List active high-density Linux desktops in the project",
        "x-smolny-scope": "read",
        "responses": {
          "200": {
            "description": "List of active desktop slots",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "desktops": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createDesktopSwarm",
        "summary": "Create 1 to 64 isolated CRIU Linux desktops in parallel",
        "x-smolny-scope": "write",
        "responses": {
          "201": {
            "description": "Created desktop slots",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "desktops": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/desktop-swarm/desktops/{slot_id}": {
      "delete": {
        "operationId": "deleteDesktopSwarmSlot",
        "summary": "Destroy a high-density desktop slot",
        "x-smolny-scope": "write",
        "responses": {
          "204": {
            "description": "Desktop slot destroyed"
          }
        },
        "parameters": [
          {
            "name": "slot_id",
            "in": "path",
            "required": true,
            "description": "High-density desktop swarm slot identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "slot_id",
          "in": "path",
          "required": true,
          "description": "High-density desktop swarm slot identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/desktop-swarm/desktops/{slot_id}/step": {
      "post": {
        "operationId": "stepDesktopSwarmSlot",
        "summary": "Run a pyautogui or shell action inside a desktop slot",
        "x-smolny-scope": "write",
        "responses": {
          "200": {
            "description": "Action result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "slot_id": {
                      "type": "string"
                    },
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slot_id",
            "in": "path",
            "required": true,
            "description": "High-density desktop swarm slot identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "slot_id",
          "in": "path",
          "required": true,
          "description": "High-density desktop swarm slot identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/desktop-swarm/desktops/{slot_id}/fork": {
      "post": {
        "operationId": "forkDesktopSwarmSlot",
        "summary": "Fork a live desktop slot into up to 16 independent branches",
        "x-smolny-scope": "write",
        "responses": {
          "201": {
            "description": "Forked child slots",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "parent_slot_id": {
                      "type": "string"
                    },
                    "children": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slot_id",
            "in": "path",
            "required": true,
            "description": "High-density desktop swarm slot identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "slot_id",
          "in": "path",
          "required": true,
          "description": "High-density desktop swarm slot identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/desktop-swarm/desktops/{slot_id}/reset": {
      "post": {
        "operationId": "resetDesktopSwarmSlot",
        "summary": "Reset a desktop slot to its clean checkpoint in under 1 second",
        "x-smolny-scope": "write",
        "responses": {
          "200": {
            "description": "Slot reset",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "slot_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slot_id",
            "in": "path",
            "required": true,
            "description": "High-density desktop swarm slot identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "slot_id",
          "in": "path",
          "required": true,
          "description": "High-density desktop swarm slot identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/desktop-swarm/desktops/{slot_id}/screenshot": {
      "get": {
        "operationId": "screenshotDesktopSwarmSlot",
        "summary": "Capture a 1920x1080 PNG screenshot of a desktop slot",
        "x-smolny-scope": "read",
        "responses": {
          "200": {
            "description": "Base64-encoded PNG screenshot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "slot_id": {
                      "type": "string"
                    },
                    "image_base64": {
                      "type": "string"
                    },
                    "mime_type": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slot_id",
            "in": "path",
            "required": true,
            "description": "High-density desktop swarm slot identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "slot_id",
          "in": "path",
          "required": true,
          "description": "High-density desktop swarm slot identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/verso/health": {
      "get": {
        "operationId": "getVersoHealth",
        "summary": "Check Verso Tier-1 CoW sandbox runtime health",
        "responses": {
          "200": {
            "description": "Runtime availability and tenant sandbox count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available": {
                      "type": "boolean"
                    },
                    "active_sandboxes": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/verso/sandboxes": {
      "get": {
        "operationId": "listVersoSandboxes",
        "summary": "List tenant Verso CoW sandboxes",
        "responses": {
          "200": {
            "description": "List of active Verso sandboxes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sandboxes": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createVersoSandbox",
        "summary": "Create a Tier-1 kernel-confined CoW sandbox via verso rpc",
        "responses": {
          "201": {
            "description": "Created Verso sandbox",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/verso/sandboxes/{id}": {
      "delete": {
        "operationId": "deleteVersoSandbox",
        "summary": "Destroy a Verso CoW sandbox",
        "responses": {
          "204": {
            "description": "Sandbox destroyed"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique sandbox or resource identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Unique sandbox or resource identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/verso/sandboxes/{id}/fork": {
      "post": {
        "operationId": "forkVersoSandbox",
        "summary": "O(1) Copy-on-Write fork of a Verso sandbox into up to 32 isolated branches",
        "responses": {
          "201": {
            "description": "Forked child sandbox IDs and fork latency",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "parent_id": {
                      "type": "string"
                    },
                    "children": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "fork_ms": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique sandbox or resource identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Unique sandbox or resource identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/verso/sandboxes/{id}/exec": {
      "post": {
        "operationId": "execVersoSandbox",
        "summary": "Execute a shell command inside a Verso sandbox",
        "responses": {
          "200": {
            "description": "Command exit code, stdout, stderr",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "exit_code": {
                      "type": "integer"
                    },
                    "stdout": {
                      "type": "string"
                    },
                    "stderr": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique sandbox or resource identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Unique sandbox or resource identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/verso/sandboxes/{id}/diff": {
      "get": {
        "operationId": "diffVersoSandbox",
        "summary": "Inspect Copy-on-Write diff for a Verso sandbox",
        "responses": {
          "200": {
            "description": "Diff output",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "diff": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique sandbox or resource identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Unique sandbox or resource identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/verso/sandboxes/{id}/commit": {
      "post": {
        "operationId": "commitVersoSandbox",
        "summary": "Commit verified Verso sandbox diff to host directory (opt-in)",
        "responses": {
          "200": {
            "description": "Commit result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "committed": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Commit disabled"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique sandbox or resource identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Unique sandbox or resource identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/verso/sandboxes/{id}/files": {
      "get": {
        "operationId": "readVersoSandboxFile",
        "summary": "Read a file from a Verso sandbox (?path=...)",
        "responses": {
          "200": {
            "description": "File contents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "content": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique sandbox or resource identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "put": {
        "operationId": "writeVersoSandboxFile",
        "summary": "Write a file inside a Verso sandbox",
        "responses": {
          "200": {
            "description": "Write confirmation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "written": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique sandbox or resource identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Unique sandbox or resource identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/pricing": {
      "get": {
        "operationId": "getPricingPage",
        "summary": "Public pricing, competitor comparison, and verified HOSTKEY EU benchmarks showcase (HTML)",
        "responses": {
          "200": {
            "description": "HTML pricing and benchmarks page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/pricing": {
      "get": {
        "operationId": "getPricingJson",
        "summary": "Machine-readable RUB pricing, free-pause rules, 2000 RUB starter credit, and verified benchmarks",
        "responses": {
          "200": {
            "description": "Pricing JSON payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string"
                    },
                    "trial_rub": {
                      "type": "number"
                    },
                    "rates": {
                      "type": "object"
                    },
                    "benchmarks": {
                      "type": "object"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/skill": {
      "get": {
        "operationId": "getAgentSkillMarkdown",
        "summary": "Canonical self-installing Smolny Agent Skill (SKILL.md)",
        "responses": {
          "200": {
            "description": "Markdown skill document",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/mcp": {
      "get": {
        "operationId": "getHostedMcpMetadata",
        "summary": "Hosted Streamable HTTP MCP server metadata",
        "responses": {
          "200": {
            "description": "MCP metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "protocolVersion": {
                      "type": "string"
                    },
                    "transport": {
                      "type": "string"
                    },
                    "tools_count": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "callHostedMcpJsonRpc",
        "summary": "Hosted Streamable HTTP MCP JSON-RPC 2.0 endpoint",
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": {
                      "type": "string"
                    },
                    "id": {},
                    "result": {
                      "type": "object"
                    },
                    "error": {
                      "type": "object"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/platform/security-policy": {
      "get": {
        "operationId": "getPlatformSecurityPolicy",
        "summary": "Default-deny egress, host-proxy Direct Secrets, and read-only package cache security policy",
        "responses": {
          "200": {
            "description": "Security policy summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "egress_default": {
                      "type": "string"
                    },
                    "direct_secrets": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/project/secrets/proxy": {
      "post": {
        "operationId": "proxyRequestWithProjectSecrets",
        "summary": "Execute an outbound HTTPS request on the host with domain-scoped Direct Secrets substitution",
        "responses": {
          "200": {
            "description": "Upstream response with echoed secrets redacted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer"
                    },
                    "headers": {
                      "type": "object"
                    },
                    "body": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Direct Secret placeholder denied for target domain or SSRF blocked"
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/compat/e2b/sandboxes": {
      "get": {
        "operationId": "listE2bCompatSandboxes",
        "summary": "E2B-compatible sandbox listing",
        "responses": {
          "200": {
            "description": "List of sandboxes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createE2bCompatSandbox",
        "summary": "E2B-compatible sandbox creation backed by Smolny microVM",
        "responses": {
          "201": {
            "description": "Created sandbox",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sandboxID": {
                      "type": "string"
                    },
                    "templateID": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/compat/e2b/sandboxes/{sandboxID}/commands": {
      "post": {
        "operationId": "execE2bCompatCommand",
        "summary": "E2B-compatible command execution",
        "responses": {
          "200": {
            "description": "Command result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "exitCode": {
                      "type": "integer"
                    },
                    "stdout": {
                      "type": "string"
                    },
                    "stderr": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "sandboxID",
            "in": "path",
            "required": true,
            "description": "E2B-compatible sandbox identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "sandboxID",
          "in": "path",
          "required": true,
          "description": "E2B-compatible sandbox identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/compat/daytona/sandbox": {
      "get": {
        "operationId": "listDaytonaCompatSandboxes",
        "summary": "Daytona-compatible sandbox listing",
        "responses": {
          "200": {
            "description": "List of sandboxes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createDaytonaCompatSandbox",
        "summary": "Daytona-compatible sandbox creation backed by Smolny microVM",
        "responses": {
          "201": {
            "description": "Created sandbox",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/compat/daytona/sandbox/{id}/process/execute": {
      "post": {
        "operationId": "execDaytonaCompatCommand",
        "summary": "Daytona-compatible command execution",
        "responses": {
          "200": {
            "description": "Command result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "exitCode": {
                      "type": "integer"
                    },
                    "result": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique sandbox or resource identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Unique sandbox or resource identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/browser/batch": {
      "post": {
        "operationId": "executeMicroVMBrowserBatch",
        "summary": "Execute N browser/CDP actions in 1 round trip via on-box daemon (<=14ms target)",
        "tags": [
          "Browser Use"
        ],
        "responses": {
          "200": {
            "description": "Batch execution result with latency telemetry",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "elapsed_ms": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/browser/daemon/start": {
      "post": {
        "operationId": "startMicroVMBrowserDaemon",
        "summary": "Start persistent on-box CDP batch multiplexer daemon inside microVM",
        "tags": [
          "Browser Use"
        ],
        "responses": {
          "200": {
            "description": "Daemon running",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "running": {
                      "type": "boolean"
                    },
                    "socket": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/browser/benchmark": {
      "get": {
        "operationId": "benchmarkMicroVMBrowserBatch",
        "summary": "Run 50-call on-box Browser Use benchmark (1 round trip vs 50 sequential)",
        "tags": [
          "Browser Use"
        ],
        "responses": {
          "200": {
            "description": "Benchmark latency report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batch_ms": {
                      "type": "number"
                    },
                    "sequential_ms": {
                      "type": "number"
                    },
                    "speedup": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/checkpoints": {
      "get": {
        "operationId": "listMicroVMCheckpoints",
        "summary": "List live checkpoints for a microVM",
        "tags": [
          "Live Checkpoints"
        ],
        "responses": {
          "200": {
            "description": "List of checkpoints",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkpoints": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createMicroVMCheckpoint",
        "summary": "Create live checkpoint with Postgres/Redis quiesce/fsync without process restart",
        "tags": [
          "Live Checkpoints"
        ],
        "responses": {
          "201": {
            "description": "Checkpoint created with quiesce receipt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkpoint_id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/checkpoints/{checkpoint_id}": {
      "get": {
        "operationId": "getMicroVMCheckpoint",
        "summary": "Get live checkpoint details",
        "tags": [
          "Live Checkpoints"
        ],
        "responses": {
          "200": {
            "description": "Checkpoint record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkpoint_id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "checkpoint_id",
            "in": "path",
            "required": true,
            "description": "Live microVM checkpoint identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "delete": {
        "operationId": "deleteMicroVMCheckpoint",
        "summary": "Delete a live checkpoint",
        "tags": [
          "Live Checkpoints"
        ],
        "responses": {
          "204": {
            "description": "Checkpoint deleted"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "checkpoint_id",
            "in": "path",
            "required": true,
            "description": "Live microVM checkpoint identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "checkpoint_id",
          "in": "path",
          "required": true,
          "description": "Live microVM checkpoint identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/checkpoints/{checkpoint_id}/rollback": {
      "post": {
        "operationId": "rollbackMicroVMCheckpoint",
        "summary": "Instantly rollback microVM to a live checkpoint and verify DB health",
        "tags": [
          "Live Checkpoints"
        ],
        "responses": {
          "200": {
            "description": "Rollback completed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkpoint_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "checkpoint_id",
            "in": "path",
            "required": true,
            "description": "Live microVM checkpoint identifier.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        },
        {
          "name": "checkpoint_id",
          "in": "path",
          "required": true,
          "description": "Live microVM checkpoint identifier.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/fork-db": {
      "post": {
        "operationId": "provisionMicroVMForkDb",
        "summary": "Provision isolated per-fork Postgres/Redis database template",
        "tags": [
          "Live Checkpoints"
        ],
        "responses": {
          "201": {
            "description": "Isolated fork database provisioned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "database": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Target resource or microVM name.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "description": "Target resource or microVM name.",
          "schema": {
            "type": "string"
          }
        }
      ]
    },
    "/v1/microvms/{name}/health": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "MicroVM name"
        }
      ],
      "get": {
        "operationId": "getMicrovmHealth",
        "summary": "Get structured Disposable Hands health, crash/OOM telemetry, and checkpoint recoverability for a microVM",
        "tags": [
          "Disposable Hands"
        ],
        "x-smolny-scopes": [
          "read"
        ],
        "parameters": [
          {
            "name": "probe_dmesg",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, probe guest dmesg for kernel OOM-killer events."
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "MicroVM name"
          }
        ],
        "responses": {
          "200": {
            "description": "Structured microVM health and recovery status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "oom_killed": {
                      "type": "boolean"
                    },
                    "last_signal": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "crash_count": {
                      "type": "integer"
                    },
                    "oom_count": {
                      "type": "integer"
                    },
                    "recovery_count": {
                      "type": "integer"
                    },
                    "last_checkpoint_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "checkpoint_count": {
                      "type": "integer"
                    },
                    "recoverable": {
                      "type": "boolean"
                    },
                    "recovery_endpoint": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/microvms/{name}/recover": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "MicroVM name"
        }
      ],
      "post": {
        "operationId": "recoverMicrovm",
        "summary": "Roll back a degraded or crashed microVM to a live checkpoint and reset health state",
        "tags": [
          "Disposable Hands"
        ],
        "x-smolny-scopes": [
          "compute"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "checkpoint_id": {
                    "type": "string",
                    "description": "Specific checkpoint ID to roll back to (defaults to latest checkpoint)."
                  },
                  "label": {
                    "type": "string",
                    "description": "Optional checkpoint label to resolve when checkpoint_id is omitted."
                  },
                  "verify_dbs": {
                    "type": "boolean",
                    "default": true,
                    "description": "Verify Postgres/Redis health after rollback."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MicroVM recovered from checkpoint and health reset",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recovered": {
                      "type": "boolean"
                    },
                    "checkpoint_id": {
                      "type": "string"
                    },
                    "generation": {
                      "type": "integer"
                    },
                    "recovery_count": {
                      "type": "integer"
                    },
                    "rollback_ms": {
                      "type": "number"
                    },
                    "previous_status": {
                      "type": "string"
                    },
                    "health": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "description": "No checkpoint exists for recovery",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "MicroVM name"
          }
        ]
      }
    },
    "/v1/microvms/{name}/export-patch": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "MicroVM name"
        }
      ],
      "post": {
        "operationId": "exportMicrovmPatch",
        "summary": "Non-destructively extract a unified git diff and untracked files from a microVM",
        "tags": [
          "Disposable Hands"
        ],
        "x-smolny-scopes": [
          "exec"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workdir": {
                    "type": "string",
                    "default": "/workspace",
                    "description": "Git repository directory inside the microVM."
                  },
                  "base_ref": {
                    "type": "string",
                    "description": "Optional git base ref to diff against (defaults to HEAD)."
                  },
                  "include_untracked": {
                    "type": "boolean",
                    "default": true,
                    "description": "Include untracked files in the exported patch."
                  },
                  "max_bytes": {
                    "type": "integer",
                    "description": "Maximum patch size in bytes."
                  },
                  "timeout": {
                    "type": "integer",
                    "description": "Command timeout in seconds."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Extracted unified patch and repository metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "patch": {
                      "type": "string"
                    },
                    "patch_sha256": {
                      "type": "string"
                    },
                    "patch_bytes": {
                      "type": "integer"
                    },
                    "files_changed": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "untracked_files": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "has_changes": {
                      "type": "boolean"
                    },
                    "head_sha": {
                      "type": "string"
                    },
                    "branch": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "MicroVM name"
          }
        ]
      }
    },
    "/v1/microvms/{name}/export-pr": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "MicroVM name"
        }
      ],
      "post": {
        "operationId": "exportMicrovmPr",
        "summary": "Extract patch from a microVM and open a GitHub PR strictly on the control plane using a domain-scoped Direct Secret (never injecting tokens into the microVM)",
        "tags": [
          "Disposable Hands"
        ],
        "x-smolny-scopes": [
          "exec"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "repo",
                  "title"
                ],
                "properties": {
                  "repo": {
                    "type": "string",
                    "description": "Target GitHub repository in owner/repo format."
                  },
                  "title": {
                    "type": "string",
                    "description": "Pull request title."
                  },
                  "body": {
                    "type": "string",
                    "description": "Optional pull request description."
                  },
                  "workdir": {
                    "type": "string",
                    "default": "/workspace",
                    "description": "Git repository directory inside the microVM."
                  },
                  "base_branch": {
                    "type": "string",
                    "description": "Target base branch on GitHub."
                  },
                  "head_branch": {
                    "type": "string",
                    "description": "Branch name to create/push on the control plane."
                  },
                  "base_ref": {
                    "type": "string",
                    "description": "Optional git base ref inside the microVM to diff against."
                  },
                  "include_untracked": {
                    "type": "boolean",
                    "default": true,
                    "description": "Include untracked files in the exported patch."
                  },
                  "secret_name": {
                    "type": "string",
                    "description": "Name of the domain-scoped Direct Secret holding the GitHub token (resolved strictly on the control plane)."
                  },
                  "github_host": {
                    "type": "string",
                    "description": "GitHub hostname (defaults to github.com)."
                  },
                  "dry_run": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, extract and validate the patch without pushing or opening a PR."
                  },
                  "draft": {
                    "type": "boolean",
                    "default": false,
                    "description": "Open the pull request as a draft."
                  },
                  "timeout": {
                    "type": "integer",
                    "description": "Command timeout in seconds."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Patch extracted and control-plane GitHub PR created (or dry-run validated)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pr_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "pr_number": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "dry_run": {
                      "type": "boolean"
                    },
                    "patch_sha256": {
                      "type": "string"
                    },
                    "patch_bytes": {
                      "type": "integer"
                    },
                    "files_changed": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "head_branch": {
                      "type": "string"
                    },
                    "base_branch": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "MicroVM name"
          }
        ]
      }
    },
    "/v1/pipelines/sync": {
      "post": {
        "operationId": "syncPipelineRepo",
        "summary": "Incremental repository sync (delta manifest) into a base microVM",
        "tags": [
          "Coding Pipeline"
        ],
        "responses": {
          "200": {
            "description": "Sync manifest result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "synced": {
                      "type": "boolean"
                    },
                    "files_updated": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/pipelines/fork-test-export": {
      "post": {
        "operationId": "runPipelineForkTestExport",
        "summary": "Fork N microVMs, run tests in parallel, rank winner, export git patch or GitHub PR",
        "tags": [
          "Coding Pipeline"
        ],
        "responses": {
          "200": {
            "description": "Pipeline result with winner diff/patch/PR",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "winner": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "patch": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Request-Id",
            "in": "header",
            "required": false,
            "description": "Optional client-supplied correlation identifier for tracing and idempotent debugging.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/wall": {
      "get": {
        "operationId": "getLiveWallSnapshot",
        "summary": "Live Desktop & VM Wall snapshot with real-time ticking RUB cost",
        "tags": [
          "Live Wall"
        ],
        "responses": {
          "200": {
            "description": "Unified wall snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "machines": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "total_cost_rub": {
                      "type": "number"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/browser-profiles": {
      "get": {
        "operationId": "listBrowserProfiles",
        "x-smolny-scopes": [
          "read"
        ],
        "summary": "List persistent browser profiles (auth contexts) in the project",
        "tags": [
          "Browser Profiles"
        ],
        "responses": {
          "200": {
            "description": "Project browser profiles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profiles": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor returned by a previous page's next_cursor field.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createBrowserProfile",
        "x-smolny-scopes": [
          "compute"
        ],
        "summary": "Create a persistent browser profile (auth context) for authenticated Chrome/Chromium sessions",
        "tags": [
          "Browser Profiles"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "region": {
                    "type": "string",
                    "description": "Optional region pinning (e.g. 'ru' or 'eu') to avoid IP-mismatch logouts."
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 256
                  },
                  "guest_profile_dir": {
                    "type": "string",
                    "default": "/var/lib/smolny-browser-profile"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Browser profile created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/browser-profiles/{name}": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
          },
          "description": "Target resource or microVM name."
        }
      ],
      "get": {
        "operationId": "getBrowserProfile",
        "x-smolny-scopes": [
          "read"
        ],
        "summary": "Get metadata and lease state for a browser profile",
        "tags": [
          "Browser Profiles"
        ],
        "responses": {
          "200": {
            "description": "Browser profile metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "size_bytes": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
            },
            "description": "Target resource or microVM name."
          }
        ]
      },
      "delete": {
        "operationId": "deleteBrowserProfile",
        "x-smolny-scopes": [
          "destroy"
        ],
        "summary": "Delete a browser profile and its encrypted archive (fails with 409 if persist-locked)",
        "tags": [
          "Browser Profiles"
        ],
        "responses": {
          "204": {
            "description": "Browser profile deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
            },
            "description": "Target resource or microVM name."
          }
        ]
      }
    },
    "/v1/browser-profiles/{name}/save": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
          },
          "description": "Target resource or microVM name."
        }
      ],
      "post": {
        "operationId": "saveBrowserProfileFromVm",
        "x-smolny-scopes": [
          "exec"
        ],
        "summary": "Capture the Chrome/Chromium profile directory from a running microVM into the browser profile",
        "tags": [
          "Browser Profiles"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "vm_id": {
                    "type": "string",
                    "description": "Source running microVM name."
                  },
                  "microvm": {
                    "type": "string",
                    "description": "Alias for vm_id."
                  },
                  "guest_profile_dir": {
                    "type": "string",
                    "description": "Optional override for guest Chrome profile directory."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated browser profile metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "saved_at": {
                      "type": "string"
                    },
                    "size_bytes": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
            },
            "description": "Target resource or microVM name."
          }
        ]
      }
    },
    "/v1/microvms/{name}/browser-profile/sync": {
      "parameters": [
        {
          "name": "name",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Target resource or microVM name."
        }
      ],
      "post": {
        "operationId": "syncMicrovmBrowserProfile",
        "x-smolny-scopes": [
          "exec"
        ],
        "summary": "Sync an attached persist-mode browser profile from a running microVM back to storage",
        "tags": [
          "Browser Profiles"
        ],
        "responses": {
          "200": {
            "description": "Synced browser profile metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "synced": {
                      "type": "boolean"
                    },
                    "profile": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Target resource or microVM name."
          }
        ]
      }
    }
  },
  "components": {
    "headers": {
      "VMReady": {
        "description": "Durations in milliseconds. vm-ready measures API processing through guest readiness. When a first command is requested, guest-command measures the guest operation through its result or error, and create-to-command measures total API processing.",
        "schema": {
          "type": "string"
        },
        "example": "vm-ready;dur=34.280, guest-command;dur=5.340, create-to-command;dur=41.027"
      },
      "MicroVMCreateTiming": {
        "description": "Durations in milliseconds. Without a first command, vm-ready measures API processing through guest readiness. With a first command, microvm-alloc measures broker allocation through readiness, guest-command measures the guest exchange through the command result, and create-to-command measures API processing through receipt of that result.",
        "schema": {
          "type": "string"
        },
        "example": "microvm-alloc;dur=34.280, guest-command;dur=5.340, create-to-command;dur=41.027"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Project bearer credential. Use a scoped sak_ agent key for an integration, or an sma_ customer credential on the trusted api.smolny.tech origin to manage your credentials."
      }
    },
    "parameters": {
      "SshSessionId": {
        "name": "session",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[0-9a-f]{32}$"
        },
        "description": "Hexadecimal SSH tunnel session identifier."
      },
      "WorkspaceId": {
        "name": "workspace",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Name"
        },
        "description": "Unique workspace identifier within the project."
      },
      "WorkVolumeName": {
        "in": "path",
        "name": "volume",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Name"
        },
        "description": "Name of the persistent workspace volume."
      },
      "WorkSnapshotName": {
        "in": "path",
        "name": "snapshot",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Name"
        },
        "description": "Name of the workspace volume snapshot."
      },
      "MachineName": {
        "name": "machine",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Name"
        },
        "description": "Unique machine or microVM name within the project."
      },
      "SnapshotName": {
        "name": "snapshot",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Name"
        },
        "description": "Name of the machine or microVM snapshot."
      },
      "JobId": {
        "name": "job",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Name"
        },
        "description": "Unique background job identifier."
      },
      "GuestFilePath": {
        "name": "path",
        "in": "query",
        "required": true,
        "description": "Absolute guest file path with no empty, dot, or dot-dot segments or control characters.",
        "schema": {
          "type": "string",
          "minLength": 2,
          "maxLength": 4096,
          "pattern": "^/"
        }
      }
    },
    "requestBodies": {
      "InvitationProof": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "invitation",
                "recovery_secret"
              ],
              "additionalProperties": false,
              "properties": {
                "invitation": {
                  "type": "string",
                  "format": "password",
                  "pattern": "^smi_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"
                },
                "recovery_secret": {
                  "type": "string",
                  "format": "password",
                  "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
                }
              }
            }
          }
        }
      },
      "RegistrationProof": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "invitation",
                "recovery_secret"
              ],
              "additionalProperties": false,
              "properties": {
                "invitation": {
                  "type": "string",
                  "format": "password",
                  "pattern": "^smr_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"
                },
                "recovery_secret": {
                  "type": "string",
                  "format": "password",
                  "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
                }
              }
            }
          }
        }
      },
      "WorkVolumeName": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "name"
              ],
              "additionalProperties": false,
              "properties": {
                "name": {
                  "$ref": "#/components/schemas/Name"
                }
              }
            }
          }
        }
      },
      "Name": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "name"
              ],
              "additionalProperties": false,
              "properties": {
                "name": {
                  "$ref": "#/components/schemas/Name"
                }
              }
            }
          }
        }
      },
      "Exec": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ExecCommand"
            }
          }
        }
      },
      "SshPublicKey": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "public_key"
              ],
              "additionalProperties": false,
              "properties": {
                "public_key": {
                  "type": "string",
                  "pattern": "^ssh-ed25519 [A-Za-z0-9+/]{68}$"
                }
              }
            }
          }
        }
      },
      "OptionalEmptyObject": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": false
            }
          }
        }
      }
    },
    "responses": {
      "CustomerRegistration": {
        "description": "Customer sign-in credential. Store it privately.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ProjectAccess"
                },
                {
                  "type": "object",
                  "required": [
                    "credential"
                  ],
                  "properties": {
                    "credential": {
                      "type": "string",
                      "format": "password",
                      "pattern": "^sma_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "IssuedProjectKey": {
        "description": "The token is returned only when created or rotated.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ProjectKey"
                },
                {
                  "type": "object",
                  "required": [
                    "token"
                  ],
                  "properties": {
                    "token": {
                      "type": "string",
                      "format": "password",
                      "pattern": "^(smk|sak)_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "SshSession": {
        "description": "One SSH connection to the current guest generation",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "id",
                "user",
                "host_key",
                "connect_within_seconds"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{32}$"
                },
                "user": {
                  "const": "smolny-ssh"
                },
                "host_key": {
                  "type": "string",
                  "pattern": "^ssh-ed25519 [A-Za-z0-9+/]{68}$"
                },
                "connect_within_seconds": {
                  "const": 30
                }
              }
            }
          }
        }
      },
      "Workspace": {
        "description": "Registered workspace",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Workspace"
            }
          }
        }
      },
      "Machine": {
        "description": "Machine state",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Machine"
            }
          }
        }
      },
      "WorkVolume": {
        "description": "New detached work volume",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "name",
                "size_gib"
              ],
              "properties": {
                "name": {
                  "$ref": "#/components/schemas/Name"
                },
                "size_gib": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "MicroVMImage": {
        "description": "Fast image status",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/MicroVMImage"
            }
          }
        }
      },
      "MicroVM": {
        "description": "MicroVM state",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/MicroVM"
            }
          }
        }
      },
      "Job": {
        "description": "Background job state",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Job"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "A valid project bearer token is required",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string",
              "const": "Bearer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error": {
        "description": "Request or worker error. HTTP 409 covers state conflicts, quotas, and overlapping lifecycle operations. HTTP 503 can indicate request capacity or worker availability. JSON request bodies are limited to 65536 bytes.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "PilotInvitationReceipt": {
        "type": "object",
        "required": [
          "project",
          "profile",
          "credential",
          "quickstart",
          "limits"
        ],
        "properties": {
          "project": {
            "$ref": "#/components/schemas/Name"
          },
          "profile": {
            "enum": [
              "small",
              "builder"
            ]
          },
          "credential": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ProjectKey"
              },
              {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "format": "password",
                    "pattern": "^smk_[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"
                  }
                }
              }
            ]
          },
          "quickstart": {
            "enum": [
              "/docs#pilot-workspace",
              "/docs#pilot-builder"
            ]
          },
          "limits": {
            "type": "object",
            "required": [
              "max_incus_machines",
              "max_cpu_per_vm",
              "max_memory_mib_per_vm",
              "fast",
              "images",
              "work_volume_size_gib",
              "work_volume_mount"
            ],
            "properties": {
              "max_incus_machines": {
                "type": "integer",
                "minimum": 1
              },
              "max_cpu_per_vm": {
                "type": "integer",
                "minimum": 1,
                "description": "Maximum Fast VM vCPU shape."
              },
              "max_memory_mib_per_vm": {
                "type": "integer",
                "minimum": 512,
                "description": "Maximum Fast VM memory shape."
              },
              "images": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/PilotFastImages"
                  }
                ]
              },
              "fast": {
                "type": "object",
                "required": [
                  "machines",
                  "volume_disks",
                  "volume_gib"
                ],
                "properties": {
                  "machines": {
                    "type": "integer"
                  },
                  "volume_disks": {
                    "type": "integer"
                  },
                  "volume_gib": {
                    "type": "integer"
                  }
                }
              },
              "work_volume_size_gib": {
                "const": 20
              },
              "work_volume_mount": {
                "const": "/work"
              }
            }
          }
        }
      },
      "ProjectStorageInventory": {
        "type": "object",
        "required": [
          "volumes",
          "snapshots",
          "coverage",
          "observed_through_ms"
        ],
        "properties": {
          "volumes": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "size_bytes",
                "workspace",
                "attached"
              ],
              "properties": {
                "name": {
                  "$ref": "#/components/schemas/Name"
                },
                "size_bytes": {
                  "type": "integer",
                  "minimum": 0
                },
                "workspace": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Name"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "attached": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "Null when attachment state was not observed."
                }
              }
            }
          },
          "snapshots": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "volume",
                "name",
                "size_bytes"
              ],
              "properties": {
                "volume": {
                  "$ref": "#/components/schemas/Name"
                },
                "name": {
                  "$ref": "#/components/schemas/Name"
                },
                "size_bytes": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "coverage": {
            "enum": [
              "current",
              "partial",
              "unavailable"
            ]
          },
          "observed_through_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Oldest observation of the included sources, in Unix milliseconds."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
          }
        }
      },
      "ProjectPreview": {
        "type": "object",
        "required": [
          "id",
          "machine",
          "port",
          "mode",
          "expires_at",
          "resource"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{32}$"
          },
          "machine": {
            "$ref": "#/components/schemas/Name"
          },
          "port": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535
          },
          "mode": {
            "enum": [
              "app",
              "preview",
              "desktop",
              "desktop-view"
            ]
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix seconds. Null indicates a machine-lifetime link."
          },
          "resource": {
            "enum": [
              "machines",
              "microvms",
              "workspaces"
            ]
          }
        }
      },
      "ProjectUsage": {
        "type": "object",
        "required": [
          "limits",
          "observed",
          "sources",
          "sampling_interval_ms",
          "maximum_accounted_interval_ms"
        ],
        "properties": {
          "limits": {
            "type": "object",
            "required": [
              "incus",
              "per_machine",
              "fast"
            ],
            "properties": {
              "incus": {
                "type": "object",
                "required": [
                  "machine_slots",
                  "snapshots_per_machine"
                ],
                "properties": {
                  "machine_slots": {
                    "type": "integer"
                  },
                  "snapshots_per_machine": {
                    "type": "integer"
                  }
                }
              },
              "per_machine": {
                "type": "object",
                "required": [
                  "vcpu",
                  "memory_mib",
                  "disk_gib"
                ],
                "properties": {
                  "vcpu": {
                    "type": "integer"
                  },
                  "memory_mib": {
                    "type": "integer"
                  },
                  "disk_gib": {
                    "type": "integer"
                  }
                }
              },
              "pilot_profile": {
                "enum": [
                  "small",
                  "builder"
                ]
              },
              "fast": {
                "type": [
                  "object",
                  "null"
                ],
                "required": [
                  "machine_slots",
                  "per_node",
                  "project_storage",
                  "new_work_volume_gib",
                  "shapes"
                ],
                "properties": {
                  "machine_slots": {
                    "type": "integer"
                  },
                  "per_node": {
                    "type": "object",
                    "required": [
                      "machines",
                      "volume_disks",
                      "volume_gib"
                    ],
                    "properties": {
                      "machines": {
                        "type": "integer"
                      },
                      "volume_disks": {
                        "type": "integer"
                      },
                      "volume_gib": {
                        "type": "integer"
                      }
                    }
                  },
                  "project_storage": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "$ref": "#/components/schemas/UsageStorageLimits"
                      }
                    ]
                  },
                  "new_work_volume_gib": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "minItems": 2,
                    "maxItems": 2,
                    "items": {
                      "type": "integer"
                    }
                  },
                  "images": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "$ref": "#/components/schemas/PilotFastImages"
                      }
                    ]
                  },
                  "shapes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "vcpu",
                          "memory_mib"
                        ],
                        "properties": {
                          "vcpu": {
                            "type": "integer"
                          },
                          "memory_mib": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "observed": {
            "$ref": "#/components/schemas/ObservedUsage"
          },
          "sources": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/UsageSource"
            }
          },
          "sampling_interval_ms": {
            "type": "integer"
          },
          "maximum_accounted_interval_ms": {
            "type": "integer"
          }
        }
      },
      "PilotFastImages": {
        "type": "object",
        "required": [
          "versions",
          "prepared_gib",
          "upload_bytes"
        ],
        "properties": {
          "versions": {
            "type": "integer",
            "minimum": 1
          },
          "prepared_gib": {
            "type": "integer",
            "minimum": 1,
            "description": "Logical limit including prepared copies."
          },
          "upload_bytes": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "UsageStorageLimits": {
        "type": "object",
        "required": [
          "volume_disks",
          "volume_gib"
        ],
        "properties": {
          "volume_disks": {
            "type": "integer"
          },
          "volume_gib": {
            "type": "integer"
          }
        }
      },
      "ObservedUsage": {
        "type": "object",
        "properties": {
          "compute_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "vcpu_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "memory_byte_ms": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]+$"
          },
          "work_disk_byte_ms": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]+$"
          },
          "direct_outbound_ip_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "proxy_outbound_payload_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          }
        }
      },
      "UsageSource": {
        "type": "object",
        "required": [
          "status",
          "coverage_start_ms",
          "observed_through_ms",
          "current",
          "observed",
          "gaps",
          "outbound_coverage",
          "broker_compute_coverage"
        ],
        "properties": {
          "status": {
            "enum": [
              "current",
              "unavailable",
              "retired"
            ]
          },
          "coverage_start_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "observed_through_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "current": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "object",
                  "required": [
                    "limit",
                    "used"
                  ],
                  "properties": {
                    "limit": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "used": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  }
                }
              ]
            }
          },
          "observed": {
            "$ref": "#/components/schemas/ObservedUsage"
          },
          "gaps": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "required": [
                "intervals",
                "span_ms",
                "last_end_ms"
              ],
              "properties": {
                "intervals": {
                  "type": "integer"
                },
                "span_ms": {
                  "type": "integer"
                },
                "last_end_ms": {
                  "type": "integer"
                }
              }
            }
          },
          "outbound_coverage": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "enum": [
                "current",
                "not_configured",
                "unavailable"
              ]
            }
          },
          "broker_compute_coverage": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "started_ms",
              "interrupted_leases",
              "storage_errors",
              "status"
            ],
            "properties": {
              "started_ms": {
                "type": "integer"
              },
              "interrupted_leases": {
                "type": "integer"
              },
              "storage_errors": {
                "type": "integer"
              },
              "status": {
                "enum": [
                  "current",
                  "unavailable"
                ]
              }
            }
          }
        }
      },
      "Name": {
        "type": "string",
        "pattern": "^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"
      },
      "GitCheckoutCreate": {
        "type": "object",
        "required": [
          "repository",
          "username",
          "token"
        ],
        "additionalProperties": false,
        "properties": {
          "repository": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "Exact HTTPS Git path on a public DNS name, optional port 443. Use the canonical URL with no userinfo, query, fragment, percent encoding, or trailing slash."
          },
          "username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "description": "Basic authentication user, printable ASCII without spaces or colon."
          },
          "token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "writeOnly": true,
            "description": "Repository read token, printable ASCII without spaces."
          },
          "ttl_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 900,
            "default": 300
          }
        }
      },
      "GitCheckout": {
        "type": "object",
        "required": [
          "id",
          "url",
          "handle",
          "ttl_seconds"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{32}$"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Git remote URL reachable from the bound workspace boot."
          },
          "handle": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "Boot-bound capability returned once. Send in X-Smolny-Checkout."
          },
          "ttl_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 900
          }
        }
      },
      "WorkspaceCreate": {
        "type": "object",
        "required": [
          "volume"
        ],
        "additionalProperties": false,
        "properties": {
          "volume": {
            "$ref": "#/components/schemas/Name"
          },
          "cpu": {
            "type": "integer",
            "enum": [
              1,
              4
            ],
            "default": 1
          },
          "memory_mib": {
            "type": "integer",
            "enum": [
              1024,
              8192
            ],
            "default": 1024
          },
          "network": {
            "type": "boolean",
            "default": false
          },
          "image_digest": {
            "$ref": "#/components/schemas/ImageDigest"
          }
        }
      },
      "Workspace": {
        "type": "object",
        "required": [
          "id",
          "volume",
          "status",
          "cpu",
          "memory_mib",
          "network"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Name"
          },
          "volume": {
            "$ref": "#/components/schemas/Name"
          },
          "status": {
            "type": "string",
            "enum": [
              "parked",
              "starting",
              "running",
              "parking",
              "recovering",
              "unavailable"
            ]
          },
          "cpu": {
            "type": "integer",
            "enum": [
              1,
              4
            ]
          },
          "memory_mib": {
            "type": "integer",
            "enum": [
              1024,
              8192
            ]
          },
          "network": {
            "type": "boolean"
          },
          "image_digest": {
            "$ref": "#/components/schemas/ImageDigest"
          },
          "machine": {
            "$ref": "#/components/schemas/MicroVM"
          }
        }
      },
      "WorkspaceWebhookEvent": {
        "enum": [
          "workspace.created",
          "workspace.started",
          "workspace.parked",
          "workspace.deleted"
        ]
      },
      "WebhookSubscriptions": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/WorkspaceWebhookEvent"
        },
        "minItems": 1,
        "maxItems": 4,
        "uniqueItems": true
      },
      "WebhookEndpoint": {
        "type": "object",
        "required": [
          "id",
          "url",
          "events",
          "created_at",
          "revoked_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^wh_[a-f0-9]{32}$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "$ref": "#/components/schemas/WebhookSubscriptions"
          },
          "created_at": {
            "type": "integer",
            "minimum": 0
          },
          "revoked_at": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          }
        }
      },
      "IssuedWebhook": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookEndpoint"
          },
          {
            "type": "object",
            "required": [
              "secret"
            ],
            "properties": {
              "secret": {
                "type": "string",
                "pattern": "^whsec_[A-Za-z0-9+/]{43}=$",
                "description": "Save the signing secret now. It is returned only by creation and rotation."
              }
            }
          }
        ]
      },
      "WebhookDelivery": {
        "type": "object",
        "required": [
          "id",
          "event_id",
          "event_type",
          "created_at",
          "next_attempt_at",
          "replays",
          "state",
          "attempts"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^wd_[a-f0-9]{32}$"
          },
          "event_id": {
            "type": "string",
            "pattern": "^evt_[a-f0-9]{32}$"
          },
          "event_type": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/WorkspaceWebhookEvent"
              },
              {
                "const": "webhook.test"
              }
            ]
          },
          "created_at": {
            "type": "integer",
            "minimum": 0
          },
          "next_attempt_at": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "replays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3
          },
          "state": {
            "enum": [
              "queued",
              "delivering",
              "delivered",
              "failed",
              "revoked"
            ]
          },
          "attempts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookAttempt"
            },
            "maxItems": 8
          },
          "job_id": {
            "type": "string",
            "description": "Identifier of the accepted asynchronous job or delivery."
          },
          "status_url": {
            "type": "string",
            "format": "uri-reference",
            "description": "Relative or absolute URL to poll for asynchronous operation status."
          }
        }
      },
      "WebhookAttempt": {
        "type": "object",
        "required": [
          "attempt",
          "started_at",
          "finished_at",
          "http_status",
          "outcome"
        ],
        "properties": {
          "attempt": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8
          },
          "started_at": {
            "type": "integer",
            "minimum": 0
          },
          "finished_at": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 100,
            "maximum": 599
          },
          "outcome": {
            "enum": [
              "sending",
              "delivered",
              "http_error",
              "redirect",
              "target_denied",
              "tls_error",
              "network_error",
              "timeout",
              "egress_unavailable",
              "interrupted"
            ]
          }
        }
      },
      "KeyScopes": {
        "type": "array",
        "minItems": 1,
        "maxItems": 10,
        "uniqueItems": true,
        "items": {
          "enum": [
            "read",
            "compute",
            "exec",
            "files:read",
            "files:write",
            "preview",
            "storage",
            "destroy",
            "webhooks:read",
            "webhooks:write"
          ]
        }
      },
      "ProjectAccess": {
        "type": "object",
        "required": [
          "project",
          "role",
          "scopes",
          "expires_at",
          "invitation_pilot"
        ],
        "properties": {
          "project": {
            "$ref": "#/components/schemas/Name"
          },
          "role": {
            "enum": [
              "owner",
              "customer",
              "delegate",
              "agent"
            ]
          },
          "scopes": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/KeyScopes"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix time in seconds or null for an account or owner bearer."
          },
          "invitation_pilot": {
            "type": "boolean"
          }
        }
      },
      "ProjectKeyId": {
        "type": "string",
        "pattern": "^[0-9a-f]{32}$"
      },
      "ProjectKey": {
        "type": "object",
        "required": [
          "id",
          "name",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ProjectKeyId"
          },
          "name": {
            "$ref": "#/components/schemas/Name"
          },
          "scopes": {
            "$ref": "#/components/schemas/KeyScopes"
          },
          "created_at": {
            "type": "integer",
            "description": "Unix timestamp in seconds."
          },
          "expires_at": {
            "type": "integer",
            "description": "Unix timestamp in seconds."
          }
        }
      },
      "CustomImage": {
        "type": "object",
        "required": [
          "id",
          "template",
          "fingerprint",
          "sha256",
          "size_bytes"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "template": {
            "$ref": "#/components/schemas/Name"
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 512,
            "maximum": 10737418240
          }
        }
      },
      "Template": {
        "type": "object",
        "required": [
          "id",
          "description"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(ubuntu|dev|browser|desktop|custom-[a-z]([a-z0-9-]{0,54}[a-z0-9])?)$"
          },
          "description": {
            "type": "string"
          },
          "warm": {
            "type": "object",
            "required": [
              "ready",
              "target"
            ],
            "properties": {
              "ready": {
                "type": "integer",
                "minimum": 0,
                "description": "Unclaimed ready reserves currently visible to this project."
              },
              "target": {
                "type": "integer",
                "minimum": 0,
                "description": "Configured reserve count, subject to project quota and host resources."
              }
            }
          }
        }
      },
      "MachineCreate": {
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "$ref": "#/components/schemas/Name"
          },
          "template": {
            "type": "string",
            "pattern": "^(ubuntu|dev|browser|desktop|custom-[a-z]([a-z0-9-]{0,54}[a-z0-9])?)$",
            "default": "ubuntu",
            "description": "Select a template advertised by this project's GET /v1/templates response."
          },
          "cpu": {
            "type": "integer",
            "minimum": 1,
            "maximum": 16,
            "default": 1,
            "description": "Maximum may be lower under project configuration."
          },
          "memory_mib": {
            "type": "integer",
            "minimum": 512,
            "maximum": 65536,
            "description": "Defaults to 1024 MiB or the configured project maximum, whichever is lower."
          },
          "disk_gib": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1000,
            "description": "Defaults to 10 GiB or the configured project maximum, whichever is lower."
          },
          "idle_timeout_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 10,
            "maximum": 86400,
            "default": null,
            "description": "Idle auto-pause threshold in seconds. Omit or use null to disable."
          },
          "allocation": {
            "type": "string",
            "enum": [
              "auto",
              "warm",
              "cold"
            ],
            "default": "auto",
            "description": "Auto uses a compatible warm VM when available. Warm requires one and returns warm_unavailable with HTTP 409 otherwise. Cold provisions a new VM."
          },
          "command": {
            "$ref": "#/components/schemas/ExecCommand"
          }
        }
      },
      "MachineCreateResult": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Machine"
          },
          {
            "type": "object",
            "required": [
              "allocation"
            ],
            "properties": {
              "command_result": {
                "$ref": "#/components/schemas/ExecResult",
                "description": "Confirmed result of the requested first command, including nonzero exit codes."
              },
              "command_error": {
                "type": "object",
                "required": [
                  "code",
                  "message",
                  "outcome"
                ],
                "description": "The created VM remains available. Guest command side effects may have occurred.",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "timeout",
                      "unconfirmed"
                    ]
                  }
                }
              }
            },
            "not": {
              "required": [
                "command_result",
                "command_error"
              ]
            }
          }
        ]
      },
      "Machine": {
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "template"
        ],
        "dependentRequired": {
          "idle_timeout_seconds": [
            "auto_paused"
          ],
          "auto_paused": [
            "idle_timeout_seconds"
          ]
        },
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Lowercase Incus state, such as running, frozen, or stopped."
          },
          "template": {
            "type": "string"
          },
          "idle_timeout_seconds": {
            "type": "integer",
            "minimum": 1,
            "description": "Present on machines with idle policy metadata."
          },
          "auto_paused": {
            "type": "boolean",
            "description": "Persistent automatic pause marker. Present on machines with idle policy metadata."
          },
          "allocation": {
            "type": "string",
            "enum": [
              "warm",
              "cold"
            ],
            "description": "Allocation method on the machine creation response."
          }
        }
      },
      "ImageDigest": {
        "type": "string",
        "pattern": "^sha256:[0-9a-f]{64}$"
      },
      "MicroVMImage": {
        "type": "object",
        "required": [
          "digest",
          "format",
          "size_bytes",
          "status",
          "compatible"
        ],
        "properties": {
          "digest": {
            "$ref": "#/components/schemas/ImageDigest"
          },
          "format": {
            "type": "string",
            "enum": [
              "oci",
              "ext4"
            ]
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "uploading",
              "building",
              "probing",
              "staging",
              "ready",
              "incompatible",
              "failed"
            ]
          },
          "compatible": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "manifest_digest": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ImageDigest"
              },
              {
                "type": "null"
              }
            ]
          },
          "prepared_digest": {
            "$ref": "#/components/schemas/ImageDigest",
            "description": "SHA-256 of the active prepared ext4 disk before boot."
          },
          "agent_sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "SHA-256 of the guest agent embedded at preparation time. Earlier ready records can omit it."
          },
          "disk_bytes": {
            "type": "integer"
          },
          "preparation_ms": {
            "type": "number"
          },
          "reprepare": {
            "type": "object",
            "required": [
              "status",
              "from_prepared_digest"
            ],
            "description": "Progress and outcome of the most recent explicit repreparation. A failure leaves the current ready revision available.",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "uploading",
                  "building",
                  "probing",
                  "staging",
                  "ready",
                  "incompatible",
                  "failed"
                ]
              },
              "from_prepared_digest": {
                "$ref": "#/components/schemas/ImageDigest"
              },
              "compatible": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "reason": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "preparation_ms": {
                "type": "number"
              }
            }
          },
          "job_id": {
            "type": "string",
            "description": "Identifier of the accepted asynchronous job or delivery."
          },
          "status_url": {
            "type": "string",
            "format": "uri-reference",
            "description": "Relative or absolute URL to poll for asynchronous operation status."
          }
        }
      },
      "MicroVM": {
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "template"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/Name"
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "unavailable"
            ]
          },
          "generation": {
            "$ref": "#/components/schemas/BootGeneration"
          },
          "jobs_supported": {
            "type": "boolean",
            "description": "The guest agent can run detached jobs in this boot."
          },
          "exec_options_supported": {
            "type": "boolean",
            "description": "The guest agent supports cwd and env for exec."
          },
          "node": {
            "$ref": "#/components/schemas/Name",
            "description": "Placement node for a clustered microVM."
          },
          "template": {
            "type": "string",
            "enum": [
              "microvm",
              "ubuntu-microvm"
            ]
          },
          "boot_method": {
            "type": "string",
            "const": "fresh_kernel"
          },
          "network": {
            "type": "boolean",
            "description": "The project egress profile is configured before the first command when true."
          },
          "https_proxy": {
            "type": "string",
            "format": "uri",
            "description": "Guest-local CONNECT endpoint for the project proxy profile. Present only for proxy-enabled leases."
          },
          "volume": {
            "$ref": "#/components/schemas/Name"
          },
          "workdir": {
            "type": "string",
            "const": "/work"
          },
          "image_digest": {
            "$ref": "#/components/schemas/ImageDigest"
          },
          "desktop": {
            "type": "boolean",
            "description": "An interactive guest X11 desktop is ready when true."
          },
          "cpu": {
            "type": "integer"
          },
          "memory_mib": {
            "type": "integer"
          },
          "disk_gib": {
            "type": "number"
          },
          "allocation": {
            "type": "string",
            "enum": [
              "snapshot",
              "cold"
            ],
            "description": "The Ubuntu profile boots a fresh kernel. The minimal BusyBox template restores a prepared snapshot."
          }
        }
      },
      "MicroVMCreate": {
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "required": [
                "image_digest"
              ]
            },
            "then": {
              "properties": {
                "template": {
                  "const": "ubuntu-microvm"
                },
                "desktop": {
                  "const": false
                }
              }
            }
          },
          {
            "if": {
              "required": [
                "network"
              ],
              "properties": {
                "network": {
                  "const": true
                }
              }
            },
            "then": {
              "anyOf": [
                {
                  "required": [
                    "template"
                  ]
                },
                {
                  "required": [
                    "image_digest"
                  ]
                }
              ],
              "properties": {
                "template": {
                  "const": "ubuntu-microvm"
                },
                "desktop": {
                  "const": false
                }
              }
            }
          },
          {
            "if": {
              "required": [
                "volume"
              ]
            },
            "then": {
              "anyOf": [
                {
                  "required": [
                    "template"
                  ]
                },
                {
                  "required": [
                    "image_digest"
                  ]
                }
              ],
              "properties": {
                "template": {
                  "const": "ubuntu-microvm"
                }
              }
            }
          },
          {
            "if": {
              "required": [
                "include_frame"
              ]
            },
            "then": {
              "required": [
                "desktop"
              ],
              "properties": {
                "desktop": {
                  "const": true
                }
              }
            }
          },
          {
            "if": {
              "required": [
                "desktop"
              ],
              "properties": {
                "desktop": {
                  "const": true
                }
              }
            },
            "then": {
              "required": [
                "template"
              ],
              "properties": {
                "template": {
                  "const": "ubuntu-microvm"
                }
              }
            }
          }
        ],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/Name"
          },
          "template": {
            "type": "string",
            "enum": [
              "microvm",
              "ubuntu-microvm"
            ],
            "description": "Defaults to microvm unless image_digest is present, which requires ubuntu-microvm."
          },
          "image_digest": {
            "$ref": "#/components/schemas/ImageDigest"
          },
          "cpu": {
            "type": "integer",
            "enum": [
              1,
              4
            ],
            "description": "Ubuntu shapes are 1 CPU/1024 MiB or 4 CPUs/8192 MiB, subject to project and host capacity."
          },
          "memory_mib": {
            "type": "integer",
            "enum": [
              1024,
              8192
            ]
          },
          "network": {
            "type": "boolean",
            "default": false,
            "description": "Request configured project egress for ubuntu-microvm. The host must allow this project."
          },
          "desktop": {
            "type": "boolean",
            "default": false,
            "description": "Boot the graphical Ubuntu image and wait for its first real X11 frame."
          },
          "include_frame": {
            "type": "boolean",
            "description": "With desktop enabled, include the first JPEG in this create response. The frame is taken before the optional command."
          },
          "volume": {
            "$ref": "#/components/schemas/Name",
            "description": "Project work volume attached at /work before the first command."
          },
          "command": {
            "$ref": "#/components/schemas/ExecCommand"
          },
          "region": {
            "type": "string",
            "description": "Target region ID (e.g. 'eu')."
          },
          "labels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Up to 32 key/value labels."
          },
          "secrets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Project secret names to inject as placeholders."
          },
          "always_on": {
            "type": "boolean",
            "description": "Disable idle auto-sleep for this microVM."
          },
          "idle_timeout_seconds": {
            "type": "integer",
            "minimum": 0,
            "description": "Idle auto-sleep timeout in seconds."
          },
          "preset": {
            "type": "string",
            "description": "Optional preset name from GET /v1/presets."
          },
          "proxy": {
            "type": "object",
            "description": "Optional HTTP/SOCKS5 proxy config (host/port or url, residential, country)."
          },
          "browser_profile": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
            "description": "Optional persistent browser profile (auth context) name to attach to this microVM."
          },
          "profile_mode": {
            "type": "string",
            "enum": [
              "persist",
              "copy"
            ],
            "default": "copy",
            "description": "Attachment mode for browser_profile: 'persist' (exclusive single-writer lease) or 'copy' (CoW copy-on-attach for parallel VMs)."
          }
        }
      },
      "MicroVMCreateResult": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MicroVM"
          },
          {
            "type": "object",
            "required": [
              "allocation"
            ],
            "properties": {
              "initial_frame": {
                "type": "object",
                "required": [
                  "content_type",
                  "encoding",
                  "data"
                ],
                "properties": {
                  "content_type": {
                    "const": "image/jpeg"
                  },
                  "encoding": {
                    "const": "base64"
                  },
                  "data": {
                    "type": "string",
                    "contentEncoding": "base64",
                    "contentMediaType": "image/jpeg",
                    "maxLength": 65536
                  }
                }
              },
              "command_result": {
                "$ref": "#/components/schemas/ExecResult",
                "description": "Present only when the create request supplied a command."
              }
            }
          }
        ]
      },
      "ExecCommand": {
        "type": "object",
        "required": [
          "argv"
        ],
        "additionalProperties": false,
        "properties": {
          "argv": {
            "type": "array",
            "minItems": 1,
            "maxItems": 128,
            "prefixItems": [
              {
                "type": "string",
                "minLength": 1
              }
            ],
            "items": {
              "type": "string"
            },
            "description": "Nonempty executable followed by its arguments. The UTF-8 bytes across all arguments are limited to 32768. NUL characters are rejected."
          },
          "timeout": {
            "type": "integer",
            "minimum": 1,
            "maximum": 120,
            "default": 30,
            "description": "Guest command time limit in seconds."
          },
          "cwd": {
            "type": "string",
            "pattern": "^/",
            "description": "Absolute guest directory with no NUL, up to 4096 UTF-8 bytes."
          },
          "env": {
            "type": "object",
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Process-only environment overrides up to 8192 UTF-8 bytes total."
          }
        }
      },
      "ExecResult": {
        "type": "object",
        "required": [
          "stdout",
          "stderr",
          "exit_code",
          "truncated"
        ],
        "properties": {
          "stdout": {
            "type": "string"
          },
          "stderr": {
            "type": "string"
          },
          "exit_code": {
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          }
        }
      },
      "BootGeneration": {
        "type": "string",
        "pattern": "^[0-9a-f]{20}$",
        "description": "Opaque ID of the current Firecracker guest boot."
      },
      "BootJobCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "argv"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"
          },
          "argv": {
            "type": "array",
            "minItems": 1,
            "maxItems": 128,
            "prefixItems": [
              {
                "type": "string",
                "minLength": 1
              }
            ],
            "items": {
              "type": "string"
            },
            "description": "Nonempty executable followed by its arguments. The UTF-8 bytes across all arguments are limited to 32768. NUL characters are rejected."
          },
          "cwd": {
            "type": "string",
            "pattern": "^/",
            "description": "Absolute guest directory with no NUL, up to 4096 UTF-8 bytes."
          },
          "env": {
            "type": "object",
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Process-only environment overrides up to 8192 UTF-8 bytes total."
          },
          "timeout": {
            "type": "integer",
            "minimum": 1,
            "maximum": 86400,
            "default": 3600
          }
        }
      },
      "BootJob": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Job"
          },
          {
            "type": "object",
            "required": [
              "generation",
              "signal"
            ],
            "properties": {
              "generation": {
                "$ref": "#/components/schemas/BootGeneration"
              },
              "signal": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Number of the signal that terminated the command, if applicable."
              },
              "job_id": {
                "type": "string",
                "description": "Identifier of the accepted asynchronous job or delivery."
              },
              "status_url": {
                "type": "string",
                "format": "uri-reference",
                "description": "Relative or absolute URL to poll for asynchronous operation status."
              }
            }
          }
        ]
      },
      "BootJobIndex": {
        "type": "object",
        "required": [
          "generation",
          "jobs"
        ],
        "properties": {
          "generation": {
            "$ref": "#/components/schemas/BootGeneration"
          },
          "jobs": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "$ref": "#/components/schemas/BootJob"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque cursor for fetching the next page of results, or null when no further pages remain."
          }
        }
      },
      "BootJobLogs": {
        "type": "object",
        "required": [
          "generation",
          "encoding",
          "stdout",
          "stderr",
          "stdout_offset",
          "stderr_offset",
          "truncated"
        ],
        "properties": {
          "generation": {
            "$ref": "#/components/schemas/BootGeneration"
          },
          "encoding": {
            "const": "base64"
          },
          "stdout": {
            "type": "string",
            "contentEncoding": "base64"
          },
          "stderr": {
            "type": "string",
            "contentEncoding": "base64"
          },
          "stdout_offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 65536,
            "description": "Next unread byte offset."
          },
          "stderr_offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 65536,
            "description": "Next unread byte offset."
          },
          "truncated": {
            "type": "boolean"
          }
        }
      },
      "Job": {
        "type": "object",
        "required": [
          "id",
          "status",
          "exit_code",
          "created_at",
          "started_at",
          "finished_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Name"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "timed_out",
              "cancelled",
              "interrupted"
            ]
          },
          "exit_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "integer",
            "description": "Unix timestamp in seconds."
          },
          "started_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix timestamp in seconds."
          },
          "finished_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix timestamp in seconds."
          },
          "job_id": {
            "type": "string",
            "description": "Identifier of the accepted asynchronous job or delivery."
          },
          "status_url": {
            "type": "string",
            "format": "uri-reference",
            "description": "Relative or absolute URL to poll for asynchronous operation status."
          }
        }
      },
      "JobLogs": {
        "type": "object",
        "required": [
          "stdout",
          "stderr",
          "truncated"
        ],
        "properties": {
          "stdout": {
            "type": "string"
          },
          "stderr": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          }
        }
      },
      "PreviewRequest": {
        "type": "object",
        "required": [
          "port"
        ],
        "additionalProperties": false,
        "properties": {
          "port": {
            "$ref": "#/components/schemas/PreviewPort"
          },
          "path": {
            "$ref": "#/components/schemas/PreviewPath"
          }
        }
      },
      "MicroVMDesktopEvents": {
        "type": "object",
        "required": [
          "events"
        ],
        "additionalProperties": false,
        "properties": {
          "events": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "type": "object",
              "required": [
                "type"
              ],
              "additionalProperties": false,
              "properties": {
                "type": {
                  "enum": [
                    "move",
                    "down",
                    "up",
                    "scroll",
                    "key",
                    "text",
                    "release"
                  ]
                },
                "x": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 799
                },
                "y": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 599
                },
                "button": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 5
                },
                "text": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "key": {
                  "type": "string"
                },
                "ctrl": {
                  "type": "boolean"
                },
                "alt": {
                  "type": "boolean"
                },
                "shift": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "PreviewLinkRequest": {
        "type": "object",
        "required": [
          "port"
        ],
        "additionalProperties": false,
        "properties": {
          "port": {
            "$ref": "#/components/schemas/PreviewPort"
          },
          "path": {
            "$ref": "#/components/schemas/PreviewPath"
          },
          "ttl_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 900,
            "description": "Temporary links only. Defaults to 300 seconds when omitted."
          },
          "mode": {
            "type": "string",
            "enum": [
              "preview",
              "app",
              "desktop",
              "desktop-view"
            ],
            "default": "preview"
          },
          "lifetime": {
            "type": "string",
            "const": "machine",
            "description": "Omit for a temporary link. Machine-lifetime links cannot specify ttl_seconds."
          }
        },
        "not": {
          "required": [
            "lifetime",
            "ttl_seconds"
          ]
        },
        "if": {
          "required": [
            "mode"
          ],
          "properties": {
            "mode": {
              "enum": [
                "desktop",
                "desktop-view"
              ]
            }
          }
        },
        "then": {
          "properties": {
            "port": {
              "const": 6080
            },
            "path": {
              "const": "/"
            }
          },
          "not": {
            "required": [
              "lifetime"
            ]
          }
        }
      },
      "PreviewLinkResponse": {
        "type": "object",
        "required": [
          "id",
          "url",
          "expires_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/PreviewLinkId"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix timestamp in seconds for a temporary link or null for a machine-lifetime link."
          },
          "lifetime": {
            "type": "string",
            "const": "machine"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "description": "Returned for MicroVM app grants."
          },
          "access_token": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "Returned once for a private MicroVM app grant. Use as a bearer token on the issued URL."
          }
        },
        "if": {
          "required": [
            "lifetime"
          ]
        },
        "then": {
          "properties": {
            "expires_at": {
              "type": "null"
            }
          }
        },
        "else": {
          "properties": {
            "expires_at": {
              "type": "integer"
            }
          }
        }
      },
      "PreviewPort": {
        "type": "integer",
        "minimum": 1,
        "maximum": 65535
      },
      "PreviewPath": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2048,
        "default": "/",
        "description": "Absolute HTTP path with optional query and no authority or fragment. Use percent-encoding for characters outside the HTTP request-target character set."
      },
      "PreviewLinkId": {
        "type": "string",
        "pattern": "^[0-9a-f]{32}$"
      },
      "Snapshot": {
        "type": "object",
        "required": [
          "name",
          "created_at",
          "stateful"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "stateful": {
            "type": "boolean"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Machine-readable error code such as unauthorized, not_found, machine_quota, snapshot_quota, project_busy, machine_busy, or busy."
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
