{"owner":"TencentCloud","repo":"CubeSandbox","hasSpec":true,"specFile":"openapi.yml","branch":"HEAD","format":"yaml","version":"3.x (YAML)","title":"CubeSandbox API","description":"","endpoints":[],"spec":"# Copyright (c) 2026 Tencent Inc.\n# SPDX-License-Identifier: Apache-2.0\n#\n\nopenapi: 3.1.0\ninfo:\n  title: CubeAPI\n  description: E2B-compatible sandbox API server.\n  license:\n    name: ''\n  version: 0.1.0\nservers:\n- url: /cubeapi/v1\n  description: CubeAPI SDK/dashboard surface (source of truth generated via `cube-api --export-openapi`)\npaths:\n  /health:\n    get:\n      tags:\n      - handlers::health\n      summary: GET /health\n      operationId: health\n      responses:\n        '200':\n          description: Health status\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/HealthResponse'\n  /sandboxes:\n    get:\n      tags:\n      - handlers::sandboxes\n      summary: List sandboxes in every state, `pausing` and `unknown` included; GET /v2/sandboxes is the E2B view.\n      operationId: list_sandboxes\n      parameters:\n      - name: metadata\n        in: query\n        description: |-\n          `key=value` pairs joined by `&`, written as is, percent-encoded, or double-encoded as E2B's SDKs send it.\n          A `&` or `=` inside a value must stay `%`-encoded after URL decoding (`+` is a space when form-encoded).\n          An empty value is the same as omitting `metadata`: no filter.\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Sandbox list\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/ListedSandbox'\n        '400':\n          description: Invalid metadata\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n    post:\n      tags:\n      - handlers::sandboxes\n      operationId: create_sandbox\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/NewSandbox'\n        required: true\n      responses:\n        '201':\n          description: Sandbox created\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Sandbox'\n        '400':\n          description: Invalid request\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Template or snapshot not found (e.g. deleted/tombstoned)\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '409':\n          description: A referenced resource is in a conflicting state and cannot be used to create a sandbox\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}:\n    get:\n      tags:\n      - handlers::sandboxes\n      operationId: get_sandbox\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Sandbox detail\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/SandboxDetail'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n    delete:\n      tags:\n      - handlers::sandboxes\n      operationId: kill_sandbox\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      responses:\n        '204':\n          description: Sandbox deleted\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '408':\n          description: The existing standard API request timeout expired before the synchronous delete completed\n        '409':\n          description: Paused sandbox cannot be admitted for internal resume because node capacity or resource metadata is unavailable\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '503':\n          description: Sandbox is pausing, another lifecycle operation is in progress, the Cubelet RPC has too little remaining time, or its internal resume could not be completed\n          headers:\n            Retry-After:\n              schema:\n                type: integer\n                format: int64\n                minimum: 0\n              description: Seconds a client should wait before retrying DELETE\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/connect:\n    post:\n      tags:\n      - handlers::sandboxes\n      operationId: connect_sandbox\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/ConnectSandbox'\n        required: true\n      responses:\n        '200':\n          description: Sandbox connection info\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Sandbox'\n        '400':\n          description: Invalid timeout value\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '409':\n          description: Sandbox is not connectable in its current state, or a lifecycle transition conflicts with the request\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '503':\n          description: A concurrent lifecycle operation has not settled and the sandbox is not running yet; retry\n          headers:\n            Retry-After:\n              schema:\n                type: integer\n                format: int64\n                minimum: 0\n              description: Seconds a client should wait before retrying connect\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/exposed-ports/{containerPort}:\n    get:\n      tags:\n      - handlers::sandboxes\n      operationId: get_sandbox_exposed_port\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox ID\n        required: true\n        schema:\n          type: string\n      - name: containerPort\n        in: path\n        description: Container port declared via the template's expose-port list\n        required: true\n        schema:\n          type: integer\n          format: int32\n      responses:\n        '200':\n          description: Exposed port endpoint\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ExposedPortEndpoint'\n        '400':\n          description: Invalid container port\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Sandbox not found or port not exposed\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/fork:\n    post:\n      tags:\n      - handlers::sandboxes\n      operationId: fork_sandbox\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Source sandbox identifier\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/ForkRequest'\n        required: true\n      responses:\n        '201':\n          description: Fork results (array length == count; per-fork failures are error entries, still 201)\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/ForkResult'\n        '400':\n          description: Invalid request\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '409':\n          description: Sandbox state does not allow fork\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/logs:\n    get:\n      tags:\n      - handlers::sandboxes\n      operationId: get_sandbox_logs\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      - name: start\n        in: query\n        required: false\n        schema:\n          type: integer\n          format: int64\n      - name: limit\n        in: query\n        required: false\n        schema:\n          type: integer\n          format: int32\n      responses:\n        '200':\n          description: Sandbox logs (legacy shape)\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/SandboxLogs'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/network:\n    put:\n      tags:\n      - handlers::sandboxes\n      operationId: update_sandbox_network\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/UpdateSandboxNetworkRequest'\n        required: true\n      responses:\n        '204':\n          description: Network policy updated\n        '400':\n          description: Invalid network policy\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '409':\n          description: Sandbox is not running\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/pause:\n    post:\n      tags:\n      - handlers::sandboxes\n      operationId: pause_sandbox\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      responses:\n        '204':\n          description: Sandbox paused\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '409':\n          description: Sandbox cannot be paused\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/refreshes:\n    post:\n      tags:\n      - handlers::sandboxes\n      operationId: refresh_sandbox\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/RefreshRequest'\n        required: true\n      responses:\n        '204':\n          description: Sandbox refreshed\n        '400':\n          description: Invalid duration value\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/resume:\n    post:\n      tags:\n      - handlers::sandboxes\n      operationId: resume_sandbox\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/ResumedSandbox'\n        required: true\n      responses:\n        '201':\n          description: Sandbox resumed\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Sandbox'\n        '400':\n          description: Invalid timeout value\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '409':\n          description: Sandbox is already running\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '503':\n          description: A concurrent lifecycle operation has not settled and the sandbox is not running yet; retry\n          headers:\n            Retry-After:\n              schema:\n                type: integer\n                format: int64\n                minimum: 0\n              description: Seconds a client should wait before retrying resume\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/rollback:\n    post:\n      tags:\n      - handlers::snapshots\n      operationId: rollback_sandbox\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/RollbackRequest'\n        required: true\n      responses:\n        '200':\n          description: Sandbox rolled back to snapshot\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/RollbackResponse'\n        '404':\n          description: Sandbox or snapshot not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/snapshots:\n    post:\n      tags:\n      - handlers::snapshots\n      operationId: create_snapshot\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/CreateSnapshotRequest'\n        required: true\n      responses:\n        '201':\n          description: Snapshot created\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/SnapshotInfo'\n        '400':\n          description: Snapshot name starts with a reserved tpl-/snap- prefix, or the requested snapshot mode is invalid\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '409':\n          description: The control plane refused the capture or recorded a different mode than the one requested\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '503':\n          description: Filesystem-only support could not be verified; retry\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /sandboxes/{sandboxID}/timeout:\n    post:\n      tags:\n      - handlers::sandboxes\n      operationId: set_sandbox_timeout\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/SetTimeoutRequest'\n        required: true\n      responses:\n        '204':\n          description: Timeout updated\n        '400':\n          description: Invalid timeout value\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /snapshots:\n    get:\n      tags:\n      - handlers::snapshots\n      operationId: list_snapshots\n      parameters:\n      - name: sandboxID\n        in: query\n        description: Filter by originating sandbox ID.\n        required: false\n        schema:\n          type: string\n      - name: limit\n        in: query\n        description: Max items per page (default 100, max 100).\n        required: false\n        schema:\n          type: integer\n          format: int32\n      - name: nextToken\n        in: query\n        description: Pagination cursor from previous response header x-next-token.\n        required: false\n        schema:\n          type: string\n      - name: name\n        in: query\n        description: Filter by snapshot name or ID. (E2B SDK `list_snapshots` gained `name` in v2.33.0)\n        required: false\n        schema:\n          type: string\n      - name: backend\n        in: query\n        description: Filter by CoW backend (xfs | s3).\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: List of snapshots\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/SnapshotListItem'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /templates:\n    get:\n      tags:\n      - handlers::templates\n      operationId: list_templates\n      parameters:\n      - name: instance_type\n        in: query\n        description: |-\n          Optional CubeMaster instance_type filter (currently no server-side filter;\n          reserved for future use).\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Template list\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/TemplateSummary'\n        '404':\n          description: Template endpoint unavailable\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n    post:\n      tags:\n      - handlers::templates\n      operationId: create_template\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/CreateTemplateRequest'\n        required: true\n      responses:\n        '202':\n          description: Template build job accepted\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/TemplateBuildJob'\n        '400':\n          description: Invalid request (bad alias, missing image, etc.)\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /templates/aliases/{alias}:\n    get:\n      tags:\n      - handlers::templates\n      operationId: get_template_by_alias\n      parameters:\n      - name: alias\n        in: path\n        description: Template alias\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Template alias lookup\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/TemplateAliasLookupResponse'\n        '400':\n          description: Invalid alias\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Template alias not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /templates/compat:\n    get:\n      tags:\n      - handlers::templates\n      operationId: template_compat\n      responses:\n        '200':\n          description: Template compatibility matrix\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/TemplateCompatMatrixView'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /templates/compat/{templateID}/adopt-baseline:\n    post:\n      tags:\n      - handlers::templates\n      operationId: adopt_template_compat_baseline\n      parameters:\n      - name: templateID\n        in: path\n        description: Template identifier\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Adopted UNKNOWN replicas to current baseline\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/TemplateCompatAdoptResponseView'\n        '404':\n          description: Template not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /templates/{templateID}:\n    get:\n      tags:\n      - handlers::templates\n      operationId: get_template\n      parameters:\n      - name: templateID\n        in: path\n        description: Template identifier\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Template detail\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/TemplateDetail'\n        '404':\n          description: Template not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n    post:\n      tags:\n      - handlers::templates\n      operationId: rebuild_template\n      parameters:\n      - name: templateID\n        in: path\n        description: Template identifier\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/RebuildTemplateRequest'\n        required: true\n      responses:\n        '202':\n          description: Rebuild job accepted\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/TemplateBuildJob'\n        '404':\n          description: Template not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n    delete:\n      tags:\n      - handlers::templates\n      operationId: delete_template\n      parameters:\n      - name: templateID\n        in: path\n        description: Template or snapshot identifier, alias, or snapshot name\n        required: true\n        schema:\n          type: string\n      - name: instance_type\n        in: query\n        description: CubeMaster instance_type filter\n        required: false\n        schema:\n          type: string\n      - name: sync\n        in: query\n        description: Wait for the delete to finish before returning; nodes unreachable past the 15-minute grace period are still cleaned in the background\n        required: false\n        schema:\n          type: boolean\n      - name: snapshot_only\n        in: query\n        description: Only match snapshots by id or name; a miss is 404 and never deletes a template\n        required: false\n        schema:\n          type: boolean\n      responses:\n        '204':\n          description: Template or snapshot deleted; data on nodes unreachable past the 15-minute grace period is cleaned in the background once they return\n        '404':\n          description: Template or snapshot not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '409':\n          description: Name matches both a template alias and a snapshot, or several snapshots\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n    patch:\n      tags:\n      - handlers::templates\n      operationId: update_template\n      parameters:\n      - name: templateID\n        in: path\n        description: Template identifier\n        required: true\n        schema:\n          type: string\n      responses:\n        '501':\n          description: Not implemented; use POST /templates/{id} to rebuild\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /templates/{templateID}/alias:\n    put:\n      tags:\n      - handlers::templates\n      operationId: set_template_alias\n      parameters:\n      - name: templateID\n        in: path\n        description: Template identifier or current alias\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/SetTemplateAliasRequest'\n        required: true\n      responses:\n        '200':\n          description: Alias updated\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/TemplateDetail'\n        '400':\n          description: Invalid alias, or alias requested on a snapshot (not applicable)\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Template not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '409':\n          description: Template is not READY, or concurrent alias claim conflict; retry may succeed\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /templates/{templateID}/builds/{buildID}:\n    post:\n      tags:\n      - handlers::templates\n      operationId: start_template_build\n      parameters:\n      - name: templateID\n        in: path\n        description: Template identifier\n        required: true\n        schema:\n          type: string\n      - name: buildID\n        in: path\n        description: Build identifier\n        required: true\n        schema:\n          type: string\n      responses:\n        '202':\n          description: Build started\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/TemplateBuildJob'\n        '404':\n          description: Template or build not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /templates/{templateID}/builds/{buildID}/logs:\n    get:\n      tags:\n      - handlers::templates\n      operationId: get_template_build_logs\n      parameters:\n      - name: templateID\n        in: path\n        description: Template identifier\n        required: true\n        schema:\n          type: string\n      - name: buildID\n        in: path\n        description: Build identifier\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Build logs (JSON)\n        '404':\n          description: Build not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /templates/{templateID}/builds/{buildID}/status:\n    get:\n      tags:\n      - handlers::templates\n      operationId: get_template_build_status\n      parameters:\n      - name: templateID\n        in: path\n        description: Template identifier\n        required: true\n        schema:\n          type: string\n      - name: buildID\n        in: path\n        description: Build identifier\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Build status\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/TemplateBuildStatus'\n        '404':\n          description: Template or build not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /v2/sandboxes:\n    get:\n      tags:\n      - handlers::sandboxes\n      operationId: list_sandboxes_v2\n      parameters:\n      - name: metadata\n        in: query\n        description: |-\n          `key=value` pairs joined by `&`, written as is, percent-encoded, or double-encoded as E2B's SDKs send it.\n          A `&` or `=` inside a value must stay `%`-encoded after URL decoding (`+` is a space when form-encoded).\n          An empty value is the same as omitting `metadata`: no filter.\n        required: false\n        schema:\n          type: string\n      - name: state\n        in: query\n        description: |-\n          Comma-separated states: `running`, `paused` (includes pausing), `pausing`, `unknown` (aliases `stopped`, `error`).\n          `pausing` is a Cube-native state: asking for it returns `pausing`; otherwise a pausing sandbox reads `paused`.\n          Defaults to running and paused sandboxes; any unrecognised or empty value is a 400.\n        required: false\n        schema:\n          type: string\n      - name: nextToken\n        in: query\n        description: Continuation cursor from the previous response's `x-next-token` header.\n        required: false\n        schema:\n          type: string\n      - name: limit\n        in: query\n        required: false\n        schema:\n          type: integer\n          format: int32\n      responses:\n        '200':\n          description: Sandbox list\n          headers:\n            x-next-token:\n              schema:\n                type: string\n              description: Continuation cursor for the next page. Omitted on the last page.\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/ListedSandbox'\n        '400':\n          description: Malformed nextToken, invalid state or invalid metadata\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n    post:\n      tags:\n      - handlers::sandboxes\n      operationId: create_sandbox_v2\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/NewSandboxV2'\n        required: true\n      responses:\n        '201':\n          description: Sandbox created\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Sandbox'\n        '400':\n          description: Invalid request\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /v2/sandboxes/{sandboxID}/connect:\n    post:\n      tags:\n      - handlers::sandboxes\n      operationId: connect_sandbox_v2\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/ConnectSandboxV2'\n        required: true\n      responses:\n        '200':\n          description: Sandbox connection info\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Sandbox'\n        '400':\n          description: Invalid timeout value\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '409':\n          description: Paused sandbox cannot be resumed during a conflicting lifecycle transition\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '503':\n          description: A concurrent lifecycle operation has not settled and the sandbox is not running yet; retry\n          headers:\n            Retry-After:\n              schema:\n                type: integer\n                format: int64\n                minimum: 0\n              description: Seconds a client should wait before retrying connect\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /v2/sandboxes/{sandboxID}/logs:\n    get:\n      tags:\n      - handlers::sandboxes\n      operationId: get_sandbox_logs_v2\n      parameters:\n      - name: sandboxID\n        in: path\n        description: Sandbox identifier\n        required: true\n        schema:\n          type: string\n      - name: cursor\n        in: query\n        required: false\n        schema:\n          type: integer\n          format: int64\n      - name: limit\n        in: query\n        required: false\n        schema:\n          type: integer\n          format: int32\n      - name: direction\n        in: query\n        required: false\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Structured sandbox logs\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/SandboxLogsV2Response'\n        '404':\n          description: Sandbox not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Unexpected backend error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n  /v2/volumes:\n    post:\n      tags:\n      - handlers::volumes\n      summary: |-\n        Create a volume with opaque plugin input. Query, delete and mount it through\n        the existing volume APIs using the returned volumeID.\n      operationId: create_volume_v2\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/NewVolumeV2'\n        required: true\n      responses:\n        '201':\n          description: Successfully created a new volume\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/VolumeAndToken'\n        '400':\n          description: Bad request\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '401':\n          description: Authentication error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Server error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n      security:\n      - apiKeyAuth: []\n  /volumes:\n    get:\n      tags:\n      - handlers::volumes\n      summary: List all volumes.\n      description: Returns `200 OK` with `[Volume]` on success.\n      operationId: list_volumes\n      responses:\n        '200':\n          description: Successfully listed all volumes\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/Volume'\n        '401':\n          description: Authentication error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Server error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n      security:\n      - apiKeyAuth: []\n    post:\n      tags:\n      - handlers::volumes\n      summary: Create a new volume.\n      description: Returns `201 Created` with `VolumeAndToken` on success.\n      operationId: create_volume\n      requestBody:\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/NewVolume'\n        required: true\n      responses:\n        '201':\n          description: Successfully created a new volume\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/VolumeAndToken'\n        '400':\n          description: Bad request\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '401':\n          description: Authentication error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Server error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n      security:\n      - apiKeyAuth: []\n  /volumes/{volumeID}:\n    get:\n      tags:\n      - handlers::volumes\n      summary: Get info for a single volume (includes auth token).\n      description: Returns `200 OK` with `VolumeDetails` on success.\n      operationId: get_volume\n      parameters:\n      - name: volumeID\n        in: path\n        description: Identifier of the volume\n        required: true\n        schema:\n          type: string\n      responses:\n        '200':\n          description: Successfully retrieved a volume\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/VolumeDetails'\n        '401':\n          description: Authentication error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Server error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n      security:\n      - apiKeyAuth: []\n    delete:\n      tags:\n      - handlers::volumes\n      summary: Delete a volume.\n      description: Returns `204 No Content` on success.\n      operationId: delete_volume\n      parameters:\n      - name: volumeID\n        in: path\n        description: Identifier of the volume\n        required: true\n        schema:\n          type: string\n      responses:\n        '204':\n          description: Successfully deleted a volume\n        '401':\n          description: Authentication error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '404':\n          description: Not found\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n        '500':\n          description: Server error\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/ApiError'\n      security:\n      - apiKeyAuth: []\ncomponents:\n  schemas:\n    ApiError:\n      type: object\n      required:\n      - code\n      - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n    BlockIoQosConfig:\n      type: object\n      properties:\n        iops:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          minimum: 1\n        throughputMiBps:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          minimum: 1\n      additionalProperties: false\n    ClusterOverview:\n      type: object\n      required:\n      - nodeCount\n      - healthyNodes\n      - totalCpuMilli\n      - allocatableCpuMilli\n      - totalMemoryMB\n      - allocatableMemoryMB\n      - maxMvmSlots\n      properties:\n        allocatableCpuMilli:\n          type: integer\n          format: int64\n          description: Currently-allocatable CPU in millicpu.\n        allocatableMemoryMB:\n          type: integer\n          format: int64\n          description: Currently-allocatable memory in MiB.\n        healthyNodes:\n          type: integer\n          minimum: 0\n        maxMvmSlots:\n          type: integer\n          format: int64\n          description: Sum of every node's maximum MVM slots.\n        nodeCount:\n          type: integer\n          minimum: 0\n        totalCpuMilli:\n          type: integer\n          format: int64\n          description: Total CPU across the cluster, expressed in millicpu.\n        totalMemoryMB:\n          type: integer\n          format: int64\n          description: Total memory in MiB.\n    ComponentMatrixRowView:\n      type: object\n      description: Per-component aggregation across all nodes.\n      required:\n      - component\n      - consistent\n      - versions\n      properties:\n        component:\n          type: string\n        consistent:\n          type: boolean\n        declaredVersion:\n          type: string\n        declaredVersions:\n          type: array\n          items:\n            type: string\n        versions:\n          type: array\n          items:\n            $ref: '#/components/schemas/ComponentVersionGroupView'\n    ComponentVersionGroupView:\n      type: object\n      description: A group of nodes that report the same version of a component.\n      required:\n      - version\n      - nodes\n      properties:\n        nodes:\n          type: array\n          items:\n            type: string\n        version:\n          type: string\n    ComponentVersionView:\n      type: object\n      description: One component's version on a node.\n      required:\n      - component\n      properties:\n        buildTime:\n          type: string\n        commit:\n          type: string\n        component:\n          type: string\n        source:\n          type: string\n        version:\n          type: string\n    ConnectSandbox:\n      type: object\n      description: Request body for POST /sandboxes/{id}/connect.\n      properties:\n        timeout:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: |-\n            Idle timeout in seconds; omitted to keep the current value, -1 for no expiry,\n            and a positive value ensures at least that much remaining lifetime. For an\n            already-running sandbox, a shorter positive window is ignored; use\n            POST /sandboxes/{id}/timeout to shorten it.\n            Zero and values below -1 are invalid.\n    ConnectSandboxV2:\n      allOf:\n      - $ref: '#/components/schemas/ConnectSandbox'\n      - type: object\n        properties:\n          memory:\n            type:\n            - boolean\n            - 'null'\n            description: |-\n              Resume from the memory snapshot. Defaults to true. `false` (cold-boot\n              from disk) is not supported and is rejected by the handler.\n      description: |-\n        Request body for POST /v2/sandboxes/{id}/connect (E2B SDK >= 2.51.0).\n\n        Reuses the v1 [`ConnectSandbox`] shape and adds the v2-only `memory` flag.\n        CubeSandbox always resumes from the memory snapshot, so `memory=false`\n        (cold-boot from disk) is rejected by the handler.\n    ControlPlaneVersionView:\n      type: object\n      description: Control-plane reference version (the cluster's target version).\n      required:\n      - version\n      properties:\n        buildTime:\n          type: string\n        commit:\n          type: string\n        version:\n          type: string\n    CreateSnapshotRequest:\n      type: object\n      description: Request body for POST /sandboxes/{id}/snapshots.\n      properties:\n        ttlSeconds:\n          type:\n          - integer\n          - 'null'\n          format: int64\n          description: Lifetime from READY in seconds; omitted or zero means no expiration.\n        backend:\n          type:\n          - string\n          - 'null'\n          description: CoW backend (xfs | s3). Empty means xfs.\n        keepMemory:\n          type:\n          - boolean\n          - 'null'\n          description: Deprecated E2B alias for `memory`; false means fs-only.\n        memory:\n          type:\n          - boolean\n          - 'null'\n          description: 'E2B compatibility alias: false means fs-only.'\n        mode:\n          type:\n          - string\n          - 'null'\n          description: 'Snapshot artifact mode: full | fs-only | filesystem (E2B alias).'\n        name:\n          type:\n          - string\n          - 'null'\n    CreateTemplateRequest:\n      type: object\n      description: Body for POST /templates (create from image).\n      required:\n      - image\n      properties:\n        alias:\n          type:\n          - string\n          - 'null'\n          description: Deprecated E2B template alias. Used when `name` is absent or blank.\n        allowInternetAccess:\n          type:\n          - boolean\n          - 'null'\n          description: Allow internet (public) access.\n        allowOut:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n          description: Allowed outbound CIDRs for CubeVS egress policy.\n        args:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n          description: Override container CMD args.\n        backend:\n          type:\n          - string\n          - 'null'\n          description: |-\n            CoW backend for this template and its sandboxes/snapshots (\"xfs\" | \"s3\").\n            Omitted keeps the historical xfs path; normalized/validated by CubeMaster.\n        command:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n          description: Override container ENTRYPOINT.\n        cpu:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: CPU in millicores, e.g. 2000 means 2000m.\n          minimum: 0\n        denyOut:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n          description: Denied outbound CIDRs for CubeVS egress policy.\n        dns:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n          description: Container DNS nameservers.\n        enableIvshmem:\n          type:\n          - boolean\n          - 'null'\n          description: Enable ivshmem when building the template snapshot.\n        env:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n          description: Environment variables as \"KEY=VALUE\" strings.\n        exposedPorts:\n          type:\n          - array\n          - 'null'\n          items:\n            type: integer\n            format: int32\n            minimum: 0\n          description: Ports the container listens on.\n        image:\n          type: string\n          description: Container image reference, e.g. `registry.example.com/code:latest`.\n        instanceType:\n          type:\n          - string\n          - 'null'\n        lifecycle:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/TemplateLifecycle'\n            description: Commands run inside sandboxes created from this template.\n        memory:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: Memory in MiB, e.g. 2000.\n          minimum: 0\n        name:\n          type:\n          - string\n          - 'null'\n          description: |-\n            E2B v3 template name. A tag suffix after ':' is accepted by CubeAPI but\n            only the name portion is forwarded as the CubeMaster alias.\n        networkType:\n          type:\n          - string\n          - 'null'\n          description: Network mode, e.g. \"tap\".\n        nodes:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n          description: Limit template distribution to these node IDs or host IPs.\n        probePath:\n          type:\n          - string\n          - 'null'\n          description: HTTP probe path, e.g. \"/health\". Defaults to \"/health\" when `probePort` is set.\n        probePort:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: HTTP probe port.\n          minimum: 0\n        qos:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/QosConfig'\n            description: |-\n              Optional template-level QoS. Every sandbox created from this template\n              receives the same independent ingress and egress network ceilings.\n        registryPassword:\n          type:\n          - string\n          - 'null'\n          description: Registry password for private source images.\n        registryUsername:\n          type:\n          - string\n          - 'null'\n          description: Registry username for private source images.\n        templateID:\n          type: string\n          description: |-\n            Deprecated and ignored. Template IDs are always generated server-side\n            with the `tpl-` prefix; clients must use the returned `templateID`.\n        user:\n          type:\n          - string\n          - 'null'\n          description: |-\n            Container user for the template build and later sandboxes.\n            `uid`, `uid:gid`, `username`, or `username:gid`. The group must be numeric.\n            Omitted keeps the default root user.\n        with_cube_ca:\n          type:\n          - boolean\n          - 'null'\n          description: |-\n            Whether CubeMaster bakes the CubeEgress root CA into the template rootfs.\n            Omitted or null defaults to true on CubeMaster.\n        writableLayerSize:\n          type:\n          - string\n          - 'null'\n          description: Writable layer size for the rootfs, e.g. \"1G\".\n    E2BNetworkRule:\n      type: object\n      properties:\n        transform:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/E2BNetworkTransform'\n      additionalProperties: false\n    E2BNetworkTransform:\n      type: object\n      properties:\n        headers:\n          type: object\n          additionalProperties:\n            type: string\n          propertyNames:\n            type: string\n      additionalProperties: false\n    E2bNetworkRule:\n      type: object\n      description: One entry of E2B's per-host `rules` mapping.\n      properties:\n        transform:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/E2bNetworkTransform'\n      additionalProperties: false\n    E2bNetworkTransform:\n      type: object\n      description: |-\n        Header rewrite in E2B's per-host `rules` shape.\n\n        Unknown keys are rejected rather than ignored: `headers` is the only\n        transform CubeEgress can express, and silently dropping another kind would\n        leave the caller believing a rewrite is in place that never runs.\n      properties:\n        headers:\n          type:\n          - object\n          - 'null'\n          description: Headers to inject or override on matching requests.\n          additionalProperties:\n            type: string\n          propertyNames:\n            type: string\n      additionalProperties: false\n    EgressRule:\n      type: object\n      description: 'L7 egress rule: match conditions + action (allow/deny, audit, credential injection).'\n      required:\n      - name\n      - match\n      - action\n      properties:\n        action:\n          $ref: '#/components/schemas/EgressRuleAction'\n        match:\n          $ref: '#/components/schemas/EgressRuleMatch'\n        name:\n          type: string\n          description: Human-readable label used for audit logging.\n    EgressRuleAction:\n      type: object\n      description: |-\n        Rule action.\n\n        - `allow=true`: pass the request through; optional credential injection.\n        - `allow=false`: reject (HTTP 403); `inject` is ignored if set.\n        - `audit` defaults to `\"metadata\"` server-side when omitted.\n      required:\n      - allow\n      properties:\n        allow:\n          type: boolean\n        audit:\n          type:\n          - string\n          - 'null'\n          description: One of `\"full\"`, `\"metadata\"`, `\"none\"`.\n        inject:\n          type:\n          - array\n          - 'null'\n          items:\n            $ref: '#/components/schemas/EgressRuleInject'\n    EgressRuleInject:\n      type: object\n      description: |-\n        Credential injection. Only honored when `Action.allow=true` and the\n        request is HTTPS with matching SNI/Host (downstream enforces).\n      required:\n      - header\n      - secret\n      properties:\n        format:\n          type:\n          - string\n          - 'null'\n          description: Template containing `${SECRET}`; defaults to `\"${SECRET}\"` when omitted.\n        header:\n          type: string\n        secret:\n          type: string\n    EgressRuleMatch:\n      type: object\n      description: |-\n        Rule match conditions. All fields optional; empty match matches any request.\n\n        Multi-field semantics: AND across fields, OR within `method`.\n        Comparisons on sni/host/scheme are case-insensitive.\n\n        `port` + `scheme` together pin the (host, port) tuple CubeEgress intercepts.\n        Both nil keeps the legacy default {80/http, 443/https}. When `port` is set,\n        `scheme` MUST also be set — same-`(host, port)` rules across the policy\n        must agree on `scheme` (the server rejects the whole policy on mismatch).\n      properties:\n        host:\n          type:\n          - string\n          - 'null'\n        method:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n        path:\n          type:\n          - string\n          - 'null'\n        port:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        scheme:\n          type:\n          - string\n          - 'null'\n        sni:\n          type:\n          - string\n          - 'null'\n    EgressRulesInput:\n      oneOf:\n      - type: array\n        items:\n          $ref: '#/components/schemas/EgressRule'\n      - type: object\n        additionalProperties:\n          type: array\n          items:\n            $ref: '#/components/schemas/E2bNetworkRule'\n        propertyNames:\n          type: string\n      description: |-\n        The two accepted shapes of `rules`.\n\n        CubeSandbox rules are a list carrying the full L7 semantics: a match on\n        sni/host/method/path/scheme/port, an allow-or-deny verdict, an audit level\n        and credential injection. E2B's are a map from host to header rewrites, with\n        no verdict, no audit and no match beyond the host -- a strict subset, and one\n        that its own docs note \"does not allow egress on its own\".\n\n        Both are accepted so an E2B client works unchanged, but the list stays the\n        canonical form: converting our rules into E2B's map would silently drop\n        `allow: false`, `audit`, and every match field except the host.\n\n        A JSON array and a JSON object cannot be confused, so the shape alone\n        discriminates.\n    ExposedPortEndpoint:\n      type: object\n      description: |-\n        Exposed-port endpoint returned by GET /sandboxes/{sandboxID}/exposed-ports/{containerPort}.\n\n        `mode` selects the address family of `endpoint`: \"host_port\" (endpoint is\n        hostIP:hostPort, usable from any caller) or \"tap_ip\" (endpoint is\n        sandboxIP:containerPort, only meaningful for callers on the sandbox's own\n        node).\n      required:\n      - sandboxID\n      - containerPort\n      - mode\n      - endpoint\n      properties:\n        containerPort:\n          type: integer\n          format: int32\n        endpoint:\n          type: string\n        hostIP:\n          type:\n          - string\n          - 'null'\n        hostPort:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        mode:\n          type: string\n        sandboxID:\n          type: string\n        sandboxIP:\n          type:\n          - string\n          - 'null'\n    ForkError:\n      type: object\n      description: |-\n        Per-fork error entry inside a fork response element. CubeMaster's business\n        ret_code is carried in `code`.\n      required:\n      - code\n      - message\n      properties:\n        code:\n          type: integer\n          format: int32\n        message:\n          type: string\n    ForkRequest:\n      type: object\n      description: Request body for POST /sandboxes/{sandboxID}/fork.\n      properties:\n        count:\n          type: integer\n          format: int32\n          description: Number of fork sandboxes to derive (1..=100). Defaults to 1 when absent.\n        mode:\n          type:\n          - string\n          - 'null'\n          description: Snapshot artifact mode for the one shared fork snapshot.\n        timeout:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: Optional idle TTL (seconds) applied to each forked sandbox.\n    ForkResult:\n      type: object\n      description: |-\n        One element of a fork response: exactly one of `sandbox` or `error` is\n        present, encoding that fork's independent success/failure.\n      properties:\n        error:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/ForkError'\n        sandbox:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/Sandbox'\n    HashMap:\n      type: object\n      additionalProperties:\n        type: string\n      propertyNames:\n        type: string\n    HealthResponse:\n      type: object\n      required:\n      - status\n      properties:\n        status:\n          type: string\n    ListedSandbox:\n      type: object\n      description: One entry in GET /sandboxes (RunningSandbox in OpenAPI spec).\n      required:\n      - templateID\n      - sandboxID\n      - clientID\n      - startedAt\n      - endAt\n      - cpuCount\n      - memoryMB\n      - state\n      - envdVersion\n      properties:\n        alias:\n          type:\n          - string\n          - 'null'\n        clientID:\n          type: string\n        cpuCount:\n          type: integer\n          format: int32\n        cpuMilli:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: Exact CPU allocation in millicores. Optional for compatibility with older responses.\n        diskSizeMB:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        endAt:\n          type: string\n          format: date-time\n          description: Never-timeout sandboxes serialize a 9999-12-31 sentinel (E2B SDK requires endAt).\n        envdVersion:\n          type: string\n        memoryMB:\n          type: integer\n          format: int32\n          description: Historical field name; the value is memory in MiB.\n        metadata:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/HashMap'\n        restartStatus:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/RestartStatus'\n        sandboxID:\n          type: string\n        startedAt:\n          type: string\n          format: date-time\n        state:\n          $ref: '#/components/schemas/SandboxState'\n        templateID:\n          type: string\n        volumeMounts:\n          type:\n          - array\n          - 'null'\n          items:\n            $ref: '#/components/schemas/SandboxVolumeMount'\n        allowInternetAccess:\n          type:\n          - boolean\n          - 'null'\n          description: Persisted internet-access flag; absent when the spec was not read.\n        endAtStatus:\n          type:\n          - string\n          - 'null'\n          description: '\"deadline\" | \"never\" | \"unknown\"; absent when the backend did not report it.'\n        lifecycle:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/SandboxLifecycleConfig'\n            description: Persisted lifecycle config; absent when the spec was not read.\n        network:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/SandboxNetworkConfigEcho'\n            description: |-\n              Persisted egress config; absent when the spec was not read or when it\n              carried only egress rules (rules never appear on the wire).\n    LivenessHTTPGet:\n      type: object\n      required:\n      - port\n      properties:\n        path:\n          type:\n          - string\n          - 'null'\n        port:\n          type: integer\n          format: int32\n    LivenessProbe:\n      type: object\n      description: One health check. Exactly one of tcp or http.\n      properties:\n        failureThreshold:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        httpGet:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/LivenessHTTPGet'\n        initialDelaySecond:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        periodSecond:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        probeTimeoutSecond:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        tcpSocket:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/LivenessTCP'\n    LivenessTCP:\n      type: object\n      required:\n      - port\n      properties:\n        port:\n          type: integer\n          format: int32\n    LogLevel:\n      type: string\n      enum:\n      - debug\n      - info\n      - warn\n      - error\n    NetworkQosConfig:\n      type: object\n      properties:\n        bandwidthMbps:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          minimum: 1\n        packetsPerSecond:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          minimum: 1\n      additionalProperties: false\n    NewSandbox:\n      type: object\n      description: |-\n        Request body for POST /sandboxes\n        Field names match exactly what the E2B SDK sends.\n        Rule: ID abbreviations → uppercase (templateID, sandboxID, envVars);\n              allow_internet_access is a known SDK snake_case quirk;\n              lifecycle is a nested object — see SandboxLifecycleConfig.\n        `envVars` is the canonical field name; `envs` is accepted as a compatibility\n        alias for E2B SDK callers.\n      required:\n      - templateID\n      properties:\n        allow_internet_access:\n          type:\n          - boolean\n          - 'null'\n          description: SDK sends this as snake_case (known quirk).\n        autoPause:\n          type:\n          - boolean\n          - 'null'\n          description: |-\n            e2b SDK compatibility: the SDK flattens its user-facing `lifecycle`\n            object into top-level `autoPause` / `autoResume` before it hits the\n            wire, so `lifecycle` never arrives from an SDK caller. Ignored when\n            `lifecycle` is present.\n        autoResume:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/SandboxAutoResume'\n            description: See `auto_pause`. Only meaningful alongside `autoPause = true`.\n        backend:\n          type:\n          - string\n          - 'null'\n          description: CoW backend (xfs | s3). Omitted = inherit from the template, else xfs.\n        distributionScope:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n        envVars:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/HashMap'\n        lifecycle:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/SandboxLifecycleConfig'\n            description: |-\n              Sandbox lifecycle configuration. Maps to e2b's `lifecycle` object so\n              callers that already speak e2b can pass through unchanged. Absent\n              (None) means today's behaviour: idle sandboxes are killed.\n        livenessProbe:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/LivenessProbe'\n            description: Runtime health check applied to the sandbox. Times are seconds.\n        mcp:\n          type:\n          - object\n          - 'null'\n          description: |-\n            E2B-compatible MCP servers keyed by server name, e.g.\n            `{\"duckduckgo\": {}, \"arxiv\": {\"storagePath\": \"/\"}}`. Keys starting with\n            `github/<owner>/<repo>` require `runCmd` and may set `installCmd` and\n            `envs`. CubeAPI validates the shape only; the SDK starts `mcp-gateway`\n            inside the sandbox, and the value is never forwarded or returned.\n          additionalProperties:\n            type: object\n          propertyNames:\n            type: string\n        metadata:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/HashMap'\n        network:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/SandboxNetworkConfig'\n        restartBackoff:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/RestartBackoff'\n            description: Optional override of the node restart backoff.\n        restartPolicy:\n          type:\n          - string\n          - 'null'\n          description: Never, OnFailure or Always. Omitted means Never.\n        secure:\n          type:\n          - boolean\n          - 'null'\n        templateID:\n          type: string\n        timeout:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: Optional idle TTL in seconds. See docs/guide/lifecycle.md.\n        volumeMounts:\n          type:\n          - array\n          - 'null'\n          items:\n            $ref: '#/components/schemas/SandboxVolumeMount'\n    NewSandboxV2:\n      allOf:\n      - $ref: '#/components/schemas/NewSandbox'\n      - type: object\n        properties:\n          autoPauseMemory:\n            type:\n            - boolean\n            - 'null'\n            description: |-\n              Keep the full memory snapshot when auto-pausing. Defaults to true.\n              `false` (filesystem-only, cold-boot on resume) is not supported and is\n              rejected by the handler.\n      description: |-\n        Request body for POST /v2/sandboxes (E2B SDK >= 2.51.0).\n\n        Reuses the v1 [`NewSandbox`] shape and adds the v2-only\n        `autoPauseMemory` flag. CubeSandbox always keeps the full memory snapshot\n        on pause, so `autoPauseMemory=false` (filesystem-only snapshot) is rejected\n        by the handler rather than silently ignored.\n    NewVolume:\n      type: object\n      description: |-\n        Request body for POST /volumes.\n\n        `name` must match `^[a-zA-Z0-9_-]+$` and be at most [`MAX_VOLUME_NAME_LEN`] characters\n        (validated in the handler).\n        `driver` selects the Controller Hook Plugin in CubeMaster; omit to use the\n        default plugin configured in CubeMaster.\n      properties:\n        driver:\n          type:\n          - string\n          - 'null'\n          description: |-\n            Plugin/driver to use, e.g. \"nfs\", \"cos\", \"host-mount\".\n            Omit to use CubeMaster's default plugin.\n        name:\n          type: string\n          description: |-\n            Human-readable name for the volume. Optional;\n            if omitted a UUIDv4 is generated and used as both name and volume_id.\n    NewVolumeV2:\n      allOf:\n      - $ref: '#/components/schemas/NewVolume'\n      - type: object\n        properties:\n          private_data:\n            type:\n            - string\n            - 'null'\n            description: |-\n              Opaque input forwarded unchanged to the volume plugin's Create hook.\n              Valid UTF-8, at most 1024 bytes, with no NUL or characters outside the\n              Basic Multilingual Plane. Use credential references, never plaintext\n              credentials. This field is not included in volume responses.\n      description: |-\n        Request body for POST /v2/volumes, extending the legacy creation request\n        with opaque plugin input. Existing /volumes callers keep using NewVolume.\n    NodeComponentEntryView:\n      type: object\n      description: A single component version on a single node, with release declaration membership.\n      required:\n      - component\n      - version\n      - declared\n      properties:\n        component:\n          type: string\n        declared:\n          type: boolean\n        version:\n          type: string\n    NodeConditionView:\n      type: object\n      required:\n      - type\n      - status\n      properties:\n        lastHeartbeatTime:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        message:\n          type: string\n        reason:\n          type: string\n        status:\n          type: string\n        type:\n          type: string\n    NodeResourcesView:\n      type: object\n      required:\n      - cpuMilli\n      - memoryMB\n      properties:\n        cpuMilli:\n          type: integer\n          format: int64\n          description: CPU capacity or availability expressed in millicpu.\n        memoryMB:\n          type: integer\n          format: int64\n          description: Memory in MiB. The MB suffix is retained for API compatibility.\n    NodeVersionRowView:\n      type: object\n      description: Per-node view of the version matrix.\n      required:\n      - nodeID\n      - healthy\n      - components\n      properties:\n        components:\n          type: array\n          items:\n            $ref: '#/components/schemas/NodeComponentEntryView'\n        healthy:\n          type: boolean\n        nodeID:\n          type: string\n    NodeView:\n      type: object\n      required:\n      - nodeID\n      - hostIP\n      - healthy\n      - capacity\n      - allocatable\n      - cpuSaturation\n      - memorySaturation\n      - maxMvmSlots\n      - quotaCpu\n      - quotaMemMB\n      - createConcurrentNum\n      properties:\n        allocatable:\n          $ref: '#/components/schemas/NodeResourcesView'\n        capacity:\n          $ref: '#/components/schemas/NodeResourcesView'\n        conditions:\n          type: array\n          items:\n            $ref: '#/components/schemas/NodeConditionView'\n        cpuSaturation:\n          type: number\n          format: float\n          description: Percentage (0-100) of CPU currently in use.\n        createConcurrentNum:\n          type: integer\n          format: int64\n          description: Max concurrent sandbox-create operations on this node.\n        healthy:\n          type: boolean\n        heartbeatTime:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        hostIP:\n          type: string\n        instanceType:\n          type: string\n        localTemplates:\n          type: array\n          items:\n            type: string\n        maxMvmSlots:\n          type: integer\n          format: int64\n        memorySaturation:\n          type: number\n          format: float\n          description: Percentage (0-100) of memory currently in use.\n        nodeID:\n          type: string\n        quotaCpu:\n          type: integer\n          format: int64\n          description: CPU quota in millicores assigned to this node.\n        quotaMemMB:\n          type: integer\n          format: int64\n          description: Memory quota in MiB assigned to this node.\n        versions:\n          type: array\n          items:\n            $ref: '#/components/schemas/ComponentVersionView'\n    QosConfig:\n      type: object\n      properties:\n        blockIo:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/BlockIoQosConfig'\n        network:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/NetworkQosConfig'\n      additionalProperties: false\n    RebuildTemplateRequest:\n      type: object\n      description: Body for POST /templates/:id (rebuild).\n      additionalProperties: {}\n    RefreshRequest:\n      type: object\n      description: Request body for POST /sandboxes/{id}/refreshes\n      properties:\n        duration:\n          type:\n          - integer\n          - 'null'\n          format: int32\n    RestartBackoff:\n      type: object\n      description: Backoff between sandbox restarts. Zero fields use the node default.\n      properties:\n        initialIntervalSecond:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        jitter:\n          type:\n          - number\n          - 'null'\n          format: double\n          description: 0 or omitted uses the node default (0.1). It does not turn jitter off.\n        maxIntervalSecond:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        maxRestarts:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: 0 means unlimited.\n        multiplier:\n          type:\n          - number\n          - 'null'\n          format: double\n          description: 0 or omitted uses the node default (2). It does not select a constant interval.\n        stableDurationSecond:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: |-\n            Seconds of uninterrupted uptime after which the restart count is\n            reset. Zero or omitted uses the node default (600). The clock starts\n            when the current run starts being up -- on create, on a successful\n            restart, or on resume -- and a failed attempt does not restart it.\n            The reset is applied as soon as the window elapses; it does not wait\n            for the next exit, and it never revives a sandbox that already\n            reached maxRestarts.\n    RestartStatus:\n      type: object\n      description: |-\n        Node-local restart bookkeeping. Separate from `state`, which stays the\n        lifecycle value (`running`, `paused`, …).\n      properties:\n        lastExitCode:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        lastExitReason:\n          type:\n          - string\n          - 'null'\n        lastFailedRestartAt:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        lastRestartAt:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        lastSuccessfulRestartAt:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        nextRestartAt:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        restartCount:\n          type: integer\n          format: int32\n        restartPolicy:\n          type: string\n        restartState:\n          type: string\n    ResumedSandbox:\n      type: object\n      description: Request body for POST /sandboxes/{id}/resume (deprecated).\n      properties:\n        autoPause:\n          type: boolean\n        timeout:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: |-\n            Idle timeout in seconds; None keeps the current value, 0 keeps the\n            current value for this deprecated endpoint, -1 disables expiry, and a\n            positive value starts a new window after resume.\n    RollbackRequest:\n      type: object\n      description: Request body for POST /sandboxes/{id}/rollback.\n      required:\n      - snapshotID\n      properties:\n        backend:\n          type:\n          - string\n          - 'null'\n          description: CoW backend (xfs | s3). Empty means Cubelet uses the snapshot catalog.\n        snapshotID:\n          type: string\n    RollbackResponse:\n      type: object\n      description: Response for POST /sandboxes/{id}/rollback after synchronous completion.\n      required:\n      - sandboxID\n      - snapshotID\n      - operationID\n      - status\n      properties:\n        operationID:\n          type: string\n        sandboxID:\n          type: string\n        snapshotID:\n          type: string\n        status:\n          type: string\n    Sandbox:\n      type: object\n      description: |-\n        Response for POST /sandboxes and POST /sandboxes/{id}/connect.\n        All ID abbreviations uppercase per E2B OpenAPI spec.\n      required:\n      - templateID\n      - sandboxID\n      - clientID\n      - envdVersion\n      properties:\n        alias:\n          type:\n          - string\n          - 'null'\n        clientID:\n          type: string\n        domain:\n          type:\n          - string\n          - 'null'\n        envdAccessToken:\n          type:\n          - string\n          - 'null'\n        envdVersion:\n          type: string\n        sandboxID:\n          type: string\n        templateID:\n          type: string\n        trafficAccessToken:\n          type:\n          - string\n          - 'null'\n    SandboxAutoResume:\n      oneOf:\n      - type: boolean\n      - type: object\n        required:\n        - enabled\n        properties:\n          enabled:\n            type: boolean\n      description: |-\n        Wire shape of the top-level `autoResume` field the e2b SDK sends. Current\n        SDK releases send `{\"enabled\": true}`; older ones and hand-rolled clients\n        send a bare `true`. Both mean the same thing, so accept either rather than\n        rejecting on shape.\n    SandboxDetail:\n      type: object\n      description: Detailed sandbox info returned by GET /sandboxes/{sandboxID}.\n      required:\n      - templateID\n      - sandboxID\n      - clientID\n      - startedAt\n      - endAt\n      - envdVersion\n      - cpuCount\n      - memoryMB\n      - state\n      properties:\n        alias:\n          type:\n          - string\n          - 'null'\n        clientID:\n          type: string\n        configuredQos:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/QosConfig'\n        cpuCount:\n          type: integer\n          format: int32\n        cpuMilli:\n          type:\n          - integer\n          - 'null'\n          format: int32\n          description: Exact CPU allocation in millicores. Optional for compatibility with older responses.\n        diskSizeMB:\n          type:\n          - integer\n          - 'null'\n          format: int32\n        domain:\n          type:\n          - string\n          - 'null'\n        endAt:\n          type: string\n          format: date-time\n          description: Never-timeout sandboxes serialize a 9999-12-31 sentinel (E2B SDK requires endAt).\n        envdAccessToken:\n          type:\n          - string\n          - 'null'\n        envdVersion:\n          type: string\n        errorReason:\n          type: string\n          description: Stored status or exit reason for the primary container. Omitted when unavailable.\n        memoryMB:\n          type: integer\n          format: int32\n          description: Historical field name; the value is memory in MiB.\n        metadata:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/HashMap'\n        restartStatus:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/RestartStatus'\n        sandboxID:\n          type: string\n        startedAt:\n          type: string\n          format: date-time\n        state:\n          $ref: '#/components/schemas/SandboxState'\n        templateID:\n          type: string\n        volumeMounts:\n          type:\n          - array\n          - 'null'\n          items:\n            $ref: '#/components/schemas/SandboxVolumeMount'\n        allowInternetAccess:\n          type:\n          - boolean\n          - 'null'\n          description: Persisted internet-access flag; absent when the spec was not read.\n        endAtStatus:\n          type:\n          - string\n          - 'null'\n          description: '\"deadline\" | \"never\" | \"unknown\"; absent when the backend did not report it.'\n        lifecycle:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/SandboxLifecycleConfig'\n            description: Persisted lifecycle config; absent when the spec was not read.\n        network:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/SandboxNetworkConfigEcho'\n            description: |-\n              Persisted egress config; absent when the spec was not read or when it\n              carried only egress rules (rules never appear on the wire).\n    SandboxLifecycleConfig:\n      type: object\n      description: |-\n        Sandbox lifecycle configuration. Mirrors the e2b SDK's `lifecycle` object —\n        see https://e2b.dev/docs/sandbox/auto-resume for the canonical reference.\n\n        `on_timeout` decides what happens when the sandbox idle timer fires; the\n        historical default is \"kill\" (delete the sandbox) which matches today's\n        behaviour. `auto_resume` only takes effect when `on_timeout = \"pause\"` —\n        it tells the proxy/sidecar to wake a paused sandbox up automatically when\n        activity arrives, instead of returning an error.\n      properties:\n        autoResume:\n          type: boolean\n          description: |-\n            Auto-resume on activity. Defaults to false. Only meaningful when\n            `on_timeout` is set to \"pause\".\n        onTimeout:\n          $ref: '#/components/schemas/SandboxOnTimeout'\n          description: '\"kill\" (default) | \"pause\".'\n    SandboxLog:\n      type: object\n      description: Single raw log line — matches E2B SandboxLog schema (timestamp + line).\n      required:\n      - timestamp\n      - line\n      properties:\n        line:\n          type: string\n        timestamp:\n          type: string\n          format: date-time\n    SandboxLogEntry:\n      type: object\n      description: Structured log entry (v2 logs).\n      required:\n      - timestamp\n      - message\n      - level\n      - fields\n      properties:\n        fields:\n          type: object\n          additionalProperties:\n            type: string\n          propertyNames:\n            type: string\n        level:\n          $ref: '#/components/schemas/LogLevel'\n        message:\n          type: string\n        timestamp:\n          type: string\n          format: date-time\n    SandboxLogs:\n      type: object\n      description: Legacy log response — matches E2B SandboxLogs schema.\n      required:\n      - logs\n      - logEntries\n      properties:\n        logEntries:\n          type: array\n          items:\n            $ref: '#/components/schemas/SandboxLogEntry'\n        logs:\n          type: array\n          items:\n            $ref: '#/components/schemas/SandboxLog'\n    SandboxLogsV2Response:\n      type: object\n      description: v2 log response.\n      required:\n      - logs\n      properties:\n        logs:\n          type: array\n          items:\n            $ref: '#/components/schemas/SandboxLogEntry'\n    SandboxNetworkConfig:\n      type: object\n      description: Network configuration for sandbox egress/ingress control.\n      properties:\n        allowOut:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n        allowPublicTraffic:\n          type:\n          - boolean\n          - 'null'\n        denyOut:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n        maskRequestHost:\n          type:\n          - string\n          - 'null'\n          description: |-\n            Host authority forwarded to user services by CubeProxy. `${PORT}` is\n            expanded to the requested sandbox port; envd traffic is exempt.\n        rules:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/SandboxNetworkRulesInput'\n            description: |-\n              L7 egress rules. Accepts CubeSandbox's ordered rule array and E2B's\n              host-keyed transform map for compatibility. Both are normalized to the\n              ordered internal rule model.\n\n    SandboxNetworkConfigEcho:\n      type: object\n      description: |-\n        Query-response form of [`SandboxNetworkConfig`]. Egress `rules` never\n        appear here — they carry plaintext inject secrets and are scrubbed before\n        a response is built — so the response schema must not declare them.\n      properties:\n        allowOut:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n        allowPublicTraffic:\n          type:\n          - boolean\n          - 'null'\n        denyOut:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n        maskRequestHost:\n          type:\n          - string\n          - 'null'\n        rulesPresent:\n          type:\n          - boolean\n          - 'null'\n          description: |-\n            True when the persisted config carried egress rules, which never\n            appear on the wire (plaintext inject secrets).\n    SandboxNetworkRulesInput:\n      oneOf:\n      - type: array\n        items:\n          $ref: '#/components/schemas/EgressRule'\n      - type: object\n        additionalProperties:\n          type: array\n          items:\n            $ref: '#/components/schemas/E2BNetworkRule'\n        propertyNames:\n          type: string\n      description: |-\n        Accepted wire shapes for `SandboxNetworkConfig.rules`.\n\n        CubeSandbox clients use the ordered rule array. E2B clients use a\n        host-keyed map whose values are request transforms. CubeAPI normalizes both\n        shapes into the internal ordered egress-rule model.\n    SandboxOnTimeout:\n      type: string\n      enum:\n      - kill\n      - pause\n    SandboxState:\n      type: string\n      description: State of the sandbox (running | paused | pausing | unknown)\n      enum:\n      - running\n      - paused\n      - pausing\n      - unknown\n    SandboxVolumeMount:\n      type: object\n      description: Volume mount inside the sandbox.\n      required:\n      - name\n      - path\n      properties:\n        name:\n          type: string\n        path:\n          type: string\n        readOnly:\n          type: boolean\n          description: |-\n            CubeSandbox extension: mount this volume read-only for this sandbox\n            attachment. Defaults to false when omitted.\n    SetTemplateAliasRequest:\n      type: object\n      description: |-\n        Body for PUT /templates/:id/alias (set / modify / clear alias).\n\n        `alias` is `None` / null / empty string ⇒ clear the current alias.\n        A non-empty value is validated by CubeMaster's `validateTemplateAlias`\n        (the single source of truth; CubeAPI does not re-validate).\n      properties:\n        alias:\n          type:\n          - string\n          - 'null'\n    SetTimeoutRequest:\n      type: object\n      description: Request body for POST /sandboxes/{id}/timeout\n      required:\n      - timeout\n      properties:\n        timeout:\n          type: integer\n          format: int32\n    SnapshotInfo:\n      type: object\n      description: Response for POST /sandboxes/{id}/snapshots.\n      required:\n      - snapshotID\n      - names\n      - mode\n      properties:\n        expiresAt:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        backend:\n          type:\n          - string\n          - 'null'\n          description: CoW backend that produced this snapshot (xfs | s3).\n        mode:\n          $ref: '#/components/schemas/SnapshotMode'\n          description: Snapshot artifact mode. Always one of full | fs-only.\n        names:\n          type: array\n          items:\n            type: string\n        remoteStatus:\n          type:\n          - string\n          - 'null'\n          description: S3 sync status (pending|running|ready|failed). Empty for xfs.\n        snapshotID:\n          type: string\n    SnapshotListItem:\n      type: object\n      description: One entry in the GET /snapshots list.\n      required:\n      - snapshotID\n      - names\n      - status\n      - mode\n      properties:\n        expiresAt:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        backend:\n          type:\n          - string\n          - 'null'\n          description: CoW backend that produced this snapshot (xfs | s3).\n        createdAt:\n          type:\n          - string\n          - 'null'\n          format: date-time\n        mode:\n          $ref: '#/components/schemas/SnapshotMode'\n          description: Snapshot artifact mode. Always one of full | fs-only.\n        names:\n          type: array\n          items:\n            type: string\n        originSandboxID:\n          type:\n          - string\n          - 'null'\n        remoteStatus:\n          type:\n          - string\n          - 'null'\n          description: S3 sync status (pending|running|ready|failed). Empty for xfs.\n        snapshotID:\n          type: string\n        status:\n          type: string\n        updatedAt:\n          type:\n          - string\n          - 'null'\n          format: date-time\n    SnapshotMode:\n      type: string\n      description: Canonical snapshot artifact mode.\n      enum:\n      - full\n      - fs-only\n    TemplateAliasLookupResponse:\n      type: object\n      required:\n      - templateID\n      - public\n      properties:\n        public:\n          type: boolean\n        templateID:\n          type: string\n    TemplateBuildJob:\n      type: object\n      description: Job envelope returned by create / rebuild.\n      required:\n      - jobID\n      - templateID\n      - status\n      - phase\n      - progress\n      properties:\n        errorMessage:\n          type: string\n        jobID:\n          type: string\n        phase:\n          type: string\n        progress:\n          type: integer\n          format: int32\n        status:\n          type: string\n        templateID:\n          type: string\n    TemplateBuildStatus:\n      type: object\n      description: Response for GET /templates/:id/builds/:bid/status\n      required:\n      - buildID\n      - templateID\n      - status\n      - progress\n      - message\n      properties:\n        buildID:\n          type: string\n        message:\n          type: string\n        progress:\n          type: integer\n          format: int32\n        status:\n          type: string\n        templateID:\n          type: string\n    TemplateCompatAdoptResponseView:\n      type: object\n      required:\n      - updated\n      properties:\n        updated:\n          type: integer\n          format: int32\n    TemplateCompatMatrixView:\n      type: object\n      required:\n      - summary\n      - templates\n      properties:\n        summary:\n          $ref: '#/components/schemas/TemplateCompatSummaryView'\n        templates:\n          type: array\n          items:\n            $ref: '#/components/schemas/TemplateCompatRowView'\n    TemplateCompatRowView:\n      type: object\n      required:\n      - templateID\n      - overall\n      - nodes\n      properties:\n        instanceType:\n          type:\n          - string\n          - 'null'\n        nodes:\n          type: array\n          items:\n            $ref: '#/components/schemas/TemplateNodeCompatView'\n        overall:\n          type: string\n        templateID:\n          type: string\n    TemplateCompatSummaryView:\n      type: object\n      required:\n      - staleTemplates\n      - staleReplicas\n      - affectedNodes\n      - missingReplicas\n      - unknownReplicas\n      properties:\n        affectedNodes:\n          type: integer\n          format: int32\n        missingReplicas:\n          type: integer\n          format: int32\n        staleReplicas:\n          type: integer\n          format: int32\n        staleTemplates:\n          type: integer\n          format: int32\n        unknownReplicas:\n          type: integer\n          format: int32\n    TemplateDetail:\n      type: object\n      description: Detailed template response (GET /templates/:id).\n      required:\n      - templateID\n      - public\n      - status\n      - replicas\n      - aliases\n      properties:\n        aliases:\n          type: array\n          items:\n            type: string\n          description: |-\n            E2B template aliases. CubeSandbox has no namespace model, so this\n            mirrors the stable alias when one is configured.\n        allowInternetAccess:\n          type:\n          - boolean\n          - 'null'\n          description: Whether public internet access is allowed for sandboxes from this template.\n        configuredQos:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/QosConfig'\n        createRequest: {}\n        createdAt:\n          type:\n          - string\n          - 'null'\n        instanceType:\n          type:\n          - string\n          - 'null'\n        jobID:\n          type:\n          - string\n          - 'null'\n          description: Latest create/rebuild job id for the template.\n        lastError:\n          type:\n          - string\n          - 'null'\n        networkType:\n          type:\n          - string\n          - 'null'\n          description: Network type used when the template was created, e.g. \"tap\".\n        public:\n          type: boolean\n        replicas:\n          type: array\n          items: {}\n        status:\n          type: string\n        templateID:\n          type: string\n        version:\n          type:\n          - string\n          - 'null'\n    TemplateLifecycle:\n      type: object\n      properties:\n        postStart:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/TemplateLifecycleHook'\n            description: |-\n              Runs before a newly created sandbox becomes ready. Failure or timeout\n              aborts creation. All containers in the sandbox share a 10-second hook\n              execution budget.\n        preStop:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/TemplateLifecycleHook'\n            description: |-\n              Runs during graceful deletion and shares up to 5 seconds with graceful\n              shutdown. Failures are logged and deletion continues.\n      additionalProperties: false\n    TemplateLifecycleExec:\n      type: object\n      required:\n      - command\n      properties:\n        command:\n          type: array\n          items:\n            type: string\n          description: Executable and arguments. No shell is added implicitly.\n          minItems: 1\n      additionalProperties: false\n    TemplateLifecycleHook:\n      type: object\n      required:\n      - exec\n      properties:\n        exec:\n          $ref: '#/components/schemas/TemplateLifecycleExec'\n      additionalProperties: false\n    TemplateNodeCompatView:\n      type: object\n      required:\n      - nodeID\n      - compatStatus\n      properties:\n        boundAgentVersion:\n          type:\n          - string\n          - 'null'\n        boundGuestImageVersion:\n          type:\n          - string\n          - 'null'\n        boundKernelVersion:\n          type:\n          - string\n          - 'null'\n        compatStatus:\n          type: string\n        currentAgentVersion:\n          type:\n          - string\n          - 'null'\n        currentGuestImageVersion:\n          type:\n          - string\n          - 'null'\n        currentKernelVersion:\n          type:\n          - string\n          - 'null'\n        nodeID:\n          type: string\n        nodeIP:\n          type:\n          - string\n          - 'null'\n    TemplateSummary:\n      type: object\n      description: Summary row returned by GET /templates.\n      required:\n      - templateID\n      - public\n      - status\n      - aliases\n      properties:\n        aliases:\n          type: array\n          items:\n            type: string\n          description: |-\n            E2B template aliases. CubeSandbox has no namespace model, so this\n            mirrors the stable alias when one is configured.\n        createdAt:\n          type:\n          - string\n          - 'null'\n        imageInfo:\n          type:\n          - string\n          - 'null'\n        instanceType:\n          type:\n          - string\n          - 'null'\n        jobID:\n          type:\n          - string\n          - 'null'\n          description: Latest create/rebuild job id for the template.\n        lastError:\n          type:\n          - string\n          - 'null'\n        public:\n          type: boolean\n        status:\n          type: string\n        templateID:\n          type: string\n        version:\n          type:\n          - string\n          - 'null'\n    UpdateSandboxNetworkRequest:\n      type: object\n      description: |-\n        Request body for PUT /sandboxes/{id}/network.\n\n        The body is the complete desired egress policy, not a patch: any field left\n        out clears what the sandbox currently has.\n\n        The policy fields sit at the top level rather than under `network`, matching\n        E2B's update endpoint so a client written against either SDK reaches the same\n        wire format. Note this is deliberately *not* the shape of our own create body\n        (which nests them, as E2B's create also does) -- the inconsistency is\n        upstream's, and following it costs less than making E2B clients silently\n        apply an empty policy.\n\n        `allowPublicTraffic` and `maskRequestHost` are CubeSandbox extensions; E2B's\n        update schema carries neither.\n\n        Unknown fields are rejected. Under full-replacement semantics a key that fails\n        to match is indistinguishable from one deliberately left out, so a typo like\n        `allowOu` would clear that policy dimension and answer 204 -- and combined with\n        an omitted `allowInternetAccess` it reopens egress the caller was restricting.\n        Failing the request is the only outcome that cannot be mistaken for success.\n        E2B's own update body carries only `allowOut`, `denyOut`, `rules` and\n        `allowInternetAccess`, all accepted here, so strictness costs no compatibility.\n      properties:\n        allowInternetAccess:\n          type:\n          - boolean\n          - 'null'\n        allowOut:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n        allowPublicTraffic:\n          type:\n          - boolean\n          - 'null'\n        denyOut:\n          type:\n          - array\n          - 'null'\n          items:\n            type: string\n        maskRequestHost:\n          type:\n          - string\n          - 'null'\n        rules:\n          oneOf:\n          - type: 'null'\n          - $ref: '#/components/schemas/EgressRulesInput'\n      additionalProperties: false\n    VersionMatrixView:\n      type: object\n      description: Full node x component version matrix.\n      required:\n      - controlPlane\n      - components\n      - nodes\n      properties:\n        components:\n          type: array\n          items:\n            $ref: '#/components/schemas/ComponentMatrixRowView'\n        controlPlane:\n          $ref: '#/components/schemas/ControlPlaneVersionView'\n        nodes:\n          type: array\n          items:\n            $ref: '#/components/schemas/NodeVersionRowView'\n    Volume:\n      type: object\n      description: Volume descriptor returned in list responses (no token).\n      required:\n      - volumeID\n      - name\n      properties:\n        name:\n          type: string\n        volumeID:\n          type: string\n    VolumeAndToken:\n      type: object\n      description: |-\n        Volume descriptor with auth token — returned on create.\n        E2B SDK requires `token` to always be present (non-optional); use empty\n        string when the plugin does not return a token.\n      required:\n      - volumeID\n      - name\n      properties:\n        name:\n          type: string\n        token:\n          type: string\n          description: Auth token returned by the volume plugin. Empty string when not applicable.\n        volumeID:\n          type: string\n    VolumeDetails:\n      type: object\n      description: Single-volume GET response, including admission state when supplied by CubeMaster.\n      required:\n      - volumeID\n      - name\n      - token\n      properties:\n        deleting:\n          type:\n          - boolean\n          - 'null'\n        in_flight_creates:\n          type:\n          - integer\n          - 'null'\n          format: int64\n        name:\n          type: string\n        token:\n          type: string\n        volumeID:\n          type: string\n  securitySchemes:\n    apiKeyAuth:\n      type: apiKey\n      in: header\n      name: X-API-Key\n    bearerAuth:\n      type: http\n      scheme: bearer\n      bearerFormat: JWT\ntags:\n- name: health\n  description: Health and liveness\n- name: templates\n  description: Template catalog\n- name: sandboxes\n  description: Sandbox lifecycle and logs\n- name: snapshots\n  description: Sandbox snapshots\n- name: volumes\n  description: Persistent volumes\n"}