{
  "openapi": "3.1.0",
  "info": {
    "title": "just-run API",
    "version": "1.0.0",
    "description": "REST API for just-run sandboxes: create isolated microVMs, run commands and processes in them, work with their files and ports, and manage templates, secrets, storage, automations and hosted MCP servers.\n\nUse the origin of your just-run deployment as the base URL. Authenticate with a personal access token: `Authorization: Bearer <token>`. Create one in the web app under **Tokens** or with `POST /v1/auth/tokens`."
  },
  "servers": [
    {
      "url": "https://your-just-run-host",
      "description": "Replace with the origin of your just-run deployment"
    }
  ],
  "tags": [
    {
      "name": "Sandboxes",
      "description": "Create sandboxes, change their settings, and move them between running, stopped and hibernated states."
    },
    {
      "name": "Execution",
      "description": "Run commands in a running sandbox, start background processes, and interact with them."
    },
    {
      "name": "Files",
      "description": "Read, write, list and move files inside a running sandbox."
    },
    {
      "name": "Ports",
      "description": "Publish a port of a sandbox service at a preview URL and control who can open it."
    },
    {
      "name": "Terminal",
      "description": "Interactive shell sessions over WebSocket."
    },
    {
      "name": "Proxy",
      "description": "Reach an HTTP service inside a sandbox through the API origin."
    },
    {
      "name": "Templates",
      "description": "Root filesystem images that sandboxes are created from, and their versions."
    },
    {
      "name": "Presets",
      "description": "Saved sandbox configurations: template, resources and environment."
    },
    {
      "name": "Secrets",
      "description": "Encrypted values that sandboxes, automations and hosted MCP servers reference by name."
    },
    {
      "name": "Storage",
      "description": "Object storage of the account: upload, download, list and delete objects."
    },
    {
      "name": "Jobs",
      "description": "Long-running operations started by other requests, such as template deletion."
    },
    {
      "name": "Automations",
      "description": "Run a command or an HTTP request in a sandbox on a schedule or on an inbound webhook."
    },
    {
      "name": "Hosted MCP",
      "description": "Deploy MCP servers from the catalog, the MCP Registry or your own package, and manage them."
    },
    {
      "name": "Skills",
      "description": "Skills for AI coding agents: the just-run catalog and search in skills.sh."
    },
    {
      "name": "Account",
      "description": "The authenticated user and the audit log of the account."
    },
    {
      "name": "Tokens",
      "description": "Personal access tokens for scripts, CI and agents."
    }
  ],
  "x-tagGroups": [
    {
      "name": "Sandboxes",
      "tags": [
        "Sandboxes",
        "Execution",
        "Files",
        "Ports",
        "Terminal",
        "Proxy"
      ]
    },
    {
      "name": "Resources",
      "tags": [
        "Templates",
        "Presets",
        "Secrets",
        "Storage",
        "Jobs"
      ]
    },
    {
      "name": "Automation",
      "tags": [
        "Automations",
        "Hosted MCP",
        "Skills"
      ]
    },
    {
      "name": "Account",
      "tags": [
        "Account",
        "Tokens"
      ]
    }
  ],
  "paths": {
    "/v1/account/audit-logs": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "List audit log events",
        "description": "Events of the account the token acts in, newest first. Filter by event type, resource, outcome and time range.",
        "operationId": "listAuditLogs",
        "parameters": [
          {
            "name": "event_type",
            "in": "query",
            "description": "Exact event type, for example `sandbox.create`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource_type",
            "in": "query",
            "description": "Exact resource type, for example `sandbox`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource_id",
            "in": "query",
            "description": "Exact resource ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "description": "Exact outcome: `success`, `failure`, or `denied`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive RFC 3339 lower timestamp bound",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Inclusive RFC 3339 upper timestamp bound",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 50, clamped to 1–500)",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Zero-based result offset (default 0)",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audit events for the caller's active account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid numeric pagination parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_audit_logs"
        }
      }
    },
    "/v1/auth/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Get the current user",
        "description": "Returns the authenticated user and the account the request acts in.",
        "operationId": "getCurrentUser",
        "responses": {
          "200": {
            "description": "Current user info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "me"
        }
      }
    },
    "/v1/auth/tokens": {
      "get": {
        "tags": [
          "Tokens"
        ],
        "summary": "List personal access tokens",
        "operationId": "listTokens",
        "responses": {
          "200": {
            "description": "List of PATs (plaintext not included)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTokensResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Token values are never returned after creation.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_tokens"
        }
      },
      "post": {
        "tags": [
          "Tokens"
        ],
        "summary": "Create a personal access token",
        "operationId": "createToken",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Token created — plaintext shown once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid name or expiry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "The token value is returned once, in this response. Store it securely.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "create_token"
        }
      }
    },
    "/v1/auth/tokens/{id}": {
      "delete": {
        "tags": [
          "Tokens"
        ],
        "summary": "Revoke a personal access token",
        "operationId": "revokeToken",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "PAT id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Token revoked, or it was already revoked"
          },
          "401": {
            "description": "Missing or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Token not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Takes effect immediately. Revoking a token that is already revoked also returns 204; an unknown token ID returns 404.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "revoke_token"
        }
      }
    },
    "/v1/automations": {
      "get": {
        "tags": [
          "Automations"
        ],
        "summary": "List automations",
        "operationId": "listAutomations",
        "responses": {
          "200": {
            "description": "Automations list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AutomationResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_automations"
        }
      },
      "post": {
        "tags": [
          "Automations"
        ],
        "summary": "Create an automation",
        "operationId": "createAutomation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAutomationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Automation created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Target sandbox not found / not owned, or explicit hibernate denied (feature.not_enabled)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "Per-account automation quota exceeded (code quota.exceeded, no Retry-After — the ceiling does not clear by waiting)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required policy could not be read (dependency.unavailable), or the secrets KEK is missing (feature.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "An automation binds a trigger (a cron schedule or an inbound webhook) to an action (a command or an HTTP request) in one of your sandboxes. When the account allows automatic wake, a paused sandbox is woken for each run and can be paused again afterwards; otherwise a run against a paused sandbox is blocked.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "create_automation"
        }
      }
    },
    "/v1/automations/hooks/{slug}": {
      "post": {
        "tags": [
          "Automations"
        ],
        "summary": "Receive an inbound webhook",
        "operationId": "receiveAutomationWebhook",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "description": "Automation public slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Raw provider payload; signature verification uses the exact received bytes",
          "content": {
            "*/*": {}
          }
        },
        "responses": {
          "202": {
            "description": "Accepted (queued) or replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationHookResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing / bad signature or token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Automation disabled (automation.disabled) or account suspended (account.suspended); deliberately not 410, which would make a provider delete the webhook",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Unknown slug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Automation not bound to a sandbox (code automation.target_missing)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "Payload exceeds the deployment's inbound webhook body limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "Malformed provider payload (code request.validation_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (code rate_limit.exceeded, with Retry-After when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Enabled but not configured: the secrets KEK is missing (code feature.unavailable). Automations switched off answer 404 feature.not_enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "description": "The endpoint a webhook provider calls. It takes no Bearer token: the request is verified by the provider signature or token configured on the automation. Returns 202 once the run is queued; the action runs asynchronously.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "receive_hook"
        }
      }
    },
    "/v1/automations/{id}": {
      "delete": {
        "tags": [
          "Automations"
        ],
        "summary": "Delete an automation",
        "operationId": "deleteAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Automation ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access to delete the automation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Also deletes its run history. Deleting an automation that does not exist returns 204.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "delete_automation"
        }
      },
      "get": {
        "tags": [
          "Automations"
        ],
        "summary": "Get an automation",
        "operationId": "getAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Automation ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Automation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_automation"
        }
      },
      "patch": {
        "tags": [
          "Automations"
        ],
        "summary": "Update an automation",
        "operationId": "updateAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Automation ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchAutomationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated automation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access to mutate the automation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "Visibility conflicts with target or retained run history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required policy could not be read (dependency.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Partial update. Can bind the automation to another sandbox and rotate its webhook secret.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "patch_automation"
        }
      }
    },
    "/v1/automations/{id}/disable": {
      "post": {
        "tags": [
          "Automations"
        ],
        "summary": "Pause an automation",
        "operationId": "disableAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Automation ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Automation disabled (paused)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access to mutate the automation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Scheduled and webhook runs stop until the automation is enabled again; it keeps its configuration and history. Manual runs and redeliveries still run.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "disable_automation"
        }
      }
    },
    "/v1/automations/{id}/enable": {
      "post": {
        "tags": [
          "Automations"
        ],
        "summary": "Resume an automation",
        "operationId": "enableAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Automation ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Automation enabled (resumed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Creator no longer has access to the target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "A cron automation is scheduled for its next future occurrence; missed runs are not caught up.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "enable_automation"
        }
      }
    },
    "/v1/automations/{id}/runs": {
      "get": {
        "tags": [
          "Automations"
        ],
        "summary": "List runs",
        "operationId": "listAutomationRuns",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Automation ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter: queued|running|succeeded|failed|blocked",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 25, max 100)",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Run history (newest first)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Automation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Newest first, paginated with a cursor.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_runs"
        }
      },
      "post": {
        "tags": [
          "Automations"
        ],
        "summary": "Run an automation now",
        "operationId": "runAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Automation ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Run enqueued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunAcceptedResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Creator no longer has access to the target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Automation not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Automation not bound to a sandbox (code automation.target_missing)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Starts a run outside the schedule and returns 202 with the run ID; poll the run for its result. A cron automation returns 409 while another run is in progress. A webhook automation runs as a test delivery without a payload.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "run_now"
        }
      }
    },
    "/v1/automations/{id}/runs/{run_id}": {
      "get": {
        "tags": [
          "Automations"
        ],
        "summary": "Get a run",
        "operationId": "getAutomationRun",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Automation ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "description": "Run ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Run detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_run"
        }
      }
    },
    "/v1/automations/{id}/runs/{run_id}/redeliver": {
      "post": {
        "tags": [
          "Automations"
        ],
        "summary": "Redeliver a run",
        "operationId": "redeliverAutomationRun",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Automation ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "description": "Run ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Re-queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunAcceptedResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Creator no longer has access to the frozen target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Payload expired (scrubbed) or a cron run is in flight",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Queues a new run with the input of a past run. The original run is not changed.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "redeliver_run"
        }
      }
    },
    "/v1/hosted-mcp": {
      "get": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "listHostedMcpServers",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HostedMcpResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List hosted MCP servers",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_hosted_mcp"
        }
      },
      "post": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "createHostedMcpServer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateHostedMcpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedMcpResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create a hosted MCP server",
        "description": "Start from a catalog entry (`catalog_key`), a Registry result or your own package. The definition is copied into the server: later catalog or Registry changes do not apply to it.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "create_hosted_mcp"
        }
      }
    },
    "/v1/hosted-mcp/catalog": {
      "get": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "listHostedMcpCatalog",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HostedMcpCatalogEntry"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List the catalog",
        "description": "MCP servers curated for this deployment.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "catalog"
        }
      }
    },
    "/v1/hosted-mcp/registry": {
      "get": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "searchMcpRegistry",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedMcpRegistrySearchResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Search the MCP Registry",
        "description": "Searches the official MCP Registry. Results are unverified community content: review the publisher, package and requested credentials before you deploy one.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "registry_search"
        }
      }
    },
    "/v1/hosted-mcp/{id}": {
      "delete": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "deleteHostedMcpServer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Delete a hosted MCP server",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "delete_hosted_mcp"
        }
      },
      "get": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "getHostedMcpServer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedMcpResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get a hosted MCP server",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_hosted_mcp"
        }
      },
      "patch": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "updateHostedMcpServer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchHostedMcpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedMcpResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update a hosted MCP server",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "patch_hosted_mcp"
        }
      }
    },
    "/v1/hosted-mcp/{id}/disable": {
      "post": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "disableHostedMcpServer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedMcpResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Disable a hosted MCP server",
        "description": "The server stops accepting MCP requests until it is enabled again.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "disable_hosted_mcp"
        }
      }
    },
    "/v1/hosted-mcp/{id}/enable": {
      "post": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "enableHostedMcpServer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedMcpResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Enable a hosted MCP server",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "enable_hosted_mcp"
        }
      }
    },
    "/v1/hosted-mcp/{id}/logs": {
      "get": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "getHostedMcpServerLogs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "lines",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedMcpLogsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get server logs",
        "description": "Recent output of the MCP server process.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_hosted_mcp_logs"
        }
      }
    },
    "/v1/hosted-mcp/{id}/redeploy": {
      "post": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "redeployHostedMcpServer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedMcpResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Redeploy a hosted MCP server",
        "description": "Deploys the definition currently stored on the server again, in a new sandbox: anything written inside the previous one is lost. Returns 202; the deployment continues in the background.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "redeploy"
        }
      }
    },
    "/v1/hosted-mcp/{id}/test": {
      "post": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "testHostedMcpServer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedMcpTestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Test a hosted MCP server",
        "description": "Connects to the server's MCP endpoint and returns the tools it lists, or the reason the connection failed.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "test"
        }
      }
    },
    "/v1/hosted-mcp/{id}/token/rotate": {
      "post": {
        "tags": [
          "Hosted MCP"
        ],
        "operationId": "rotateHostedMcpServerToken",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostedMcpRotateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Rotate the access token",
        "description": "Issues a new bearer token for MCP clients. The new token is returned once, in this response.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "rotate_token"
        }
      }
    },
    "/v1/jobs": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "listJobs",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by status (pending, running, done, failed, cancelled)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max results",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed query parameter (code request.invalid_parameter): a non-numeric limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List jobs",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_jobs"
        }
      }
    },
    "/v1/jobs/{id}": {
      "delete": {
        "tags": [
          "Jobs"
        ],
        "operationId": "cancelJob",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Job ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Job cancelled"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Job already terminal, or running with no cooperative cancellation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Cancel a job",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "cancel"
        }
      },
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "getJob",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Job ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get a job",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_job"
        }
      }
    },
    "/v1/presets": {
      "get": {
        "tags": [
          "Presets"
        ],
        "operationId": "listPresets",
        "responses": {
          "200": {
            "description": "List of presets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PresetResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List presets",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_presets"
        }
      },
      "post": {
        "tags": [
          "Presets"
        ],
        "operationId": "createPreset",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePresetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Preset created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresetResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Only admins can create public presets (code permission.admin_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Template not found (code template.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "vcpu/ram_mb below the template minimum (code request.validation_failed, with an out_of_range violation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create a preset",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "create_preset"
        }
      }
    },
    "/v1/presets/{id}": {
      "delete": {
        "tags": [
          "Presets"
        ],
        "operationId": "deletePreset",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Preset ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Preset deleted (idempotent)"
          },
          "400": {
            "description": "Preset id is not a number (code request.invalid_parameter)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Not the preset owner (code permission.denied)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Delete a preset",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "delete_preset"
        }
      },
      "get": {
        "tags": [
          "Presets"
        ],
        "operationId": "getPreset",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Preset ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Preset details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Preset id is not a number (code request.invalid_parameter)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Preset not found (code preset.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get a preset",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_preset"
        }
      },
      "patch": {
        "tags": [
          "Presets"
        ],
        "operationId": "updatePreset",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Preset ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchPresetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated preset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Preset id is not a number (code request.invalid_parameter)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Not the owner (code permission.denied), or publishing without admin (code permission.admin_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Preset not found (code preset.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update a preset",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "patch_preset"
        }
      }
    },
    "/v1/sandboxes": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "operationId": "listSandboxes",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by state (running, stopped, failed, ...)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "owner_user_id",
            "in": "query",
            "description": "Filter by resolved owner user ID, including personal accounts",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "metadata",
            "in": "query",
            "description": "Filter by metadata pair, formatted `key=value`. Repeatable; a sandbox must match EVERY pair given.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max results",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Pagination offset",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of sandboxes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SandboxResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed query parameter (code request.invalid_parameter): a non-numeric owner_user_id, limit or offset, or a metadata value that is not `key=value`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List sandboxes",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_sandboxes"
        }
      },
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "operationId": "createSandbox",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "1..200 visible ASCII characters. The key is scoped to the account and bound to the exact request. A successful create replays for 30 days. A different request with the same key receives 409 immediately; a repeat of a create that has not finished waits up to 30 seconds for it before returning 409. After a failed attempt the key can be reused only once that attempt is fully cleaned up.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSandboxBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Idempotent replay — a completed successful create with this key is returned without creating another sandbox. If the sandbox exists but its original response was not saved, the required fields are rebuilt from the stored sandbox once the create and provisioning deadlines, plus a margin, have passed.",
            "headers": {
              "X-Idempotent-Replay": {
                "schema": {
                  "type": "string"
                },
                "description": "Always `1`, and present on this branch only — the marker that distinguishes a replay from a fresh create."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedSandboxResponse"
                }
              }
            }
          },
          "201": {
            "description": "Sandbox created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedSandboxResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key belongs to another payload, or the original create has not finished or proved cleanup",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Service, dependency, or host capacity temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create a sandbox",
        "description": "Send an `Idempotency-Key` header to retry safely: a repeated request with the same key and body returns the sandbox created by the first one instead of creating another.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "create_sandbox"
        }
      }
    },
    "/v1/sandboxes/{id}": {
      "delete": {
        "tags": [
          "Sandboxes"
        ],
        "operationId": "deleteSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Sandbox deleted"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Another operation owns the sandbox (code sandbox.operation_in_progress, params.operation names the holder), the sandbox was resumed since this delete read it (code sandbox.runtime_changed), or its VM is still running unmanaged (code sandbox.vm_unmanaged)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait; always `1` when params.operation is `stopping`, absent for other holders"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Sandbox metadata required for deletion is temporarily unavailable (deletion is incomplete and may be retried), or the owning node is unreachable or withdrawn (codes dependency.unavailable, sandbox.owner_unavailable, service.unavailable, service.draining)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Delete a sandbox",
        "description": "Deletes the sandbox and its data. A deleted sandbox cannot be restored.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "delete_sandbox"
        }
      },
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "operationId": "getSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sandbox details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get a sandbox",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_sandbox"
        }
      },
      "patch": {
        "tags": [
          "Sandboxes"
        ],
        "operationId": "updateSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated sandbox",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Visible sandbox cannot be changed by this caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "Visibility dependencies or a field failed validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Effective policy could not be read (code dependency.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update a sandbox",
        "description": "Partial update of the sandbox settings.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "patch_sandbox"
        }
      }
    },
    "/v1/sandboxes/{id}/events": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "operationId": "listSandboxEvents",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recent lifecycle/diagnostic events (most-recent-first)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SandboxEventView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List sandbox events",
        "description": "Recent lifecycle and diagnostic events, newest first.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_sandbox_events"
        }
      }
    },
    "/v1/sandboxes/{id}/hibernate": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "operationId": "hibernateSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sandbox hibernated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HibernateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found (code sandbox.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Not running, including a stopped or failed sandbox that has no owner node (code sandbox.state_conflict, with params.state + params.expected_states), or the owner refused: another operation owns the sandbox (code sandbox.operation_in_progress, params.operation names the holder, answered even when the state also differs; Retry-After: 1 when it is stopping), or an unhealthy guest (code sandbox.hibernate_guest_unhealthy)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait; always `1` when params.operation is `stopping`, absent for other holders"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "The owning node answered something that is not the error contract (code upstream.failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Transient: the owning node is unreachable or still coming back, or required metering confirmation failed, so the hibernate can be retried (codes sandbox.owner_unavailable, which is also returned for a running, starting, stopping, hibernating or resuming sandbox that has no owning node recorded; dependency.unavailable; service.draining when the owning node has been withdrawn; service.starting and service.draining from the owning node)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "504": {
            "description": "The owning node did not answer inside the forward deadline (codes dependency.timeout_predispatch, dependency.timeout_outcome_unknown)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Hibernate a sandbox",
        "description": "Saves the full VM state (memory, CPU and processes) together with the filesystem. Bring it back with `wake`.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "hibernate_sandbox"
        }
      }
    },
    "/v1/sandboxes/{id}/resume": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "operationId": "resumeSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID (must be in stopped state)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Optional resource overrides",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResumeSandboxBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Sandbox resumed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found (code sandbox.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Sandbox is not in stopped or stopping state (code sandbox.state_conflict, with params.state + params.expected_states), or another operation owns it (code sandbox.operation_in_progress, params.operation names the holder). A sandbox.runtime_changed (the sandbox changed while the resume was being claimed) is retried once automatically; only a second one reaches the caller",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait; always `1` when params.operation is `stopping`, absent for other holders"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "The resumed sandbox would put the account over quota (code quota.exceeded)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "The owning node answered something that is not the error contract (code upstream.failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Transient: the owning node is unreachable or still coming back, so the resume can be retried (codes sandbox.owner_unavailable, dependency.unavailable, service.unavailable when placement finds no eligible node, and the node's own service.starting, service.draining and capacity.temporarily_exhausted relayed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "504": {
            "description": "The owning node did not answer inside the forward deadline (codes dependency.timeout_predispatch, dependency.timeout_outcome_unknown)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Resume a stopped sandbox",
        "description": "Boots a stopped sandbox from its saved filesystem. Can return 503 when no worker has capacity; retry the same request.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "resume"
        }
      }
    },
    "/v1/sandboxes/{id}/stop": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "operationId": "stopSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sandbox stopped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found (code sandbox.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Not running, including a stopped or failed sandbox that has no owner node (code sandbox.state_conflict, with params.state + params.expected_states), or another operation owns it (code sandbox.operation_in_progress, params.operation names the holder: stopping, hibernate, save_as_template, ...; the holder is answered even when the state also differs, so a second stop during a stop answers operation=stopping)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait; always `1` when params.operation is `stopping`, absent for other holders"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "The owning node answered something that is not the error contract (code upstream.failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Transient: the owning node is unreachable, still coming back, or draining and will not start a new stop — retry (codes sandbox.owner_unavailable, which is also returned for a running, starting, stopping, hibernating or resuming sandbox that has no owning node recorded; dependency.unavailable, including a failed metering confirmation; service.starting and service.draining from the owning node; service.draining also when the owning node has been withdrawn)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "504": {
            "description": "The owning node did not answer inside the forward deadline (codes dependency.timeout_predispatch, dependency.timeout_outcome_unknown)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Stop a sandbox",
        "description": "Shuts the sandbox down and keeps its filesystem. Running processes and memory are lost. Bring it back with `resume`.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "stop_sandbox"
        }
      }
    },
    "/v1/sandboxes/{id}/wake": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "operationId": "wakeSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID (must be in hibernated state)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sandbox woken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found (code sandbox.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Sandbox is not in hibernated state, or the owner node is denied by affinity (codes sandbox.state_conflict, placement.policy_unsatisfied), or another operation owns it (code sandbox.operation_in_progress, params.operation names the holder), or the sandbox changed while the wake was being claimed (code sandbox.runtime_changed; not retried automatically, since a wake must run on the owning node)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait; always `1` when params.operation is `stopping`, absent for other holders"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "The woken sandbox would put the account over quota (code quota.exceeded)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "The owning node answered something that is not the error contract (code upstream.failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Transient: the owning node is unreachable or still coming back, so the wake can be retried (codes sandbox.owner_unavailable, dependency.unavailable, and service.draining answered before dialing a withdrawn node; the node's own service.starting, service.draining, service.unavailable and capacity.temporarily_exhausted relayed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "504": {
            "description": "The owning node did not answer inside the forward deadline (codes dependency.timeout_predispatch, dependency.timeout_outcome_unknown)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Wake a hibernated sandbox",
        "description": "Restores a hibernated sandbox with its processes and memory.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "wake"
        }
      }
    },
    "/v1/secrets": {
      "get": {
        "tags": [
          "Secrets"
        ],
        "summary": "List secrets",
        "operationId": "listSecrets",
        "responses": {
          "200": {
            "description": "Secrets list (masked)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SecretResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Secrets store enabled but not configured (code feature.unavailable, no Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Secret values are never returned.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_secrets"
        }
      },
      "post": {
        "tags": [
          "Secrets"
        ],
        "summary": "Create a secret",
        "operationId": "createSecret",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSecretRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Secret created (value masked)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Secrets store enabled but not configured (code feature.unavailable, no Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "create_secret"
        }
      }
    },
    "/v1/secrets/{id}": {
      "delete": {
        "tags": [
          "Secrets"
        ],
        "summary": "Delete a secret",
        "operationId": "deleteSecret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Secret ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Secrets store enabled but not configured (code feature.unavailable, no Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Deleting a secret that does not exist returns 204.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "delete_secret"
        }
      },
      "get": {
        "tags": [
          "Secrets"
        ],
        "summary": "Get a secret",
        "operationId": "getSecret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Secret ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Secret (masked)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Secrets store enabled but not configured (code feature.unavailable, no Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Returns the secret metadata and a masked preview. The value itself is never returned.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_secret"
        }
      },
      "patch": {
        "tags": [
          "Secrets"
        ],
        "summary": "Update a secret",
        "operationId": "updateSecret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Secret ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSecretRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated secret (masked)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Visible secret cannot be changed by this caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Name already exists or concurrent value update (state.conflict)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "Invalid field or retained copies prevent narrowing visibility",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Secrets store enabled but not configured (code feature.unavailable, no Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "patch_secret"
        }
      }
    },
    "/v1/skills/catalog": {
      "get": {
        "tags": [
          "Skills"
        ],
        "summary": "List just-run skills",
        "operationId": "listSkills",
        "responses": {
          "200": {
            "description": "The plugin (Claude Code and Codex) and the skills it installs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillsCatalogResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "The plugin failed to load on this deployment (code feature.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "description": "The just-run skills and how to install them. Requires no authentication.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_skills"
        }
      }
    },
    "/v1/skills/search": {
      "get": {
        "tags": [
          "Skills"
        ],
        "summary": "Search skills.sh",
        "operationId": "searchSkills",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Optional upstream result limit",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "skills.sh search response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "Missing or empty query (code request.validation_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "skills.sh answered something unusable (code dependency.invalid_response)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "skills.sh is unreachable or refusing (code dependency.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Searches the external skills.sh catalog.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "skills_search"
        }
      }
    },
    "/v1/storage/objects": {
      "get": {
        "tags": [
          "Storage"
        ],
        "summary": "List objects",
        "operationId": "listStorageObjects",
        "parameters": [
          {
            "name": "prefix",
            "in": "query",
            "description": "Key prefix to list under (account-relative).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "delimiter",
            "in": "query",
            "description": "Only `\"/\"` is supported — groups keys into `common_prefixes`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Continuation cursor from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1..=1000 (default 100).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page of objects (+ server-side folders when delimiter=/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid prefix / delimiter / limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Storage backend unavailable; a deployment with user storage switched off answers 404 feature.not_enabled instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Lists keys under a prefix, paginated with a cursor.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_storage_objects"
        }
      }
    },
    "/v1/storage/objects/{key}": {
      "delete": {
        "tags": [
          "Storage"
        ],
        "summary": "Delete an object",
        "operationId": "deleteStorageObject",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "description": "Object key (URL-encoded; may contain '/')",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted (or did not exist)"
          },
          "400": {
            "description": "Invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Another operation owns this object key (storage.operation_in_progress)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Storage backend unavailable; a deployment with user storage switched off answers 404 feature.not_enabled instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Deleting an object that does not exist returns 204.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "delete_object"
        }
      },
      "get": {
        "tags": [
          "Storage"
        ],
        "summary": "Download an object",
        "operationId": "getStorageObject",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "description": "Object key (URL-encoded; may contain '/')",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Object bytes. Content-Type is the type recorded at upload (or inferred from the key extension); Content-Disposition always names the file as an attachment."
          },
          "400": {
            "description": "Invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Object not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Object exceeds max_inline_bytes — use presign (code storage.object_too_large_for_inline, params size_bytes/max_inline_bytes)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Storage backend unavailable; a deployment with user storage switched off answers 404 feature.not_enabled instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_object"
        }
      },
      "head": {
        "tags": [
          "Storage"
        ],
        "summary": "Get object metadata",
        "operationId": "headStorageObject",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "description": "Object key (URL-encoded; may contain '/')",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata in Content-Type / Content-Length / Content-Disposition / ETag / Last-Modified headers"
          },
          "400": {
            "description": "Invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Object not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Storage backend unavailable; a deployment with user storage switched off answers 404 feature.not_enabled instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "head_object"
        }
      },
      "put": {
        "tags": [
          "Storage"
        ],
        "summary": "Upload an object",
        "operationId": "putStorageObject",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "description": "Object key (URL-encoded; may contain '/')",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Raw object bytes. The request Content-Type is recorded and replayed on download; omit it and the key extension decides.",
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32",
                  "minimum": 0
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Object stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoragePutResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "New or growing object denied by account policy (feature.not_enabled)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Another operation owns this object key (storage.operation_in_progress)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds max_inline_bytes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "User storage quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Storage backend unavailable; a deployment with user storage switched off answers 404 feature.not_enabled instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Uploads the request body as the object. For large objects use a presigned upload.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "put_object"
        }
      }
    },
    "/v1/storage/presign": {
      "post": {
        "tags": [
          "Storage"
        ],
        "summary": "Create a presigned URL",
        "operationId": "presignStorageObject",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoragePresignRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Presigned URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoragePresignResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid key / method / missing content_length",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "New or growing object denied by account policy (feature.not_enabled)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Another operation owns this object key (storage.operation_in_progress)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "content_length exceeds max_object_bytes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "User storage quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Storage backend unavailable; a deployment with user storage switched off answers 404 feature.not_enabled instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Returns a URL to upload or download a large object directly, without passing its bytes through the API. An upload is published by completing its upload session.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "presign"
        }
      }
    },
    "/v1/storage/uploads/{upload_id}": {
      "delete": {
        "tags": [
          "Storage"
        ],
        "summary": "Abandon an upload",
        "operationId": "abandonStorageUpload",
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "description": "Account-scoped multipart session",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Upload abandoned; the unpublished session and its reserved space are released"
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Write permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Session not found in this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Already published: delete the object instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Publication already dispatched or storage admission unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Cancels an unpublished upload and releases the space reserved for it.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "abandon_upload"
        }
      }
    },
    "/v1/storage/uploads/{upload_id}/complete": {
      "post": {
        "tags": [
          "Storage"
        ],
        "summary": "Complete an upload",
        "operationId": "completeStorageUpload",
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "description": "Account-scoped upload session returned by presign PUT",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Object published, or original successful completion receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoragePutResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Write permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Upload session not found in this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Expired, abandoned or concurrently claimed session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "Uploaded part is missing or does not match declared length",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Publication outcome unresolved or storage unavailable; do not blindly republish",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Publishes the object uploaded to a presigned URL. Repeating the call returns the original result.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "complete_upload"
        }
      }
    },
    "/v1/storage/usage": {
      "get": {
        "tags": [
          "Storage"
        ],
        "summary": "Get storage usage",
        "operationId": "getStorageUsage",
        "responses": {
          "200": {
            "description": "Usage and quota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageUsageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Usage or policy unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Current usage and quota.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "usage"
        }
      }
    },
    "/v1/templates": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "listTemplates",
        "parameters": [
          {
            "name": "include_hidden",
            "in": "query",
            "description": "Admin only: include hidden templates",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Template catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Effective account policy could not be resolved (code service.unavailable or dependency.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List templates",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_templates"
        }
      }
    },
    "/v1/templates/{name}": {
      "delete": {
        "tags": [
          "Templates"
        ],
        "operationId": "deleteTemplate",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Template name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Physical retirement accepted; poll the job. The template and its versions keep counting toward quota until cleanup finishes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteTemplateAccepted"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Not the template owner, or an organization member without the owner/admin role (code permission.denied)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Template not found (code template.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Template has active sandboxes, is frozen (code template.frozen), or has an unpublished save (code template.version_operation_in_progress)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Delete a template",
        "description": "Returns 202 with a job; the template is removed when the job finishes. Fails with 409 while sandboxes use the template.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "delete_template"
        }
      },
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "getTemplate",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Template name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Template details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Template not found (code template.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Effective account policy could not be resolved (code service.unavailable or dependency.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get a template",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "get_template"
        }
      },
      "patch": {
        "tags": [
          "Templates"
        ],
        "operationId": "updateTemplate",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Template name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Not the owner or an organization member without the owner/admin role (code permission.denied), or an admin-only field was set (code permission.admin_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Template not found (code template.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Template is frozen (code template.frozen)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update a template",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "patch_template"
        }
      }
    },
    "/v1/templates/{name}/versions": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "listTemplateVersions",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Template name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Template versions, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateVersionResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Template not found (code template.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List template versions",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_versions"
        }
      }
    },
    "/v1/templates/{name}/versions/{version}": {
      "delete": {
        "tags": [
          "Templates"
        ],
        "operationId": "deleteTemplateVersion",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Template name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "description": "Template version to delete",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Delete job accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteVersionAccepted"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Not the template owner, or an organization member without the owner/admin role (code permission.denied)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Template or version not found (codes template.not_found / template.version_not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Template frozen (code template.frozen), a ready default version (code template.version_is_default), referenced by sandboxes (code template.version_in_use, with params.sandbox_count + params.sandboxes), or a delete already in flight (code template.version_operation_in_progress)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Delete a template version",
        "description": "Returns 202 with a job. A default version that is ready and versions used by sandboxes cannot be deleted.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "delete_version"
        }
      },
      "patch": {
        "tags": [
          "Templates"
        ],
        "operationId": "updateTemplateVersion",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Template name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "description": "Template version",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchVersionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateVersionResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Not the template owner, or an organization member without the owner/admin role (code permission.denied)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Template or version not found (codes template.not_found / template.version_not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update a template version",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "patch_version"
        }
      }
    },
    "/v1/templates/{name}/versions/{version}/default": {
      "put": {
        "tags": [
          "Templates"
        ],
        "operationId": "setDefaultTemplateVersion",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Template name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "description": "Template version to make the default",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated version (now default)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateVersionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Not the template owner, or an organization member without the owner/admin role (code permission.denied)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Template or version not found (codes template.not_found / template.version_not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Template is frozen (code template.frozen), or the target version is not usable (codes template.version_not_ready / template.version_operation_in_progress / template.version_upload_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Set the default version",
        "description": "New sandboxes created from the template use this version.",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "set_default_version"
        }
      }
    },
    "/v1/templates/{name}/versions/{version}/sandboxes": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "listTemplateVersionSandboxes",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Template name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "description": "Template version",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sandboxes referencing this version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VersionSandboxResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "Not the template owner (code permission.denied)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Template not found (code template.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List sandboxes using a version",
        "x-just-run-source": {
          "document": "gateway",
          "operationId": "list_version_sandboxes"
        }
      }
    },
    "/v1/sandboxes/{id}/exec": {
      "post": {
        "tags": [
          "Execution"
        ],
        "summary": "Run a command",
        "operationId": "runCommand",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Command result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json), or the agent inside the sandbox refused the request — `user` names no account in the sandbox, or `cwd` is not a directory (code request.invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer). Pointer `/cmd`: the program cannot be executed in the sandbox — it does not exist, the user may not execute it, or it is not an executable format. `cmd` names one program, not a shell line; run a shell line as `bash` with `args: [\"-c\", \"...\"]`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "The agent inside the sandbox failed or the connection to it broke; the command may or may not have run (code upstream.failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers, or the guest is at its process cap (code service.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "504": {
            "description": "The command did not finish within `timeout`; it may still be running (code sandbox.exec_timeout)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Runs a command and waits for it to finish. A non-zero exit code is returned in `exit_code`, not as an HTTP error.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "exec"
        }
      }
    },
    "/v1/sandboxes/{id}/exec-stream": {
      "post": {
        "tags": [
          "Execution"
        ],
        "summary": "Run a command with streamed output",
        "operationId": "runCommandStream",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "SSE stream. Events: {type:'stdout'|'stderr',text:string}, {type:'exit',code:number}",
            "content": {
              "text/event-stream": {}
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json), or the agent inside the sandbox refused the request — `user` names no account in the sandbox, or `cwd` is not a directory (code request.invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer). Pointer `/cmd`: the program cannot be executed in the sandbox — it does not exist, the user may not execute it, or it is not an executable format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "The agent inside the sandbox failed or the connection to it broke before the stream opened; the command may or may not have run (code upstream.failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers, or the guest is at its process cap (code service.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Same command shape as `exec`, without `stdin`. Returns `text/event-stream` with `stdout`, `stderr` and a final `exit` event.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "exec_stream"
        }
      }
    },
    "/v1/sandboxes/{id}/files": {
      "delete": {
        "tags": [
          "Files"
        ],
        "summary": "Delete a file or directory",
        "operationId": "deleteFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "remove"
        }
      },
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Read a file",
        "operationId": "readFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "File content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadFileResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "read_file"
        }
      },
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Write a file",
        "operationId": "writeFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteFileBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "File written"
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "write_file"
        }
      }
    },
    "/v1/sandboxes/{id}/files/download": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Download a file",
        "operationId": "downloadFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Raw file content. An EMPTY file is a 200 with a zero-length body, not a 404 — only an absent path is a 404.",
            "content": {
              "application/octet-stream": {}
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Returns the file as raw bytes.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "download_file"
        }
      }
    },
    "/v1/sandboxes/{id}/files/list": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "List a directory",
        "operationId": "listDirectory",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Directory listing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FileEntry"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "list_dir"
        }
      }
    },
    "/v1/sandboxes/{id}/files/mkdir": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Create a directory",
        "operationId": "makeDirectory",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MkdirBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Directory created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileEntry"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "make_dir"
        }
      }
    },
    "/v1/sandboxes/{id}/files/move": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Move or rename a file",
        "operationId": "moveFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "File moved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileEntry"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "move_file"
        }
      }
    },
    "/v1/sandboxes/{id}/files/stat": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Get file metadata",
        "operationId": "statFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "File metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileEntry"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "stat_file"
        }
      }
    },
    "/v1/sandboxes/{id}/files/upload": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Upload files",
        "operationId": "uploadFiles",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "description": "Destination directory (files are written as `<path>/<filename>`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32",
                  "minimum": 0
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Files uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UploadedFile"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeded the node's upload limit (code request.payload_too_large). Nothing was written",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "The request was not multipart/form-data (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer). A request carrying no file part is blamed on `/file`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Uploads files as `multipart/form-data`.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "upload_file"
        }
      }
    },
    "/v1/sandboxes/{id}/guest-logs": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Get application logs",
        "operationId": "getSandboxLogs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lines",
            "in": "query",
            "description": "Recent lines, default 200; clamped to the configured diagnostics.log_max_lines",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "unit",
            "in": "query",
            "description": "Optional guest systemd unit, e.g. web.service. At most 128 ASCII letters, digits, hyphens, underscores, dots, @ or colons; blank means all units",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Guest journal lines, oldest to newest; empty lines and note if the VM is not running or the journal is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameter (request.invalid_parameter)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox missing or not visible to the caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Owner or required dependency unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Recent lines from the system journal inside the sandbox. Works only while the sandbox is running: a hibernated sandbox is not woken to read its logs.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "sandboxGuestLogs"
        }
      }
    },
    "/v1/sandboxes/{id}/metrics": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Get live metrics",
        "operationId": "getSandboxMetrics",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Live VM metrics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxMetrics"
                }
              }
            }
          },
          "204": {
            "description": "No live metrics: the sandbox is off or transitioning, or its direct route is not active yet (up to ~1s after it reaches running) — retry rather than treating 204 as an error"
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Live resource usage of a running sandbox. Returns 204 while the sandbox is not running; retry later.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "metrics"
        }
      }
    },
    "/v1/sandboxes/{id}/ports": {
      "get": {
        "tags": [
          "Ports"
        ],
        "summary": "List published ports",
        "operationId": "listPorts",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of exposed ports",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExposedPortResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "list_ports"
        }
      },
      "post": {
        "tags": [
          "Ports"
        ],
        "summary": "Publish a port",
        "operationId": "exposePort",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExposePortRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Port exposed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExposedPortResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found or publishing capability unavailable (feature.not_enabled)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Port already exposed (preview_url.already_exists), or the requested preview address is taken (preview_url.in_use)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "port is 0, or an empty bearer token (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "Publishing quota exceeded (quota.exceeded)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Preview URLs are not configured on this node (code feature.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Makes a service port reachable at a preview URL.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "expose_port"
        }
      }
    },
    "/v1/sandboxes/{id}/ports/{port}": {
      "delete": {
        "tags": [
          "Ports"
        ],
        "summary": "Unpublish a port",
        "operationId": "unexposePort",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "port",
            "in": "path",
            "description": "Port number",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Port unexposed"
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Preview URLs unconfigured (feature.unavailable) or metadata unavailable (dependency.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "unexpose_port"
        }
      },
      "patch": {
        "tags": [
          "Ports"
        ],
        "summary": "Change port access",
        "operationId": "updatePortAccess",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "port",
            "in": "path",
            "description": "Port",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePortAuthRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Protection updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExposedPortResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "URL missing or publishing capability not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "Positive publishing delta exceeds quota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required dependency unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Changes who can open the preview URL of a published port.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "change_port_auth"
        }
      }
    },
    "/v1/sandboxes/{id}/processes": {
      "get": {
        "tags": [
          "Execution"
        ],
        "summary": "List processes",
        "operationId": "listProcesses",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Background and buffered-exec processes, including those that exited less than 60 s ago. No status here: read it from `/output`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProcessListEntry"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "The agent inside the sandbox failed or the connection to it broke (code upstream.failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Background processes and commands, including those that exited less than 60 seconds ago.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "list_processes"
        }
      }
    },
    "/v1/sandboxes/{id}/processes/{pid}/attach": {
      "get": {
        "tags": [
          "Execution"
        ],
        "summary": "Attach to a process",
        "operationId": "attachProcess",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pid",
            "in": "path",
            "description": "Process ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "101": {
            "description": "WebSocket upgrade. Streams replay (replaystart/replayend) + live output; accepts stdin frames. A `signal` frame is parsed and IGNORED — use the /signal route",
            "content": {
              "application/json": {
                "schema": {
                  "default": null
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox or process not found (codes sandbox.not_found / process.not_found) — answered BEFORE the upgrade",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "WebSocket connection to a running process: its output and your input.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "attach_process"
        }
      }
    },
    "/v1/sandboxes/{id}/processes/{pid}/output": {
      "get": {
        "tags": [
          "Execution"
        ],
        "summary": "Get process output",
        "operationId": "getProcessOutput",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pid",
            "in": "path",
            "description": "Process ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "tail_bytes",
            "in": "query",
            "description": "Last bytes of each stream to return: default 65536, maximum 1048576",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Output snapshot. `running: false` with `exit_code` once the process has exited; it stays readable for 60 s after exit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessOutputResponse"
                }
              }
            }
          },
          "400": {
            "description": "`tail_bytes` is outside 1..=1048576 (code request.invalid_parameter)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox or process not found (codes sandbox.not_found / process.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "A snapshot of this process is already in flight (code rate_limit.exceeded, Retry-After: 1)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "The agent inside the sandbox failed or the connection to it broke (code upstream.failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "504": {
            "description": "The replay did not finish within 5 s (code upstream.timeout)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "The output a process has printed so far, without affecting it. Readable for 60 seconds after the process exits.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "process_output"
        }
      }
    },
    "/v1/sandboxes/{id}/processes/{pid}/signal": {
      "post": {
        "tags": [
          "Execution"
        ],
        "summary": "Send a signal to a process",
        "operationId": "signalProcess",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pid",
            "in": "path",
            "description": "Process ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Signal sent"
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox or process not found (codes sandbox.not_found / process.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "Unknown signal name (code request.validation_failed, violation at /signal)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "signal_process"
        }
      }
    },
    "/v1/sandboxes/{id}/processes/{pid}/stdin": {
      "post": {
        "tags": [
          "Execution"
        ],
        "summary": "Send input to a process",
        "operationId": "sendProcessInput",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pid",
            "in": "path",
            "description": "Process ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32",
                  "minimum": 0
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Stdin delivered. The guest has confirmed it consumed the bytes before this is answered",
            "content": {
              "application/json": {
                "schema": {
                  "default": null
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox or process not found (codes sandbox.not_found / process.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "send_stdin"
        }
      }
    },
    "/v1/sandboxes/{id}/proxy/{port}/{path}": {
      "get": {
        "tags": [
          "Proxy"
        ],
        "summary": "Proxy a request to a sandbox port",
        "operationId": "proxyRequest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "port",
            "in": "path",
            "description": "Port number",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "path",
            "in": "path",
            "description": "Path to proxy",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Proxied response from sandbox service"
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "Backend unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Forwards the request to the HTTP service listening on `port` inside the sandbox. Every HTTP method is forwarded, not only `GET`.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "proxy_http"
        }
      }
    },
    "/v1/sandboxes/{id}/refresh": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Extend the sandbox timeout",
        "operationId": "extendSandboxTimeout",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Timeout refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxResponseSupervisor"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "`timeout_ms` is absent from both the body and the sandbox, or is not positive (code request.validation_failed, pointer /timeout_ms)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Restarts the `timeout_ms` window from now, optionally with a new value.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "refresh"
        }
      }
    },
    "/v1/sandboxes/{id}/restart": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Restart a failed sandbox",
        "operationId": "restartSandbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResumeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Sandbox restarted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "Sandbox is not failed/stopping, another operation owns the sandbox (code sandbox.operation_in_progress, params.operation names the holder; Retry-After: 1 for stopping), the stop that produced this state is still uploading (code sandbox.operation_in_progress, params.operation=stopping — use resume, which takes over the sandbox and aborts that upload), or the sandbox disk is missing on the host",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait; always `1` when params.operation is `stopping`, absent for other holders"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (code request.validation_failed, with a violation pointer)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable (retry after the dependency recovers), or the node is withdrawn or out of network slots for the boot (codes service.draining, service.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Boots a sandbox that is `failed` or was interrupted while stopping. Does not reboot a healthy sandbox.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "restart"
        }
      }
    },
    "/v1/sandboxes/{id}/save-as-template": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Save a sandbox as a template",
        "operationId": "saveSandboxAsTemplate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveAsTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Template created or updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON (code request.invalid_json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "403": {
            "description": "overwrite=true names a template the organization account already owns and the caller is not its owner/admin (code permission.denied)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found, or template authoring is not enabled for this account (code feature.not_enabled)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "409": {
            "description": "The sandbox is in a state that cannot be saved (code sandbox.state_conflict, with params.state and params.expected_states), another operation owns it (code sandbox.operation_in_progress, params.operation names the holder, including a concurrent save, hibernate or stop), the template name is in use (code template.already_exists; set overwrite=true to replace — a caller without the owner/admin role whose overwrite was refused at write time lands here too), or the existing template is frozen (code template.frozen)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait; always `1` when params.operation is `stopping`, absent for other holders"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "Invalid template name: empty, longer than 64 characters, or not lowercase letters, digits and inner hyphens (pointer /name); or the sandbox holds materialized secret copies that must not enter a template (pointer /sandbox_id, params.reason template_secret_copy). Code request.validation_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "429": {
            "description": "Template/version count or measured template/version bytes would exceed account policy (code quota.exceeded, params.resource identifies the limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Saves the sandbox filesystem as a template; with `overwrite: true` an existing template of the same name is updated. A running sandbox is stopped first and stays stopped. Files written in the sandbox, including credentials, become part of the template.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "save_as_template"
        }
      }
    },
    "/v1/sandboxes/{id}/start": {
      "post": {
        "tags": [
          "Execution"
        ],
        "summary": "Start a background process",
        "operationId": "startProcess",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartProcessRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Process started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StartProcessResponse"
                }
              }
            }
          },
          "400": {
            "description": "The agent inside the sandbox refused the request — e.g. `user` names no account in the sandbox, or `cwd` is not a directory (code request.invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "413": {
            "description": "The body exceeds the documented limit (code request.payload_too_large)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (code request.unsupported_media_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "422": {
            "description": "A parameter or field failed validation (code request.validation_failed, with a violation pointer). Pointer `/cmd`: the program cannot be executed in the sandbox",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "502": {
            "description": "The agent inside the sandbox failed or the connection to it broke; the process may or may not have started (code upstream.failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "The guest is at its process cap (code service.unavailable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Starts a process that keeps running after the request and returns its PID.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "start_process"
        }
      }
    },
    "/v1/sandboxes/{id}/terminal": {
      "get": {
        "tags": [
          "Terminal"
        ],
        "summary": "Open a terminal",
        "operationId": "openTerminal",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Sandbox ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "WebSocket upgrade. JSON protocol: client sends start/input/resize, server sends started/output/exited"
          },
          "401": {
            "description": "Missing or invalid credentials (code auth.required or auth.token_invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "404": {
            "description": "Sandbox not found (code sandbox.not_found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error (code internal.unexpected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          },
          "503": {
            "description": "Required metadata unavailable; retry after the dependency recovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "WebSocket connection to an interactive shell in the sandbox.",
        "x-just-run-source": {
          "document": "supervisor",
          "operationId": "terminal_ws"
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Personal access token."
      }
    },
    "schemas": {
      "AuditLogRow": {
        "type": "object",
        "required": [
          "id",
          "created_at",
          "actor_type",
          "event_type",
          "resource_type",
          "outcome",
          "metadata"
        ],
        "properties": {
          "account_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "actor_email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recorded nonempty address, otherwise a current profile address visible to\nthe reader. Null when the profile is missing or its disclosure is restricted."
          },
          "actor_type": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "ip_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "type": "object"
          },
          "node_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "outcome": {
            "type": "string"
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "resource_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "resource_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "resource_type": {
            "type": "string"
          },
          "user_agent": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "AuditLogsResponse": {
        "type": "object",
        "required": [
          "logs",
          "total"
        ],
        "properties": {
          "logs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditLogRow"
            }
          },
          "total": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "AutomationHookResponse": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "run_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "status": {
            "type": "string",
            "description": "`accepted` (a new run was queued) or `replay` (idempotent repeat — no\nnew run)."
          }
        }
      },
      "AutomationPermissions": {
        "type": "object",
        "required": [
          "mutate",
          "change_visibility"
        ],
        "properties": {
          "change_visibility": {
            "type": "boolean"
          },
          "mutate": {
            "type": "boolean"
          }
        }
      },
      "AutomationResponse": {
        "type": "object",
        "required": [
          "id",
          "name",
          "visibility",
          "permissions",
          "trigger_kind",
          "action_kind",
          "timezone",
          "verifier_config",
          "target_path",
          "forward_headers",
          "enabled",
          "max_attempts",
          "concurrency_mode",
          "payload_retention_hours",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "action_kind": {
            "type": "string"
          },
          "command": {},
          "concurrency_mode": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "cron_expr": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "forward_headers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "last_event_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_run_exit_code": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Exit code of the last command run. A non-zero exit is still a\n`succeeded` (completed) run, so read both to tell whether it worked."
          },
          "last_run_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "last_run_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Status of the last run: `queued` | `running` | `succeeded` | `failed` |\n`blocked`. Absent when there has been no run or it has been pruned."
          },
          "max_attempts": {
            "type": "integer",
            "format": "int32"
          },
          "max_concurrent_runs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "next_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "payload_retention_hours": {
            "type": "integer",
            "format": "int32"
          },
          "permissions": {
            "$ref": "#/components/schemas/AutomationPermissions",
            "description": "Effective permissions for the caller in this account context."
          },
          "secret_preview": {
            "description": "Masked secret metadata (`{set}`, plus `source` — the `secret://` reference\nthe value was copied from — and `source_secret_id` when there is one; no part\nof the value); webhook only."
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "target_path": {
            "type": "string"
          },
          "target_port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "target_sandbox_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "timezone": {
            "type": "string"
          },
          "trigger_kind": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "verifier_config": {},
          "verifier_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "visibility": {
            "type": "string"
          },
          "webhook_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public webhook URL (`{base}/v1/automations/hooks/{slug}`), for webhook\nautomations only. The path never changes; `{base}` is set by the\ndeployment and can differ per webhook provider."
          }
        }
      },
      "CatalogSkill": {
        "type": "object",
        "required": [
          "key",
          "description"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "What the skill does and when Claude uses it (English, from the skill itself)."
          },
          "key": {
            "type": "string",
            "description": "The skill's name in Claude Code."
          }
        }
      },
      "ChangePortAuthRequest": {
        "type": "object",
        "description": "Replace authentication on an existing URL; its label and port stay stable.",
        "required": [
          "auth"
        ],
        "properties": {
          "auth": {
            "$ref": "#/components/schemas/PortAuthRequest"
          }
        },
        "additionalProperties": false
      },
      "CodexInstall": {
        "type": "object",
        "description": "How to install the plugin in Codex.",
        "required": [
          "repository_url",
          "install_commands"
        ],
        "properties": {
          "install_commands": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The terminal commands that install the plugin, in order."
          },
          "repository_url": {
            "type": "string",
            "description": "The read-only Git repository Codex clones: `{public_base_url}/plugins/codex.git`."
          }
        }
      },
      "CommandAction": {
        "type": "object",
        "description": "The command action spec (maps to `automations.action_command`).",
        "required": [
          "argv"
        ],
        "properties": {
          "argv": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "argv; `argv[0]` is the executable. Non-empty list of non-empty strings."
          },
          "cwd": {
            "type": [
              "string",
              "null"
            ]
          },
          "env": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "on_complete": {
            "type": [
              "string",
              "null"
            ],
            "description": "`hibernate` | `stop` | `none`. Omitted defaults follow account policy."
          },
          "retry_on_nonzero": {
            "type": "boolean",
            "description": "When true, a completed command with a non-zero exit code is retried\nlike a failed run (default false: any completed run is a success). The\nvalue in force when a run is queued applies to that run."
          },
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "CreateAutomationRequest": {
        "type": "object",
        "required": [
          "name",
          "trigger_kind",
          "action_kind"
        ],
        "properties": {
          "action_kind": {
            "type": "string",
            "description": "`command` | `http`."
          },
          "command": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CommandAction"
              }
            ]
          },
          "concurrency_mode": {
            "type": [
              "string",
              "null"
            ],
            "description": "`parallel` (default) | `serial` | `partitioned`. `partitioned` requires\nthe Telegram webhook verifier."
          },
          "cron_expr": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "forward_headers": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "max_attempts": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Per-automation attempt cap (1..20). Omitted, the deployment default applies."
          },
          "max_concurrent_runs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Maximum number of runs of this automation in progress at once (1..64).\n`null` means no per-automation limit."
          },
          "name": {
            "type": "string"
          },
          "payload_retention_hours": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Hours a webhook run keeps its raw body/headers before they are scrubbed (1..720, default 24)."
          },
          "secret": {
            "type": [
              "string",
              "null"
            ],
            "description": "The HMAC secret / shared token (webhook only). Encrypted at rest, never returned.\n`secret://<secret name>/<env key>` copies that key of an env secret instead;\nthe `secret://` prefix is reserved and an unresolvable reference is a 422."
          },
          "target_path": {
            "type": "string"
          },
          "target_port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "target_sandbox_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "HTTP handler budget in milliseconds (1s..1h, default 5m). HTTP actions only.",
            "maximum": 3600000,
            "minimum": 1000
          },
          "timezone": {
            "type": "string"
          },
          "trigger_kind": {
            "type": "string",
            "description": "`cron` | `webhook`."
          },
          "verifier_config": {},
          "verifier_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "`generic_hmac` | `github` | `gitlab` | `telegram` | `mattermost`.\nGitLab uses the Secret token sent in `X-Gitlab-Token`."
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ],
            "description": "Organization visibility. Omitted means `private`; `org` is explicit."
          }
        }
      },
      "CreatedSandboxPort": {
        "type": "object",
        "description": "A preview URL created for one of the ports requested at create time.",
        "required": [
          "port",
          "url",
          "auth_type"
        ],
        "properties": {
          "auth_type": {
            "type": "string"
          },
          "last_active_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last authorized access, rfc3339. Omitted when never accessed."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "path": {
            "type": [
              "string",
              "null"
            ]
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "requests_total": {
            "type": "integer",
            "format": "int64"
          },
          "url": {
            "type": "string",
            "description": "Ready-to-use preview URL."
          }
        }
      },
      "CreatedSandboxResponse": {
        "type": "object",
        "description": "The sandbox as it exists immediately after `POST /v1/sandboxes`.\n\nThis is NOT the sandbox object returned by `GET /v1/sandboxes/{id}`: the\nstored fields (`template`, `vcpu`, `ram_mb`, `env_vars`, `metadata`, …) are\nnot part of it. Read them back with a `GET` when you need them.",
        "required": [
          "id",
          "status",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "description": "When the sandbox was created, rfc3339."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "exposed_ports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreatedSandboxPort"
            },
            "description": "Preview URLs for the ports requested at create time."
          },
          "id": {
            "type": "string"
          },
          "idle_pause_action": {
            "type": [
              "string",
              "null"
            ],
            "description": "The effective idle-pause action. An explicit action is always echoed;\nwith none given it is `\"hibernate\"` when the account is entitled to\nhibernation, otherwise `\"stop\"`, whenever a window is in force. Absent\nonly when the create both left it out and disabled the window with\n`idle_pause_ms: null`."
          },
          "idle_pause_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "The effective idle window in milliseconds. Present whenever a window is\nin force — an omitted `idle_pause_ms` resolves to the one-hour default.\nAbsent only on an explicit `idle_pause_ms: null` (never auto-pause)."
          },
          "internal_ports": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Ports published with `internal` auth. They are also listed in\n`exposed_ports`, with their preview URL."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SandboxOrganization",
                "description": "Organization of the new sandbox. `null` for personal accounts; an\nidempotent replay of an older create can omit it."
              }
            ]
          },
          "owner": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SandboxOwner",
                "description": "Human owner of the new sandbox. An idempotent replay of an older create\ncan omit this field."
              }
            ]
          },
          "provisioning": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProvisioningStatus",
                "description": "Provisioning readiness, returned ONLY on `wait_until_ready: true`\n— the whole point of that flag is to return this without a follow-up\n`GET`. The async default (the flag omitted or `false`) answers before\nprovisioning is terminal and omits the field. On the wait path it is\nstill omitted when there was nothing to provision, and it can come back\nnon-terminal if the deadline expired first."
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "wake_on_request": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The effective `wake_on_request`, including `false`. When the request\nomitted it, this is the account's automatic-wake entitlement."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Non-fatal provisioning warnings (e.g. a skill that failed to install)."
          }
        }
      },
      "CreateHostedMcpRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "always_on": {
            "type": "boolean"
          },
          "args": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "catalog_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Start from a catalog entry: fills source/package/args unless overridden."
          },
          "command": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "disk_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "enabled": {
            "type": "boolean"
          },
          "env": {
            "type": "object",
            "description": "Inline env values (API keys etc). Envelope-encrypted at rest; only key\nnames are ever returned.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "idle_pause_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "package": {
            "type": [
              "string",
              "null"
            ]
          },
          "package_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional version pin for npx/uvx sources (`pkg@ver` / `pkg==ver`);\nomitted = latest at deploy time."
          },
          "port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "registry_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provenance of an official-registry import (`<name>@<version>`) —\ndisplay-only, the definition fields above are what actually deploys."
          },
          "secret_refs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of `env`-type secrets merged at deploy time (inline env wins)."
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ],
            "description": "Organization visibility. Omitted means `private`; `org` is explicit."
          }
        }
      },
      "CreatePresetRequest": {
        "type": "object",
        "required": [
          "name",
          "template",
          "vcpu",
          "ram_mb"
        ],
        "properties": {
          "configure_claude": {
            "type": "boolean"
          },
          "default_command": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Optional argv to run when a new terminal session opens. Empty disables it."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "env": {
            "type": "object"
          },
          "exposed_ports": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ExposePortOnCreate"
            }
          },
          "git_credentials": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/GitCredential"
            }
          },
          "is_default": {
            "type": "boolean"
          },
          "mcp_servers": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/McpServerConfig"
            }
          },
          "name": {
            "type": "string"
          },
          "ram_mb": {
            "type": "integer",
            "format": "int32"
          },
          "required_env_vars": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequiredEnvVar"
            }
          },
          "services": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "skills": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/SkillConfig"
            }
          },
          "template": {
            "type": "string",
            "description": "Template name — see `GET /v1/templates`."
          },
          "vcpu": {
            "type": "integer",
            "format": "int32"
          },
          "visibility": {
            "type": "string"
          }
        }
      },
      "CreateResponse": {
        "type": "object",
        "required": [
          "id",
          "status",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "string"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "exposed_ports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExposedPortResponse"
            },
            "description": "Preview URLs for ports exposed on creation."
          },
          "id": {
            "type": "string"
          },
          "internal_ports": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Ports published with `internal` auth. They are also listed in\n`exposed_ports`, with their preview URL."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Non-fatal warnings (e.g. skill install failures)."
          }
        }
      },
      "CreateSandboxBody": {
        "type": "object",
        "description": "Request body for `POST /v1/sandboxes`.",
        "required": [
          "template"
        ],
        "properties": {
          "configure_claude": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Pre-configure the Claude Code CLI so `claude` skips its first-run\nprompts. Only images that ship `claude` want it, so it is not a platform\ndefault — omitted, it comes from the selected preset (`preset_id`, or the\ntemplate's default preset)."
          },
          "default_command": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Optional argv for the first pane of a new terminal session. An explicit\nnull or empty array disables the template's default preset command."
          },
          "default_user": {
            "type": [
              "string",
              "null"
            ],
            "description": "Default unix user for exec/terminal/files inside the sandbox. Omit ⇒\nnon-root `\"user\"` (uid 1000). Provisioned configs (git/mcp/ssh/registry/\nskills) land in this user's home; preserved across stop/resume."
          },
          "disk_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Root-disk size in MiB. Omit to use the template's default (then the\nserver-wide 2 GiB fallback). The disk can only grow from the template's\nbaked size; smaller values are floored up. Capped server-side."
          },
          "env": {
            "type": [
              "object",
              "null"
            ],
            "description": "Environment variables injected into the sandbox.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "expiry_action": {
            "type": [
              "string",
              "null"
            ],
            "description": "What to do when the sandbox TTL expires: `\"stop\"` (default),\n`\"hibernate\"`, `\"delete\"`."
          },
          "expose_ports": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ExposePortOnCreate"
            },
            "description": "Ports to expose immediately after creation, each with a preview URL."
          },
          "files": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/FileConfig"
            },
            "description": "Arbitrary files written into the VM. `content` is base64-encoded so\nbinary payloads survive."
          },
          "git_credentials": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/GitCredential"
            },
            "description": "Per-host git credentials. Configures credential helpers in `~/.gitconfig`."
          },
          "idle_pause_action": {
            "type": [
              "string",
              "null"
            ],
            "description": "What idle auto-pause does: `\"stop\"` or `\"hibernate\"`. **When a window is\nactive and this is omitted, it defaults to `\"hibernate\"` if the account\nis entitled to hibernation, otherwise `\"stop\"`. An explicit\n`\"hibernate\"` requires that entitlement.**"
          },
          "idle_pause_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Idle window in milliseconds after which the running sandbox is paused\nautomatically. Minimum 30000. Pairs naturally with `wake_on_request`.\n**Omitted: a one-hour window; `null`: never auto-pause; a value: that\nwindow.**"
          },
          "mcp_servers": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/McpServerConfig"
            },
            "description": "MCP servers for Claude Code. Written to `~/.mcp.json` in the default\nuser's home inside the VM."
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Arbitrary key-value labels for filtering and identification.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional sandbox display name. Omitted, `null` or blank, the sandbox\ngets a readable default derived from the new sandbox id —\n`brave-otter-d805`. It is a default, not an invariant: `PATCH\n/v1/sandboxes/{id}` renames the sandbox, and a `null` (or blank) rename\nclears the name again."
          },
          "preset_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional catalog preset ID. The sandbox is created from this preset\ninstead of the template's default preset; omit to keep the template\ndefault."
          },
          "ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "RAM in MiB (128–8192). Omit to use the selected preset's value, or the\ntemplate default when no preset ID is supplied."
          },
          "registry_credentials": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/RegistryCredentialConfig"
            },
            "description": "Package-registry credentials materialized to `~/.npmrc` / pip.conf /\ncargo / docker config."
          },
          "repo": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RepoSpec",
                "description": "Opt-in repository to clone into the sandbox after boot. It is added to\n`repos` as one more entry. A `required` clone (the default) that fails drives the\nsandbox to `failed`, and the clone is not retried: recreate the sandbox to\ntry again. Pass `required: false` for a forgiving clone (the step is\n`failed`, the sandbox stays `running`)."
              }
            ]
          },
          "repos": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/RepoCloneConfig"
            },
            "description": "Git repositories to clone into the VM after boot. The single `repo`\nfield is cloned as one more entry of this list; a caller may pass this\narray directly instead."
          },
          "secrets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of account secrets to resolve and merge into the request.\nDecrypted server-side; inline fields above always win."
          },
          "services": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ServiceSpec"
            },
            "description": "Long-running services materialized as enabled systemd units after boot.\nThey survive `Stop → wake_on_request` cold boots by construction."
          },
          "skills": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/SkillConfig"
            },
            "description": "Claude Code skills. Written to `~/.claude/skills/` (default user's home)."
          },
          "ssh_keys": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/SshKeyConfig"
            },
            "description": "SSH keys materialized into `~/.ssh`. Keys from `ssh_key` secrets named\nin `secrets` are added here; a caller may also pass keys directly."
          },
          "storage_access": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opt-in account object-storage access: `\"ro\"` or `\"rw\"`. When set, a\n`jrst_` storage token is issued and `JR_STORAGE_TOKEN` /\n`JR_STORAGE_URL` are injected into the sandbox env. Available only when\nobject storage is enabled on the deployment."
          },
          "template": {
            "type": "string",
            "description": "Template name (required). See `GET /v1/templates`."
          },
          "template_version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Optional pinned template version to create from. Omitted ⇒ the\ntemplate's ready default version. A pinned version must exist AND be\n`upload_status='ready'`, else the create fails 4xx."
          },
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Milliseconds until the sandbox is automatically stopped. Omit for no timeout."
          },
          "vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Number of vCPUs (1–8). Omit to use the selected preset's value, or the\ntemplate default when no preset ID is supplied."
          },
          "visibility": {
            "type": "string",
            "description": "Organization-local visibility. New sandboxes are private by default;\npass `org` to share one with other organization members.",
            "default": "private"
          },
          "wait_until_ready": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Opt-in synchronous provisioning: when `true`, the create call blocks\nuntil provisioning is terminal (`ready`/`failed`) or a deadline, instead\nof returning immediately while provisioning continues in the\nbackground. Default `false`."
          },
          "wake_on_request": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "When `true`, an HTTP request to this sandbox wakes it before the\nrequest is forwarded: a hibernated sandbox is restored, and a stopped one\nis booted when the deployment allows it and the host still has a local\ncopy of its disk; otherwise the request gets `503` and the sandbox has to\nbe resumed with `resume`. **Omitted, it defaults to the\naccount's automatic-wake entitlement.** An explicit `true` without that\nentitlement is refused; `false` always opts out."
          }
        }
      },
      "CreateSecretRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SecretValue"
          },
          {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "type": "string"
              },
              "visibility": {
                "type": "string"
              }
            }
          }
        ]
      },
      "CreateTokenRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Optional absolute expiry (RFC 3339). Must be in the future if set."
          },
          "name": {
            "type": "string",
            "description": "User-supplied label: non-empty, ≤80 chars."
          },
          "scope": {
            "$ref": "#/components/schemas/PatScope",
            "description": "Permission scope. Omitted ⇒ `full` (identical to a pre-scope token).\nA `read_only` token may only make read requests over REST and may only\ncall read tools over the MCP control plane."
          }
        }
      },
      "CreateTokenResponse": {
        "type": "object",
        "required": [
          "id",
          "name",
          "token",
          "scope",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/PatScope"
          },
          "token": {
            "type": "string",
            "description": "Plaintext token shown ONCE. Store it — subsequent list calls omit it."
          }
        }
      },
      "DeleteTemplateAccepted": {
        "type": "object",
        "required": [
          "job_id"
        ],
        "properties": {
          "job_id": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "DeleteVersionAccepted": {
        "type": "object",
        "description": "Body of the delete 202.",
        "required": [
          "job_id"
        ],
        "properties": {
          "job_id": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ExecRequest": {
        "type": "object",
        "required": [
          "cmd"
        ],
        "properties": {
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cmd": {
            "type": "string"
          },
          "cwd": {
            "type": [
              "string",
              "null"
            ]
          },
          "env": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "stdin": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional stdin piped to the process, base64-encoded (binary-safe;\nwebhook bodies are arbitrary bytes). Decoded + bounded host-side,\nwritten once, then the stream is closed so the process sees EOF."
          },
          "timeout": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Timeout in milliseconds. 0 or absent = default (5 min).",
            "minimum": 0
          },
          "user": {
            "type": [
              "string",
              "null"
            ],
            "description": "Unix user to run as. Omit for the sandbox default (usually\n`\"user\"`). Set to `\"root\"` for uid 0."
          }
        }
      },
      "ExecResponse": {
        "type": "object",
        "required": [
          "exit_code",
          "stdout",
          "stderr"
        ],
        "properties": {
          "exit_code": {
            "type": "integer",
            "format": "int32"
          },
          "stderr": {
            "type": "string"
          },
          "stdout": {
            "type": "string"
          }
        }
      },
      "ExposedPortResponse": {
        "type": "object",
        "required": [
          "port",
          "url",
          "auth_type"
        ],
        "properties": {
          "auth_type": {
            "type": "string"
          },
          "last_active_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last authorized access to this preview URL, RFC 3339. Absent when the\nURL has never been accessed."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "path": {
            "type": [
              "string",
              "null"
            ]
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "requests_total": {
            "type": "integer",
            "format": "int64",
            "description": "Total authorized requests to this preview URL."
          },
          "url": {
            "type": "string"
          }
        }
      },
      "ExposePortOnCreate": {
        "type": "object",
        "description": "Port to expose on sandbox creation.",
        "required": [
          "port"
        ],
        "properties": {
          "auth": {
            "$ref": "#/components/schemas/PortAuthRequest"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name (e.g. \"JupyterLab\", \"Stirling-PDF\")."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hint text (e.g. \"Default login: admin@admin.com / changeme\")."
          },
          "omit_port_suffix": {
            "type": "boolean",
            "description": "Drop the `-{port}` suffix so the preview host is a bare `{subdomain}.{base}`.\nOnly honored together with an explicit `subdomain`. Defaults to `true` — pass\n`false` to keep the historical `{subdomain}-{port}` scheme."
          },
          "path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Default path to open (e.g. \"/vnc.html?autoconnect=true\")."
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "required": {
            "type": "boolean",
            "description": "When `true`, a failed exposure fails the whole create (the sandbox is\ntorn down) instead of being swallowed into `warnings`. Hosted-MCP sets\nthis: an unexposed bearer port makes the instance URL 404 \"no exposed\nport matches subdomain\" while the sandbox looks `ready`. Default `false`\npreserves the historical best-effort behavior for ordinary preview ports."
          },
          "subdomain": {
            "type": [
              "string",
              "null"
            ],
            "description": "Explicit preview subdomain (full URL prefix becomes `{subdomain}-{port}`,\nor bare `{subdomain}` when `omit_port_suffix` is set).\nOmitted ⇒ a random 16-char base32 label is minted."
          }
        }
      },
      "ExposePortRequest": {
        "type": "object",
        "required": [
          "port"
        ],
        "properties": {
          "auth": {
            "$ref": "#/components/schemas/PortAuthRequest"
          },
          "omit_port_suffix": {
            "type": "boolean",
            "description": "Drop the `-{port}` suffix so the preview host is a bare `{subdomain}.{base}`.\nOnly honored together with an explicit `subdomain`; ignored otherwise. Defaults to\n`true` — pass `false` to keep the historical `{subdomain}-{port}` scheme."
          },
          "path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Default path appended to the preview URL (e.g. \"vnc.html?autoconnect=true\")."
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "subdomain": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom subdomain prefix for the preview URL. If omitted, a random\n16-character label is generated; it is never derived from the sandbox\nname. Must contain only lowercase letters, digits and hyphens."
          }
        }
      },
      "FileConfig": {
        "type": "object",
        "description": "Arbitrary file written into the VM (secrets-store). Generic escape hatch.",
        "required": [
          "path",
          "content"
        ],
        "properties": {
          "content": {
            "type": "string",
            "description": "Base64-encoded file bytes (binary-safe), decoded before writing."
          },
          "mode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Octal-string mode, e.g. `\"0600\"`. Defaults to `0600`."
          },
          "path": {
            "type": "string",
            "description": "Target path inside the VM: absolute (`/etc/...`) or `~/`-relative\n(resolved to the default user's home, e.g. `~/.aws/credentials`)."
          }
        }
      },
      "FileEntry": {
        "type": "object",
        "required": [
          "name",
          "path",
          "size",
          "type",
          "permissions"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "permissions": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "GitCredential": {
        "type": "object",
        "description": "Git credential for HTTPS token-based auth.",
        "required": [
          "host",
          "token"
        ],
        "properties": {
          "host": {
            "type": "string",
            "description": "Git host (e.g. \"github.com\", \"gitlab.internal.com\")."
          },
          "token": {
            "type": "string",
            "description": "Access token (PAT, deploy token, etc.)."
          },
          "username": {
            "type": [
              "string",
              "null"
            ],
            "description": "Username for HTTPS auth. Defaults based on host:\ngithub.com → \"x-access-token\", *gitlab* → \"oauth2\", others → \"x-access-token\"."
          }
        }
      },
      "HibernateResponse": {
        "type": "object",
        "required": [
          "id",
          "status",
          "snapshot_id",
          "hibernated_at"
        ],
        "properties": {
          "hibernated_at": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "snapshot_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "HostedMcpCatalogEntry": {
        "type": "object",
        "description": "A curated MCP server: create it with `catalog_key` set to `key`.",
        "required": [
          "key",
          "title",
          "description",
          "source",
          "install_constraints",
          "default_args",
          "required_env",
          "optional_env",
          "sort"
        ],
        "properties": {
          "default_args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "default_package_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Version a catalog create pins to; an explicit request field still wins."
          },
          "description": {
            "type": "string"
          },
          "docs_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "install_constraints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "key": {
            "type": "string"
          },
          "optional_env": {},
          "package": {
            "type": [
              "string",
              "null"
            ]
          },
          "required_env": {},
          "sort": {
            "type": "integer",
            "format": "int32"
          },
          "source": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "HostedMcpLogsResponse": {
        "type": "object",
        "required": [
          "available"
        ],
        "properties": {
          "available": {
            "type": "boolean",
            "description": "False when the backing sandbox is not running (scale-to-zero) — logs\nlive inside the VM and fetching them never wakes it."
          },
          "content": {
            "type": [
              "string",
              "null"
            ],
            "description": "Tail of the MCP server's service log (newest last, at most 256 KiB)."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HostedMcpPermissions": {
        "type": "object",
        "required": [
          "mutate",
          "change_visibility"
        ],
        "properties": {
          "change_visibility": {
            "type": "boolean",
            "description": "Role-level right to request a visibility change; dependencies may refuse it."
          },
          "mutate": {
            "type": "boolean"
          }
        }
      },
      "HostedMcpRegistryEntry": {
        "type": "object",
        "required": [
          "registry_ref",
          "name",
          "title",
          "description",
          "version",
          "hostable"
        ],
        "properties": {
          "arguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RegistryArg"
            }
          },
          "description": {
            "type": "string"
          },
          "env": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RegistryEnvVar"
            }
          },
          "hostable": {
            "type": "boolean",
            "description": "False when just-run cannot host this entry; see `not_hostable_reason`."
          },
          "name": {
            "type": "string",
            "description": "Upstream reverse-DNS name (e.g. `io.github.acme/thing`)."
          },
          "not_hostable_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "`remote_only` | `no_packages` | `unsupported_registry_type` |\n`unsupported_transport` | `unsupported_package_name`."
          },
          "package": {
            "type": [
              "string",
              "null"
            ]
          },
          "package_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "registry_ref": {
            "type": "string",
            "description": "Provenance string to store on import: `<upstream name>@<version>`."
          },
          "repository_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "HostedMcpRegistrySearchResponse": {
        "type": "object",
        "required": [
          "entries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HostedMcpRegistryEntry"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HostedMcpResponse": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "visibility",
          "permissions",
          "source",
          "args",
          "env_keys",
          "secret_refs",
          "url",
          "token_preview",
          "enabled",
          "always_on",
          "effective_vcpu",
          "effective_ram_mb",
          "effective_disk_mb",
          "requests_total",
          "status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "always_on": {
            "type": "boolean"
          },
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "catalog_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "command": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deploy_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "deployed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "description": {
            "type": "string"
          },
          "disk_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "effective_disk_mb": {
            "type": "integer",
            "format": "int64"
          },
          "effective_ram_mb": {
            "type": "integer",
            "format": "int64"
          },
          "effective_vcpu": {
            "type": "integer",
            "format": "int64",
            "description": "Effective instance resources: the per-instance override, or the\ndeployment default."
          },
          "enabled": {
            "type": "boolean"
          },
          "env_keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Inline env KEY NAMES only."
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "idle_pause_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "package": {
            "type": [
              "string",
              "null"
            ]
          },
          "package_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "permissions": {
            "$ref": "#/components/schemas/HostedMcpPermissions",
            "description": "Effective permissions for the caller in this account context."
          },
          "port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "registry_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "requests_total": {
            "type": "integer",
            "format": "int64",
            "description": "Lifetime authorized requests through the public URL (≤60s lag)."
          },
          "sandbox_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "secret_refs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Composed at read time: disabled | failed | deploying | not_deployed |\nneeds_redeploy | ready."
          },
          "token": {
            "type": [
              "string",
              "null"
            ],
            "description": "Plaintext bearer token — present ONLY on create / rotate responses."
          },
          "token_preview": {},
          "tools": {},
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "url": {
            "type": "string",
            "description": "Stable public MCP endpoint."
          },
          "vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Per-instance vCPU override (`ram_mb` and `disk_mb` are the matching\noverrides). Omitted when the deployment default applies."
          },
          "visibility": {
            "type": "string"
          }
        }
      },
      "HostedMcpRotateResponse": {
        "type": "object",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "The NEW plaintext bearer token — shown once."
          }
        }
      },
      "HostedMcpTestResponse": {
        "type": "object",
        "description": "The verdict of a liveness probe, not an HTTP error.\n\nA failed probe is still a 200 carrying `ok: false`: the request succeeded —\nthe handshake ran and came back negative — exactly like a health check that\nanswers `{\"healthy\": false}`.",
        "required": [
          "ok"
        ],
        "properties": {
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "The registry code behind a failed probe, for a client that wants to act\nrather than display."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Safe English for a failed probe. Never a parsing surface."
          },
          "ok": {
            "type": "boolean"
          },
          "tools": {}
        }
      },
      "JobResponse": {
        "type": "object",
        "description": "A background job and its progress.",
        "required": [
          "id",
          "job_type",
          "account_id",
          "status",
          "progress_pct",
          "payload",
          "created_at"
        ],
        "properties": {
          "account_id": {
            "type": "integer",
            "format": "int64"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "heartbeat_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "job_type": {
            "type": "string"
          },
          "payload": {
            "type": "object"
          },
          "progress_pct": {
            "type": "integer",
            "format": "int32"
          },
          "result": {
            "type": [
              "object",
              "null"
            ]
          },
          "sandbox_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "terminal_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why this job is terminal, when there is more to say than `status`:\n`user_request` (someone cancelled it), `superseded` (the work finished\nbut something else had already moved on without it), `expired_by_sweep`\n(a reaper gave up on it), `admission_timeout` (it never got a transfer\nslot and will be re-attempted) or `cas_failed` (the work succeeded but\nthe sandbox's state could not be updated to match). Absent while the job is live and\nafter an ordinary finish."
          },
          "worker_node_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ListTokensResponse": {
        "type": "object",
        "required": [
          "tokens"
        ],
        "properties": {
          "tokens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TokenListItem"
            }
          }
        }
      },
      "LogLine": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "level": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": "string"
          },
          "target": {
            "type": [
              "string",
              "null"
            ]
          },
          "ts": {
            "type": [
              "string",
              "null"
            ],
            "description": "journald `__REALTIME_TIMESTAMP` (microseconds since epoch, as string)."
          }
        }
      },
      "LogsResponse": {
        "type": "object",
        "required": [
          "lines",
          "truncated"
        ],
        "properties": {
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogLine"
            }
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "truncated": {
            "type": "boolean"
          }
        }
      },
      "McpServerConfig": {
        "type": "object",
        "description": "MCP server configuration (matches Claude Code .mcp.json format).",
        "required": [
          "name"
        ],
        "properties": {
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Args for command-based servers."
          },
          "command": {
            "type": [
              "string",
              "null"
            ],
            "description": "Command for local stdio servers."
          },
          "env": {
            "type": "object",
            "description": "Environment variables for the MCP server process.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "headers": {
            "type": "object",
            "description": "HTTP headers (e.g. Authorization).",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "package": {
            "type": [
              "string",
              "null"
            ],
            "description": "npm package (e.g. \"@anthropic/mcp-web-search\"). Installed by Claude Code."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL-based server (e.g. \"https://mcp.example.com/mcp\")."
          }
        }
      },
      "MkdirBody": {
        "type": "object",
        "required": [
          "path"
        ],
        "properties": {
          "path": {
            "type": "string"
          }
        }
      },
      "MoveBody": {
        "type": "object",
        "required": [
          "source",
          "destination"
        ],
        "properties": {
          "destination": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        }
      },
      "PatchAutomationRequest": {
        "type": "object",
        "properties": {
          "command": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CommandAction"
              }
            ]
          },
          "concurrency_mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "cron_expr": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "forward_headers": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "max_attempts": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "max_concurrent_runs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "A number sets the cap on concurrent runs; `null` clears it; omitted\nleaves it unchanged."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "payload_retention_hours": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "secret": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rotate the secret (re-encrypts; the new value is never echoed back). A\n`secret://<secret name>/<env key>` reference copies the key's current value."
          },
          "target_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "target_port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "target_sandbox_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rebind: a sandbox id repoints; explicit `null` unbinds."
          },
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "HTTP handler budget in milliseconds. HTTP actions only.",
            "maximum": 3600000,
            "minimum": 1000
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ]
          },
          "verifier_config": {},
          "visibility": {
            "type": [
              "string",
              "null"
            ],
            "description": "Change visibility in a separate PATCH containing only this field."
          }
        }
      },
      "PatchHostedMcpRequest": {
        "type": "object",
        "properties": {
          "always_on": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "args": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "command": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "disk_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "env": {
            "type": [
              "object",
              "null"
            ],
            "description": "Full-replace inline env (re-encrypted). `{}` clears.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "idle_pause_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "package": {
            "type": [
              "string",
              "null"
            ]
          },
          "package_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "secret_refs": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ],
            "description": "Change visibility in a separate PATCH; retained runtime secrets are checked."
          }
        }
      },
      "PatchPresetRequest": {
        "type": "object",
        "properties": {
          "configure_claude": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "default_command": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Array sets the command; null clears it. Omission preserves the current value."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "env": {
            "type": [
              "object",
              "null"
            ]
          },
          "exposed_ports": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object"
            }
          },
          "git_credentials": {
            "type": [
              "object",
              "null"
            ]
          },
          "hidden": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "is_default": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "mcp_servers": {
            "type": [
              "object",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "required_env_vars": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/RequiredEnvVar"
            }
          },
          "services": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object"
            }
          },
          "skills": {
            "type": [
              "object",
              "null"
            ]
          },
          "vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PatchRequest": {
        "type": "object",
        "properties": {
          "env": {
            "type": [
              "object",
              "null"
            ],
            "description": "Full-replace user env vars. `JR_STORAGE_TOKEN` is server-managed: the\nresponse mask may be echoed to preserve it, or omitted while storage\naccess is active. Any other submitted token value is rejected.\nIf sandbox is running, changes are propagated live to new processes.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "envd_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "`\"rotate\"` invalidates every E2B `envdAccessToken` issued for this\nsandbox; the SDK receives a new one from `Sandbox.connect()`. Any other\nvalue is refused."
          },
          "idle_pause_action": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set (`\"stop\"` or `\"hibernate\"`) or clear (`null`) the idle-pause action\nof this sandbox; omitted leaves it unchanged."
          },
          "idle_pause_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Set (milliseconds, minimum 30000) or clear (`null`) idle auto-pause;\nomitted leaves it unchanged. Takes effect within about 5 seconds."
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name, under the same rules as create: at most 64 characters,\nsurrounding whitespace trimmed, control characters and bidi switches\nrefused. Pass `null` to clear it — a blank string does the same, since a\nname of nothing is not a name. A cleared name is NOT regenerated: the\nsandbox reads back with `name: null` and renders as its id again."
          },
          "storage_access": {
            "type": [
              "string",
              "null"
            ],
            "description": "Change object-storage access: `\"none\"` (revoke), `\"ro\"` or `\"rw\"`. Any\npreviously issued storage token stops working, and\n`JR_STORAGE_TOKEN`/`JR_STORAGE_URL` are updated in the sandbox env\n(removed on `\"none\"`). `ro`/`rw` are available only when object storage\nis enabled on the deployment."
          },
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Milliseconds until expiry from now. Pass `null` to clear."
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ],
            "description": "Organization-local visibility. Change it in a separate PATCH because\npublication validates retained secrets and automation run history."
          },
          "wake_on_request": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Turn wake-on-request on or off. Takes effect on the next inbound\nrequest."
          }
        }
      },
      "PatchSecretRequest": {
        "allOf": [
          {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SecretValue"
              }
            ]
          },
          {
            "type": "object",
            "properties": {
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "env_vars": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "For env secrets only: set individual variables (including empty strings)\nor remove them with null. Omitted keys keep their stored values.\nCannot be combined with a full type/value replacement.",
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "visibility": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        ]
      },
      "PatchTemplateRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "frozen": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Lock/unlock the template against edits & deletes. Admin-only."
          },
          "hidden": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "long_description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Long-form markdown description (README). `null` clears it."
          },
          "min_ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "min_vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set to \"public\" requires is_admin=true."
          }
        }
      },
      "PatchVersionRequest": {
        "type": "object",
        "description": "Body for `PATCH /v1/templates/{name}/versions/{version}`. Today only the\n`note` is editable.\n\nAn omitted `note` and an explicit `null` both clear the note, so a `PATCH`\nwith an empty body clears it too.",
        "properties": {
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "New note, or `null`/omitted to clear it."
          }
        }
      },
      "PatScope": {
        "type": "string",
        "description": "Permission scope minted onto a Personal Access Token. `Full` is the\nhistorical behaviour (every PAT was full-access); `ReadOnly` restricts\nthe token to read operations.",
        "enum": [
          "full",
          "read_only"
        ]
      },
      "PluginInstall": {
        "type": "object",
        "description": "How to install the plugin from this installation.",
        "required": [
          "name",
          "version",
          "marketplace_url",
          "install_commands"
        ],
        "properties": {
          "codex": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CodexInstall",
                "description": "The same plugin for Codex; absent when its Codex build failed at boot\n(the cause is in the boot log)."
              }
            ]
          },
          "install_commands": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The terminal commands that install the plugin in Claude Code, in order."
          },
          "marketplace_url": {
            "type": "string",
            "description": "The marketplace a user adds in Claude Code (`claude plugin marketplace add`)."
          },
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "PortAuthRequest": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "none"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "username",
              "password",
              "type"
            ],
            "properties": {
              "password": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "basic"
                ]
              },
              "username": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "token",
              "type"
            ],
            "properties": {
              "token": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "bearer"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "The preview URL opens only with a token of a user who may change the\nsandbox: an API token (`Authorization: Bearer` or `?access_token=`) or\nthe web app's session. The port is also reachable through\n`/v1/sandboxes/{id}/proxy/{port}/...`.",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "internal"
                ]
              }
            }
          }
        ]
      },
      "PresetInputCondition": {
        "type": "object",
        "required": [
          "name",
          "equals"
        ],
        "properties": {
          "equals": {
            "type": "string",
            "description": "The condition matches when the final environment value equals this value."
          },
          "name": {
            "type": "string",
            "description": "Name of another declared preset input."
          }
        }
      },
      "PresetInputOption": {
        "type": "object",
        "required": [
          "value",
          "label"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "PresetInputType": {
        "type": "string",
        "enum": [
          "text",
          "secret",
          "url",
          "select"
        ]
      },
      "PresetResponse": {
        "type": "object",
        "required": [
          "id",
          "account_id",
          "name",
          "template",
          "vcpu",
          "ram_mb",
          "visibility",
          "hidden",
          "is_default",
          "env",
          "services",
          "configure_claude",
          "required_env_vars"
        ],
        "properties": {
          "account_id": {
            "type": "integer",
            "format": "int64"
          },
          "configure_claude": {
            "type": "boolean",
            "description": "Pre-configure the Claude Code CLI on create, so `claude` skips its\nfirst-run prompts."
          },
          "default_command": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "env": {
            "type": "object"
          },
          "expose_ports": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ExposePortOnCreate"
            }
          },
          "git_credentials": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/GitCredential"
            }
          },
          "hidden": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "is_default": {
            "type": "boolean"
          },
          "mcp_servers": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/McpServerConfig"
            }
          },
          "name": {
            "type": "string"
          },
          "ram_mb": {
            "type": "integer",
            "format": "int64"
          },
          "required_env_vars": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequiredEnvVar"
            }
          },
          "services": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Default services (systemd units) added to a sandbox created with this\npreset."
          },
          "skills": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/SkillConfig"
            }
          },
          "template": {
            "type": "string"
          },
          "vcpu": {
            "type": "integer",
            "format": "int64"
          },
          "visibility": {
            "type": "string"
          }
        }
      },
      "ProblemBody": {
        "type": "object",
        "description": "The canonical error object, for OpenAPI.\n\nIt exists because both services were publishing a schema for a body neither\nof them sends any more: a single `error` string, declared 403 times across\nthe two documents. A generated client built from that spec would look for a\nmember the contract removed.\n\nThis type is never constructed — [`Problem`] builds the body, and\n`to_json` is the one serializer. It is the DESCRIPTION of that body, kept\nbeside it so the two cannot drift into different readings of one contract.",
        "required": [
          "title",
          "status",
          "detail",
          "code",
          "request_id"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "The stable machine identifier, `domain.reason`.\n\nDeliberately an OPEN patterned string and not an enum: a server newer\nthan the client sends codes the client has never heard of, and a\ngenerated client that rejects an unknown value would turn a correct\nanswer into a parse failure. The known values are the catalog in\n`docs/api-reference/errors.md`.",
            "example": "sandbox.state_conflict",
            "pattern": "^[a-z0-9_]+\\.[a-z0-9_]+$"
          },
          "detail": {
            "type": "string",
            "description": "Safe, action-oriented English for this occurrence. May be reworded at\nany time — branch on `code`, never on this.",
            "example": "The sandbox is not in a state that allows this operation."
          },
          "params": {
            "type": [
              "object",
              "null"
            ],
            "description": "Typed context, present only for codes that declare it. A flat map of\nscalars or arrays of scalars — never nested."
          },
          "request_id": {
            "type": "string",
            "description": "Correlation key. Equals the `X-Request-Id` response header.",
            "example": "019c31ef-1661-7a51-8df5-e68b70817d42"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "Always equal to the HTTP status.",
            "example": 409,
            "minimum": 0
          },
          "title": {
            "type": "string",
            "description": "Stable English summary of the error CLASS. Safe to show; not a parsing\nsurface.",
            "example": "Sandbox state conflict"
          },
          "violations": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/ViolationBody"
            },
            "description": "Field-level detail, present only on a validation failure."
          }
        }
      },
      "ProcessListEntry": {
        "type": "object",
        "required": [
          "pid",
          "cmd",
          "args"
        ],
        "properties": {
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cmd": {
            "type": "string"
          },
          "pid": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "tag": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ProcessOutputResponse": {
        "type": "object",
        "required": [
          "pid",
          "running",
          "stdout",
          "stderr",
          "truncated"
        ],
        "properties": {
          "exit_code": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "pid": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "running": {
            "type": "boolean",
            "description": "False once the replayed buffer ends in the process's exit."
          },
          "stderr": {
            "type": "string"
          },
          "stdout": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean",
            "description": "True when either stream had more than `tail_bytes`."
          }
        }
      },
      "ProvisioningStatus": {
        "type": "object",
        "description": "The async-provisioning readiness signal on a sandbox response. Present only\nwhen provisioning happened (omitted when `provisioning_status` is NULL). A\nsuccessful create does NOT mean provisioning is done — poll until\n`status == \"ready\"` (or the specific step you need) before using the\nprovisioned artifact. See `docs/guides/sandbox-lifecycle.md`.",
        "required": [
          "status",
          "steps"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "Rollup: `in_progress` | `ready` | `failed`."
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProvisioningStep"
            },
            "description": "Ordered per-step detail."
          }
        }
      },
      "ProvisioningStep": {
        "type": "object",
        "description": "One provisioning step of a sandbox.",
        "required": [
          "name",
          "kind",
          "required",
          "status"
        ],
        "properties": {
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "description": "`oneshot` (runs once and completes) or `service` (long-running; ready\nonce its readiness probe passes)."
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Failure reason / short note. Omitted when absent."
          },
          "name": {
            "type": "string",
            "description": "Provisioner name (e.g. `git-credentials`, `repo-clone`)."
          },
          "required": {
            "type": "boolean",
            "description": "When `true`, a failure of this step fails the sandbox lifecycle."
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "description": "`pending` | `running` | `ready` | `failed` | `skipped`."
          }
        }
      },
      "PublicExposedPort": {
        "type": "object",
        "required": [
          "port",
          "subdomain",
          "auth_type"
        ],
        "properties": {
          "auth_type": {
            "type": "string"
          },
          "last_active_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Last time this preview URL was accessed, for every auth mode. Omitted\nwhen never accessed."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "path": {
            "type": [
              "string",
              "null"
            ]
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "requests_total": {
            "type": "integer",
            "format": "int64",
            "description": "Total authorized requests to this preview URL."
          },
          "subdomain": {
            "type": "string"
          }
        }
      },
      "ReadFileResponse": {
        "type": "object",
        "required": [
          "path",
          "content",
          "size",
          "encoding"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "encoding": {
            "type": "string",
            "description": "\"utf-8\" for text files, \"base64\" for binary files."
          },
          "path": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RefreshRequest": {
        "type": "object",
        "description": "Optional body for the refresh endpoint.",
        "properties": {
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Override timeout for this refresh (milliseconds). If omitted,\nuses the sandbox's existing `timeout_ms`."
          }
        }
      },
      "RegistryArg": {
        "type": "object",
        "description": "CLI argument the server documents. Prefill hints only — the UI surfaces\nthem next to the free-form `args` field; nothing is auto-injected.",
        "required": [
          "kind",
          "required"
        ],
        "properties": {
          "default": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": "string",
            "description": "`named` or `positional`."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "value_hint": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RegistryCredentialConfig": {
        "type": "object",
        "description": "Package-registry credential materialized to the registry's conventional config file.",
        "required": [
          "registry",
          "token"
        ],
        "properties": {
          "host": {
            "type": [
              "string",
              "null"
            ],
            "description": "Registry host (e.g. `registry.npmjs.org`)."
          },
          "registry": {
            "type": "string",
            "description": "Registry kind: `\"npm\"` | `\"pip\"` | `\"cargo\"` | `\"docker\"`."
          },
          "scope": {
            "type": [
              "string",
              "null"
            ],
            "description": "npm scope, e.g. `@acme`."
          },
          "token": {
            "type": "string",
            "description": "Access token / password."
          },
          "username": {
            "type": [
              "string",
              "null"
            ],
            "description": "Username for basic-auth registries (pip/docker)."
          }
        }
      },
      "RegistryEnvVar": {
        "type": "object",
        "required": [
          "name",
          "required",
          "secret"
        ],
        "properties": {
          "default": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "secret": {
            "type": "boolean"
          }
        }
      },
      "RepoCloneConfig": {
        "type": "object",
        "description": "A git repository to clone into the sandbox after boot. The clone runs after\ngit credentials and files are written, so HTTPS credentials and any seed\nfiles are already in place. git runs with arguments only, never through a\nshell.",
        "required": [
          "url",
          "path"
        ],
        "properties": {
          "depth": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Shallow-clone depth (`git clone --depth`). Omitted ⇒ a full clone.",
            "minimum": 0
          },
          "path": {
            "type": "string",
            "description": "Destination path inside the sandbox: absolute or `~/`-relative. The\nsingle `repo` create field fills a default derived from the URL when its\n`path` is omitted."
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Branch / tag / ref to check out (`git clone --branch`). Omitted ⇒ the\nremote's default branch."
          },
          "required": {
            "type": "boolean",
            "description": "When `true`, a clone failure fails the sandbox (`Running → Failed`)\ninstead of leaving it usable. Default `false`; the single `repo` create\nfield defaults it to `true`."
          },
          "url": {
            "type": "string",
            "description": "Clone URL: `https://…` or `ssh://…`."
          }
        }
      },
      "RepoSpec": {
        "type": "object",
        "description": "A repository to clone into a new sandbox. The URL scheme and destination\npath are validated at create; a destination path is derived from the URL\nwhen omitted.",
        "required": [
          "url"
        ],
        "properties": {
          "depth": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Shallow-clone depth. Omit for a full clone.",
            "minimum": 0
          },
          "path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Destination path inside the VM (`~/`-relative, confined to home, no\n`..`). Omit to default to `~/<name-derived-from-url>`."
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Branch / tag / ref to check out. Omit for the remote's default branch."
          },
          "required": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "When `true` (the default), a clone failure fails the sandbox lifecycle."
          },
          "url": {
            "type": "string",
            "description": "Clone URL — must be `https://…` or `ssh://…`."
          }
        }
      },
      "RequiredEnvVar": {
        "type": "object",
        "required": [
          "name",
          "label"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "input_type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PresetInputType",
                "description": "Form control to render. Omitted legacy values derive from `sensitive`."
              }
            ]
          },
          "label": {
            "type": "string",
            "description": "Short label displayed by the sandbox creation form."
          },
          "name": {
            "type": "string",
            "description": "Unix environment variable name, e.g. `OPENCLAW_API_KEY`."
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PresetInputOption"
            },
            "description": "Select choices. Required and only valid for `input_type=select`."
          },
          "required": {
            "type": "boolean",
            "description": "Whether this input is always required. Defaults to true for compatibility."
          },
          "required_when": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PresetInputCondition",
                "description": "Require the input when this condition matches the final environment."
              }
            ]
          },
          "sensitive": {
            "type": "boolean",
            "description": "Legacy display hint. `input_type=secret` is preferred for new presets."
          },
          "visible_when": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PresetInputCondition",
                "description": "Hide the input unless this condition matches the final environment."
              }
            ]
          }
        }
      },
      "ResumeRequest": {
        "type": "object",
        "properties": {
          "ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Override RAM in MB (128-8192). If omitted, uses original value."
          },
          "vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Override vCPU count (1-8). If omitted, uses original value."
          }
        }
      },
      "ResumeSandboxBody": {
        "type": "object",
        "description": "Request body for `POST /v1/sandboxes/{id}/resume`.",
        "properties": {
          "ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Override RAM in MiB on resume (128–8192). Omit to keep the original value."
          },
          "vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Override vCPU count on resume (1–8). Omit to keep the original value."
          }
        }
      },
      "RunAcceptedResponse": {
        "type": "object",
        "required": [
          "run_id"
        ],
        "properties": {
          "run_id": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RunDetailResponse": {
        "type": "object",
        "required": [
          "id",
          "automation_id",
          "trigger_kind",
          "action_kind",
          "status",
          "attempts",
          "max_attempts",
          "request_headers",
          "payload_available",
          "created_at"
        ],
        "properties": {
          "action_kind": {
            "type": "string"
          },
          "attempts": {
            "type": "integer",
            "format": "int32"
          },
          "automation_id": {
            "type": "integer",
            "format": "int64"
          },
          "command": {},
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "dedup_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "event_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "exit_code": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "max_attempts": {
            "type": "integer",
            "format": "int32"
          },
          "payload_available": {
            "type": "boolean",
            "description": "True while the frozen raw payload is still stored (not yet scrubbed)."
          },
          "payload_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the raw payload becomes eligible for scrubbing (webhook runs);\nomitted otherwise."
          },
          "request_body_base64": {
            "type": [
              "string",
              "null"
            ],
            "description": "Frozen raw request body, base64-encoded (webhook runs). Absent once scrubbed."
          },
          "request_headers": {
            "description": "Frozen inbound snapshot (webhook runs)."
          },
          "response_body": {
            "type": [
              "string",
              "null"
            ]
          },
          "response_status": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "stderr": {
            "type": [
              "string",
              "null"
            ]
          },
          "stdout": {
            "type": [
              "string",
              "null"
            ]
          },
          "target_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "target_port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "target_sandbox_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "trigger_kind": {
            "type": "string"
          },
          "truncated": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "RunListResponse": {
        "type": "object",
        "required": [
          "runs"
        ],
        "properties": {
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque cursor for the next (older) page; absent on the last page."
          },
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunSummaryResponse"
            }
          }
        }
      },
      "RunSummaryResponse": {
        "type": "object",
        "required": [
          "id",
          "trigger_kind",
          "action_kind",
          "status",
          "attempts",
          "created_at"
        ],
        "properties": {
          "action_kind": {
            "type": "string"
          },
          "attempts": {
            "type": "integer",
            "format": "int32"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "dedup_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "event_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "exit_code": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "command action result."
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "output_preview": {
            "type": [
              "string",
              "null"
            ],
            "description": "Truncated head of stdout (command) or the response body (http)."
          },
          "response_status": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "http action result."
          },
          "status": {
            "type": "string"
          },
          "target_sandbox_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "trigger_kind": {
            "type": "string"
          }
        }
      },
      "SandboxEventView": {
        "type": "object",
        "description": "One lifecycle or diagnostic timeline entry of the sandbox.",
        "required": [
          "id",
          "occurred_at",
          "kind",
          "message"
        ],
        "properties": {
          "from_state": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "kind": {
            "type": "string",
            "description": "`state_change` | `error` | `action` | `recovery`."
          },
          "message": {
            "type": "string"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          },
          "to_state": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SandboxMetrics": {
        "type": "object",
        "required": [
          "cpu_count",
          "cpu_used_percent",
          "mem_total_bytes",
          "mem_used_bytes",
          "disk_total_bytes",
          "disk_used_bytes"
        ],
        "properties": {
          "cpu_count": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "cpu_used_percent": {
            "type": "number",
            "format": "float"
          },
          "disk_total_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "disk_used_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "exec_failed_total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "exec_total": {
            "type": "integer",
            "format": "int64",
            "description": "Commands and processes started in the sandbox since the sandbox agent\nlast started, including those the platform runs itself (for example to\nread logs).\nThis and the other `*_total` counters only grow until the agent restarts.",
            "minimum": 0
          },
          "fs_op_failed_total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "fs_op_total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "local_disk_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Size of the sandbox disk on the host, in bytes. `null` when the host\ncannot measure it."
          },
          "mem_total_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "mem_used_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pty_sessions_active": {
            "type": "integer",
            "format": "int32",
            "description": "Current gauge: in-VM interactive terminal (PTY) sessions.",
            "minimum": 0
          }
        }
      },
      "SandboxOrganization": {
        "type": "object",
        "description": "Organization account in whose context the sandbox was created.",
        "required": [
          "account_id",
          "slug",
          "display_name"
        ],
        "properties": {
          "account_id": {
            "type": "integer",
            "format": "int64"
          },
          "display_name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        }
      },
      "SandboxOwner": {
        "type": "object",
        "description": "Human owner of a sandbox. Informational only; access remains account-scoped.",
        "required": [
          "user_id",
          "email",
          "name"
        ],
        "properties": {
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null for former members unless viewed by a platform admin or an owner/admin of their organization."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SandboxPermissions": {
        "type": "object",
        "required": [
          "read",
          "mutate",
          "change_visibility"
        ],
        "properties": {
          "change_visibility": {
            "type": "boolean"
          },
          "mutate": {
            "type": "boolean"
          },
          "read": {
            "type": "boolean"
          }
        }
      },
      "SandboxResponse": {
        "type": "object",
        "required": [
          "id",
          "status",
          "template",
          "template_version",
          "visibility",
          "permissions",
          "vcpu",
          "ram_mb",
          "metadata",
          "env_vars",
          "redacted_env_keys",
          "created_at",
          "exposed_ports",
          "owner",
          "organization",
          "version",
          "wake_on_request",
          "storage_access"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "default_command": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "disk_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Provisioned root-disk size in MiB. `null` for pre-0048 sandboxes."
          },
          "env_vars": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "error_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable reason the sandbox is stuck or `failed`. Omitted when\nhealthy."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "exposed_ports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicExposedPort"
            }
          },
          "id": {
            "type": "string"
          },
          "idle_pause_action": {
            "type": [
              "string",
              "null"
            ],
            "description": "What idle auto-pause does: `\"stop\"` or `\"hibernate\"`. Omitted when no\naction is set; the deployment default (`stop`) then applies.\nChangeable with `PATCH`."
          },
          "idle_pause_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Idle window in milliseconds after which a running sandbox is paused\nautomatically with `idle_pause_action`. `null` means never. Minimum\n30000. Changeable with `PATCH`."
          },
          "last_active_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Last activity on the sandbox. Never earlier than its last start or its\ncreation, so it is always present."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "node_available": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the node currently hosting this sandbox has a fresh heartbeat.\n`false` means the persisted lifecycle `status` may be stale\nand runtime operations will return `sandbox.owner_unavailable`.\nOmitted when the sandbox has no assigned node or liveness could not be read."
          },
          "organization": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SandboxOrganization",
                "description": "`null` for personal accounts or when organization identity could not be read."
              }
            ]
          },
          "owner": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SandboxOwner",
                "description": "Personal account's user or the organization's attributed user. `null`\nwhen unattributed, the user was deleted, the personal account has multiple\nusers, or identity could not be read.\nInformational only: this does not grant or revoke access."
              }
            ]
          },
          "owner_available": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Deprecated alias of `node_available`, retained for compatibility.",
            "deprecated": true
          },
          "permissions": {
            "$ref": "#/components/schemas/SandboxPermissions",
            "description": "Effective permissions for the caller in this account context."
          },
          "provisioning": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProvisioningStatus",
                "description": "Async-provisioning readiness signal. Omitted when nothing was\nprovisioned. A successful create no longer implies provisioning is done —\npoll until `provisioning.status == \"ready\"` before using the artifact."
              }
            ]
          },
          "ram_mb": {
            "type": "integer",
            "format": "int64"
          },
          "redacted_env_keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Env keys whose values are masked in this response."
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "stopped_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "storage_access": {
            "type": "string",
            "description": "Object-storage access mode: `\"none\"`, `\"ro\"` or `\"rw\"`. Always present;\ndefaults to `\"none\"`. Changeable with `PATCH` (`storage_access`); a\ngrant or revoke invalidates the previously issued storage token."
          },
          "template": {
            "type": "string"
          },
          "template_version": {
            "type": "integer",
            "format": "int64"
          },
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "vcpu": {
            "type": "integer",
            "format": "int64"
          },
          "version": {
            "type": "integer",
            "format": "int64"
          },
          "visibility": {
            "type": "string",
            "description": "`private` or `org` within an organization. Sandboxes created before\nvisibility was introduced are `org`."
          },
          "wake_on_request": {
            "type": "boolean",
            "description": "When `true`, an HTTP request to this sandbox wakes it before the\nrequest is forwarded: a hibernated sandbox is restored, and a stopped one\nis booted when the deployment allows it and the host still has a local\ncopy of its disk; otherwise the request gets `503` and the sandbox has to\nbe resumed with `resume`. Changeable with `PATCH`."
          }
        }
      },
      "SandboxResponseSupervisor": {
        "type": "object",
        "required": [
          "id",
          "status",
          "template",
          "visibility",
          "vcpu",
          "ram_mb",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "string"
          },
          "default_command": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ram_mb": {
            "type": "integer",
            "format": "int64"
          },
          "snapshot_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "stopped_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "template": {
            "type": "string"
          },
          "timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "vcpu": {
            "type": "integer",
            "format": "int64"
          },
          "visibility": {
            "type": "string",
            "description": "`private` or `org` within the account's organization."
          }
        }
      },
      "SaveAsTemplatePresetSpec": {
        "type": "object",
        "description": "Optional preset spec for `save-as-template`.",
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "skip": {
            "type": "boolean",
            "description": "When true, skip preset creation entirely."
          },
          "vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          }
        }
      },
      "SaveAsTemplateRequest": {
        "type": "object",
        "description": "Body for `POST /v1/sandboxes/{id}/save-as-template`.",
        "required": [
          "name"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional human-readable description."
          },
          "min_ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Floor for sandbox creates from this template. Defaults to the\nsource sandbox's `ram_mb`."
          },
          "min_vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Floor for sandbox creates from this template. Defaults to the\nsource sandbox's `vcpu`."
          },
          "name": {
            "type": "string",
            "description": "New template name. Must be `[a-z0-9][a-z0-9-]*[a-z0-9]`, max 64\nchars. Created as a `private` template; overwriting a frozen\ntemplate of the same name is rejected."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional free-form note recorded on the new template *version*\n(e.g. \"node 20 upgrade\"). Omitted ⇒ no note. Purely descriptive; it\ndoes not change how the save runs or what it returns."
          },
          "overwrite": {
            "type": "boolean",
            "description": "Replace an existing template owned by this account. Without this\nflag a name collision returns 409."
          },
          "preset": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SaveAsTemplatePresetSpec",
                "description": "Controls the auto-created default preset. Omit to auto-create\nusing sandbox's vcpu/ram_mb. Set `skip: true` to skip preset creation."
              }
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Free-form labels for search / display."
          }
        }
      },
      "SecretPermissions": {
        "type": "object",
        "required": [
          "mutate",
          "change_visibility",
          "use_secret"
        ],
        "properties": {
          "change_visibility": {
            "type": "boolean"
          },
          "mutate": {
            "type": "boolean"
          },
          "use_secret": {
            "type": "boolean"
          }
        }
      },
      "SecretResponse": {
        "type": "object",
        "required": [
          "id",
          "name",
          "type",
          "visibility",
          "preview",
          "created_at",
          "updated_at",
          "permissions"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "$ref": "#/components/schemas/SecretPermissions"
          },
          "preview": {},
          "type": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "visibility": {
            "type": "string"
          }
        }
      },
      "SecretValue": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "value",
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "env"
                ]
              },
              "value": {
                "type": "object",
                "required": [
                  "vars"
                ],
                "properties": {
                  "vars": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "propertyNames": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "value",
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "git_credential"
                ]
              },
              "value": {
                "type": "object",
                "required": [
                  "host",
                  "username",
                  "token"
                ],
                "properties": {
                  "host": {
                    "type": "string"
                  },
                  "token": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string"
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "value",
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "mcp_server"
                ]
              },
              "value": {
                "type": "object",
                "required": [
                  "name",
                  "url"
                ],
                "properties": {
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "propertyNames": {
                      "type": "string"
                    }
                  },
                  "name": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "value",
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "ssh_key"
                ]
              },
              "value": {
                "type": "object",
                "required": [
                  "private_key"
                ],
                "properties": {
                  "filename": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Target key filename (default `id_ed25519`/`id_rsa` by key type)."
                  },
                  "known_hosts": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Optional `known_hosts` lines appended in the VM."
                  },
                  "private_key": {
                    "type": "string"
                  },
                  "public_key": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "value",
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "registry_credential"
                ]
              },
              "value": {
                "type": "object",
                "required": [
                  "registry",
                  "host",
                  "token"
                ],
                "properties": {
                  "host": {
                    "type": "string"
                  },
                  "registry": {
                    "type": "string"
                  },
                  "scope": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "token": {
                    "type": "string"
                  },
                  "username": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Username for basic-auth registries (pip/docker); optional for token-only (npm/cargo)."
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "value",
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "file"
                ]
              },
              "value": {
                "type": "object",
                "required": [
                  "path",
                  "content"
                ],
                "properties": {
                  "content": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string"
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "description": "A saved git repository to clone into a sandbox — referenced by name in\n`secrets: [...]` at create (saved-repo feature). The spec is non-sensitive\nbut stored like any secret; the whole `value` is shown in `preview`.",
            "required": [
              "value",
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "repo"
                ]
              },
              "value": {
                "type": "object",
                "description": "A saved git repository to clone into a sandbox — referenced by name in\n`secrets: [...]` at create (saved-repo feature). The spec is non-sensitive\nbut stored like any secret; the whole `value` is shown in `preview`.",
                "required": [
                  "url"
                ],
                "properties": {
                  "credential": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Name of a `git_credential` secret to auto-apply (host-matched) so a\nprivate clone authenticates. Omit for public repos."
                  },
                  "depth": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "format": "int32",
                    "description": "Shallow-clone depth. Omit for a full clone.",
                    "minimum": 0
                  },
                  "path": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Destination path (`~/`-relative). Omit ⇒ `~/<name-from-url>`."
                  },
                  "ref": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Branch / tag / ref. Omit for the remote's default branch."
                  },
                  "required": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "When `true` (default), a clone failure fails the sandbox lifecycle."
                  },
                  "url": {
                    "type": "string",
                    "description": "Clone URL — `https://…` or `ssh://…` (validated like the inline `repo`)."
                  }
                }
              }
            }
          }
        ]
      },
      "ServiceSpec": {
        "type": "object",
        "description": "A long-running service installed as an enabled systemd unit inside the\nsandbox. Unlike a detached process, it starts again when a stopped sandbox\nboots back up, for example on `wake_on_request`. It is installed once, at\ncreate.",
        "required": [
          "name",
          "command",
          "ready_port"
        ],
        "properties": {
          "command": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Command argv (no shell). Runs as the sandbox default user."
          },
          "cwd": {
            "type": [
              "string",
              "null"
            ],
            "description": "Working directory. Omitted ⇒ the default user's home."
          },
          "env": {
            "type": "object",
            "description": "Environment for the service process (baked into the unit file).",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "name": {
            "type": "string",
            "description": "Unit name (becomes `/etc/systemd/system/<name>.service`);\n`^[a-z0-9-]{1,64}$`, platform unit names are reserved."
          },
          "ready_http_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional HTTP readiness path (must start with `/`); probed with curl\nafter the TCP connect passes."
          },
          "ready_port": {
            "type": "integer",
            "format": "int32",
            "description": "Readiness = a bounded in-guest TCP connect to\n`127.0.0.1:<ready_port>` succeeds and the service unit owns a listener\ncapable of serving that address (plus an HTTP 2xx when\n`ready_http_path` is set).",
            "minimum": 0
          },
          "ready_timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Per-service readiness budget. Omitted ⇒\n`[provisioning] service_default_ready_timeout_ms`.",
            "minimum": 0
          },
          "required": {
            "type": "boolean",
            "description": "When true, a failed launch or readiness timeout FAILS the sandbox\nlifecycle (`Running → Failed`) instead of leaving it usable."
          }
        }
      },
      "SignalRequest": {
        "type": "object",
        "required": [
          "signal"
        ],
        "properties": {
          "signal": {
            "type": "string"
          }
        }
      },
      "SkillConfig": {
        "type": "object",
        "description": "Claude Code skill configuration.",
        "properties": {
          "content": {
            "type": [
              "string",
              "null"
            ],
            "description": "Inline SKILL.md content. Takes priority over `url`."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Skill name. Optional for URL-based skills (auto-detected by skills CLI).\nRequired for inline skills (becomes the directory name)."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Skill source: GitHub/GitLab URL, shorthand (owner/repo/path), or raw URL.\nInstalled via `skills` CLI inside the VM."
          }
        }
      },
      "SkillsCatalogResponse": {
        "type": "object",
        "description": "The skills catalog: the Claude Code plugin and the skills it installs.",
        "required": [
          "plugin",
          "skills"
        ],
        "properties": {
          "plugin": {
            "$ref": "#/components/schemas/PluginInstall"
          },
          "skills": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogSkill"
            },
            "description": "Sorted by key."
          }
        }
      },
      "SshKeyConfig": {
        "type": "object",
        "description": "SSH key materialized into `~/.ssh` inside the VM (secrets-store).",
        "required": [
          "private_key"
        ],
        "properties": {
          "filename": {
            "type": [
              "string",
              "null"
            ],
            "description": "Target filename in `~/.ssh` (default `id_ed25519`, or `id_rsa` by key type)."
          },
          "known_hosts": {
            "type": [
              "string",
              "null"
            ],
            "description": "`known_hosts` lines appended to `~/.ssh/known_hosts` (mode 0644) when present."
          },
          "private_key": {
            "type": "string",
            "description": "PEM/OpenSSH private key material."
          },
          "public_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public key (written as `<filename>.pub`, mode 0644) when present."
          }
        }
      },
      "StartProcessRequest": {
        "type": "object",
        "required": [
          "cmd"
        ],
        "properties": {
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cmd": {
            "type": "string"
          },
          "cwd": {
            "type": [
              "string",
              "null"
            ]
          },
          "env": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "tag": {
            "type": [
              "string",
              "null"
            ]
          },
          "user": {
            "type": [
              "string",
              "null"
            ],
            "description": "Unix user to run as. Omit for the sandbox default."
          }
        }
      },
      "StartProcessResponse": {
        "type": "object",
        "required": [
          "pid"
        ],
        "properties": {
          "pid": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "StopResponse": {
        "type": "object",
        "required": [
          "id",
          "status",
          "snapshot_id",
          "stopped_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "snapshot_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "stopped_at": {
            "type": "string"
          },
          "upload_job_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "ID of the background job that uploads the sandbox state to durable\nstorage: still running when the stop is asynchronous, finished when it\nis not."
          }
        }
      },
      "StorageListResponse": {
        "type": "object",
        "required": [
          "objects",
          "common_prefixes"
        ],
        "properties": {
          "common_prefixes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Server-side \"folders\" under the requested prefix (`delimiter=/`)."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque continuation cursor; present when the listing is truncated."
          },
          "objects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StorageObject"
            }
          }
        }
      },
      "StorageObject": {
        "type": "object",
        "required": [
          "key",
          "size"
        ],
        "properties": {
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "key": {
            "type": "string",
            "description": "Key relative to the account namespace (no account prefix)."
          },
          "last_modified": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "StoragePresignRequest": {
        "type": "object",
        "required": [
          "key",
          "method"
        ],
        "properties": {
          "content_disposition": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional for GET — `response-content-disposition` signed into the\nURL (browser downloads with the original filename)."
          },
          "content_length": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Required for `PUT`: the size in bytes is signed into the URL, so an\nupload of any other size is rejected.",
            "minimum": 0
          },
          "key": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "description": "`\"GET\"` or `\"PUT\"`."
          },
          "upload_protocol": {
            "type": [
              "string",
              "null"
            ],
            "description": "Required for PUT: \"multipart_v1\". Old direct-PUT clients must upgrade;\nuploading the part alone does not publish an object."
          }
        }
      },
      "StoragePresignResponse": {
        "type": "object",
        "required": [
          "url",
          "expires_at"
        ],
        "properties": {
          "complete_before": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "PUT only: deadline for admitting completion, 300 seconds after URL expiry."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "upload_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "PUT only: POST /v1/storage/uploads/{upload_id}/complete after uploading.\nThe URL permits UploadPart, never a direct PUT of the visible object."
          },
          "url": {
            "type": "string"
          }
        }
      },
      "StoragePutResponse": {
        "type": "object",
        "required": [
          "key",
          "size"
        ],
        "properties": {
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "key": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "StorageUsageResponse": {
        "type": "object",
        "required": [
          "bytes_used",
          "object_count",
          "pending_bytes",
          "quota_bytes",
          "pending_objects",
          "quota_objects",
          "unknown_writers",
          "legacy_byte_limit",
          "max_inline_bytes"
        ],
        "properties": {
          "bytes_used": {
            "type": "integer",
            "format": "int64"
          },
          "legacy_byte_limit": {
            "type": "boolean"
          },
          "max_inline_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Largest body this deployment accepts on the inline `PUT`/`GET` route.\nPer-deployment, so a client must not assume the default. Objects above\nit travel by presigned URL.",
            "minimum": 0
          },
          "object_count": {
            "type": "integer",
            "format": "int64"
          },
          "pending_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Reservations for pending sessions and unresolved publication attempts."
          },
          "pending_objects": {
            "type": "integer",
            "format": "int64"
          },
          "quota_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "quota_objects": {
            "type": "integer",
            "format": "int32"
          },
          "reconciled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "unknown_writers": {
            "type": "boolean"
          }
        }
      },
      "Template": {
        "type": "object",
        "description": "A rootfs template with metadata about its requirements.",
        "required": [
          "id",
          "name",
          "created_at"
        ],
        "properties": {
          "account_id": {
            "type": "integer",
            "format": "int64",
            "description": "ID of the account that owns the template."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_sandbox_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "For user-saved templates: the sandbox they were promoted from."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "frozen": {
            "type": "boolean",
            "description": "When true the template is locked against edits/deletes until an\nadmin unfreezes it. Admin-only toggle."
          },
          "hidden": {
            "type": "boolean",
            "description": "When true the template is excluded from all API listings and\nsandbox create resolves it as 404."
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "min_ram_mb": {
            "type": "integer",
            "format": "int32"
          },
          "min_vcpu": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "required_env": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "visibility": {
            "type": "string",
            "description": "\"public\" — visible to all accounts; \"private\" — owner only."
          }
        }
      },
      "TemplateResponse": {
        "type": "object",
        "required": [
          "id",
          "name",
          "tags",
          "min_vcpu",
          "min_ram_mb",
          "required_env",
          "frozen",
          "visibility",
          "hidden",
          "restricted",
          "granted",
          "account_id",
          "created_at",
          "updated_at",
          "sandbox_count"
        ],
        "properties": {
          "account_id": {
            "type": "integer",
            "format": "int64"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_sandbox_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_disk_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Per-template default root-disk size in MiB; `null` ⇒ global 2 GiB. The\ncreate UI pre-selects this size (the disk can be grown further per-sandbox)."
          },
          "default_ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Create-time RAM default in MiB; always clamped to min_ram_mb."
          },
          "default_vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Create-time CPU default; requests/presets may explicitly override it."
          },
          "deletion_job_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "effective_default_ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "effective_default_vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Default size after template floors and the account cap. Absent when\nincompatible, or on admin metadata responses."
          },
          "frozen": {
            "type": "boolean"
          },
          "granted": {
            "type": "boolean",
            "description": "The CALLER holds a grant for this template (account- or tier-scoped)."
          },
          "hidden": {
            "type": "boolean"
          },
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Numeric template ID."
          },
          "long_description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional long-form markdown description (README), rendered in the UI."
          },
          "min_disk_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Root-disk floor baked into the template; create requests below it are raised."
          },
          "min_ram_mb": {
            "type": "integer",
            "format": "int64"
          },
          "min_vcpu": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "required_env": {
            "type": "object"
          },
          "resource_compatible": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the caller's effective compute caps admit this template's\nminimum size. Independent of template grants."
          },
          "restricted": {
            "type": "boolean",
            "description": "Access-gated: a `public` and `restricted` template is listed but cannot\nbe used unless `granted` is true."
          },
          "sandbox_count": {
            "type": "integer",
            "format": "int64"
          },
          "server_default_ram_mb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "server_default_vcpu": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Bare-template defaults including the global fallback, before account\ncaps. Clients retain these to recompute defaults after a policy change."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "visibility": {
            "type": "string"
          }
        }
      },
      "TemplateVersionResponse": {
        "type": "object",
        "description": "One template version (GET versions), sorted `version DESC`.",
        "required": [
          "template_id",
          "version",
          "is_default",
          "upload_status",
          "created_at",
          "sandbox_count",
          "availability"
        ],
        "properties": {
          "availability": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VersionAvailability"
            },
            "description": "Per-node materialisation status."
          },
          "compressed_size_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_sandbox_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_default": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "sandbox_count": {
            "type": "integer",
            "format": "int64",
            "description": "UNSCOPED, all-states count of sandboxes referencing this version."
          },
          "sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "template_id": {
            "type": "integer",
            "format": "int64",
            "description": "Owning template ID."
          },
          "uncompressed_size_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "upload_status": {
            "type": "string",
            "description": "`ready` | `uploading` | `failed` | `deleting`."
          },
          "version": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "TokenListItem": {
        "type": "object",
        "required": [
          "id",
          "name",
          "scope",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "scope": {
            "type": "string",
            "description": "Stored scope; may contain a value introduced by a newer API version.\nDisplay as-is."
          }
        }
      },
      "UploadedFile": {
        "type": "object",
        "required": [
          "path",
          "size"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "UserBody": {
        "type": "object",
        "required": [
          "id",
          "email",
          "account_id",
          "is_admin"
        ],
        "properties": {
          "account_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "`null` when the user has no personal account. The key stays so\nclients that compare response shapes do not break."
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "is_admin": {
            "type": "boolean"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "VersionAvailability": {
        "type": "object",
        "description": "Per-node availability of a version.",
        "required": [
          "node_id",
          "status"
        ],
        "properties": {
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "node_id": {
            "type": "string"
          },
          "pulled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "description": "`pulling` | `ready` | `failed` | `evicted`."
          }
        }
      },
      "VersionSandboxResponse": {
        "type": "object",
        "description": "One sandbox referencing a version (GET .../sandboxes).",
        "required": [
          "owner",
          "organization",
          "sandbox_id",
          "account_id",
          "state",
          "created_at"
        ],
        "properties": {
          "account_id": {
            "type": "integer",
            "format": "int64"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Nullable — the UI falls back to the id."
          },
          "organization": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SandboxOrganization"
              }
            ]
          },
          "owner": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SandboxOwner"
              }
            ]
          },
          "sandbox_id": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "supervisor_node_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ViolationBody": {
        "type": "object",
        "description": "One field-level problem inside a validation failure.\n\n`pointer` names a POSITION in what the caller sent. It never quotes the\nVALUE — that is the whole reason this is structured rather than prose.",
        "required": [
          "location",
          "pointer",
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Bounded classifier: `invalid_type` | `missing_field` | `unknown_field` |\n`out_of_range` | `invalid`.",
            "example": "out_of_range"
          },
          "location": {
            "type": "string",
            "description": "`body` | `query` | `path` | `header`.",
            "example": "body"
          },
          "pointer": {
            "type": "string",
            "description": "JSON Pointer into the request.",
            "example": "/vcpu"
          }
        }
      },
      "WriteFileBody": {
        "type": "object",
        "required": [
          "path",
          "content"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "encoding": {
            "type": [
              "string",
              "null"
            ],
            "description": "Content encoding: \"base64\" if content is base64-encoded binary, omit for raw text."
          },
          "overwrite": {
            "type": "boolean"
          },
          "path": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-just-run-publication": {
    "allowlist": "docs-site/api-reference/allowlist.json",
    "sources": {
      "gateway": "crates/api-gateway/src/openapi.rs",
      "supervisor": "crates/supervisor/src/api/openapi.rs"
    },
    "coverage": "partial"
  }
}
