openapi: 3.1.0
info:
  title: E2B API
  version: 0.1.0
  description: Complete E2B developer API. Platform endpoints are served on api.e2b.app.
    Sandbox endpoints (envd) are served on the shared sandbox host (sandbox.e2b.app);
    target a specific sandbox with the E2b-Sandbox-Id and E2b-Sandbox-Port headers.
servers:
- &id001
  url: https://api.e2b.app
  description: E2B Platform API
paths:
  /sandboxes:
    get:
      summary: List sandboxes
      description: List all running sandboxes. Use GET /v2/sandboxes instead.
      deprecated: true
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - name: metadata
        in: query
        description: Metadata query used to filter the sandboxes (e.g. "user=abc&app=prod").
          Each key and values must be URL encoded.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Successfully returned all running sandboxes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ListedSandbox'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      operationId: listSandboxes
    post:
      summary: Create sandbox
      description: Create a sandbox from the template
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewSandbox'
      responses:
        '201':
          description: The sandbox was created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sandbox'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
        '504':
          $ref: '#/components/responses/504'
      operationId: postSandboxes
    servers:
    - *id001
  /v2/sandboxes:
    get:
      summary: List sandboxes (v2)
      description: List all sandboxes
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - name: metadata
        in: query
        description: Metadata query used to filter the sandboxes (e.g. "user=abc&app=prod").
          Each key and values must be URL encoded.
        required: false
        schema:
          type: string
      - name: state
        in: query
        description: Filter sandboxes by one or more states
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/SandboxState'
        style: form
        explode: false
      - name: order
        in: query
        description: Sort direction by sandbox start time. Defaults to desc (newest
          first).
        required: false
        schema:
          $ref: '#/components/schemas/OrderDirection'
      - name: startedAfter
        in: query
        description: Return sandboxes started at or after this timestamp.
        required: false
        schema:
          type: string
          format: date-time
      - name: template
        in: query
        description: Filter sandboxes by a template ID or alias.
        required: false
        schema:
          type: string
      - $ref: '#/components/parameters/paginationNextToken'
      - $ref: '#/components/parameters/paginationLimit'
      responses:
        '200':
          description: Successfully returned all running sandboxes
          headers:
            X-Next-Token:
              $ref: '#/components/headers/XNextToken'
            X-Total-Running:
              $ref: '#/components/headers/XTotalRunning'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ListedSandbox'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      operationId: listSandboxesV2
    servers:
    - *id001
  /sandboxes/metrics:
    get:
      summary: List sandbox metrics
      description: List metrics for given sandboxes
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - name: sandbox_ids
        in: query
        required: true
        description: Comma-separated list of sandbox IDs to get metrics for
        explode: false
        schema:
          type: array
          items:
            type: string
          maxItems: 100
          uniqueItems: true
      responses:
        '200':
          description: Successfully returned all running sandboxes with metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxesWithMetrics'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      operationId: listSandboxesMetrics
    servers:
    - *id001
  /sandboxes/{sandboxID}/logs:
    get:
      summary: Get sandbox logs
      description: Get sandbox logs. Use /v2/sandboxes/{sandboxID}/logs instead.
      deprecated: true
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      - in: query
        name: start
        schema:
          type: integer
          format: int64
          minimum: 0
        description: Starting timestamp of the logs that should be returned in milliseconds
      - in: query
        name: limit
        schema:
          default: 1000
          format: int32
          minimum: 0
          type: integer
        description: Maximum number of logs that should be returned
      responses:
        '200':
          description: Successfully returned the sandbox logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxLogs'
        '404':
          $ref: '#/components/responses/404'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: getSandboxLogs
    servers:
    - *id001
  /v2/sandboxes/{sandboxID}/logs:
    get:
      summary: Get sandbox logs (v2)
      description: Get sandbox logs
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      - in: query
        name: cursor
        schema:
          type: integer
          format: int64
          minimum: 0
        description: Starting timestamp of the logs that should be returned in milliseconds
      - in: query
        name: limit
        schema:
          default: 1000
          type: integer
          format: int32
          minimum: 0
          maximum: 1000
        description: Maximum number of logs that should be returned
      - in: query
        name: direction
        schema:
          $ref: '#/components/schemas/LogsDirection'
        description: Direction of the logs that should be returned
      - in: query
        name: level
        schema:
          $ref: '#/components/schemas/LogLevel'
        description: Minimum log level to return. Logs below this level are excluded
      - in: query
        name: search
        schema:
          type: string
          maxLength: 256
        description: Case-sensitive substring match on log message content
      responses:
        '200':
          description: Successfully returned the sandbox logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxLogsV2Response'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: getSandboxLogsV2
    servers:
    - *id001
  /sandboxes/{sandboxID}:
    get:
      summary: Get sandbox
      description: Get a sandbox by id
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      responses:
        '200':
          description: Successfully returned the sandbox
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxDetail'
        '404':
          $ref: '#/components/responses/404'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: getSandbox
    delete:
      summary: Delete sandbox
      description: Kill a sandbox
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      responses:
        '204':
          description: The sandbox was killed successfully
        '404':
          $ref: '#/components/responses/404'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: deleteSandbox
    servers:
    - *id001
  /sandboxes/{sandboxID}/metrics:
    get:
      summary: Get sandbox metrics
      description: Get sandbox metrics
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      - in: query
        name: start
        schema:
          type: integer
          format: int64
          minimum: 0
        description: Unix timestamp for the start of the interval, in seconds, for
          which the metrics are returned.
      - in: query
        name: end
        schema:
          type: integer
          format: int64
          minimum: 0
        description: Unix timestamp for the end of the interval, in seconds, for which
          the metrics are returned.
      responses:
        '200':
          description: Successfully returned the sandbox metrics
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SandboxMetric'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: getSandboxMetrics
    servers:
    - *id001
  /sandboxes/{sandboxID}/pause:
    post:
      summary: Pause sandbox
      description: Pause the sandbox
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxPauseRequest'
      responses:
        '204':
          description: The sandbox was paused successfully and can be resumed
        '409':
          $ref: '#/components/responses/409'
        '404':
          $ref: '#/components/responses/404'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: postSandboxPause
    servers:
    - *id001
  /sandboxes/{sandboxID}/resume:
    post:
      summary: Resume sandbox
      deprecated: true
      description: Resume the sandbox
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResumedSandbox'
      responses:
        '201':
          description: The sandbox was resumed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sandbox'
        '409':
          $ref: '#/components/responses/409'
        '404':
          $ref: '#/components/responses/404'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
        '504':
          $ref: '#/components/responses/504'
      operationId: postSandboxResume
    servers:
    - *id001
  /sandboxes/{sandboxID}/fork:
    post:
      summary: Fork sandbox
      description: 'Fork the sandbox: checkpoint the running sandbox in place (it
        is briefly paused, snapshotted with its full memory state, and resumed on
        its node, keeping its ID and expiration untouched) and create count new sandboxes
        from that snapshot. Returns one result per requested fork, each carrying either
        the created sandbox or the error that prevented it from starting. A non-201
        status means the request failed before any fork was attempted.'
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxForkRequest'
      responses:
        '201':
          description: The sandbox was snapshotted and the forks were attempted; each
            entry reports one fork's outcome
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SandboxForkResult'
        '409':
          $ref: '#/components/responses/409'
        '404':
          $ref: '#/components/responses/404'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
      operationId: postSandboxFork
    servers:
    - *id001
  /sandboxes/{sandboxID}/connect:
    post:
      summary: Connect to sandbox
      description: Returns sandbox details. If the sandbox is paused, it will be resumed.
        TTL is only extended.
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectSandbox'
      responses:
        '200':
          description: The sandbox was already running
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sandbox'
        '201':
          description: The sandbox was resumed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sandbox'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
        '504':
          $ref: '#/components/responses/504'
      operationId: postSandboxConnect
    servers:
    - *id001
  /sandboxes/{sandboxID}/timeout:
    post:
      summary: Set sandbox timeout
      description: Set the timeout for the sandbox. The sandbox will expire x seconds
        from the time of the request. Calling this method multiple times overwrites
        the TTL, each time using the current timestamp as the starting point to measure
        the timeout duration.
      security:
      - ApiKeyAuth: []
      tags:
      - Sandboxes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxTimeoutRequest'
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      responses:
        '204':
          description: Successfully set the sandbox timeout
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: postSandboxTimeout
    servers:
    - *id001
  /sandboxes/{sandboxID}/network:
    put:
      summary: Update sandbox network
      description: Update the network configuration for a running sandbox. Replaces
        the current egress rules with the provided configuration. Omitting field clears
        it.
      security:
      - ApiKeyAuth: []
      tags:
      - Sandboxes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxNetworkUpdateConfig'
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      responses:
        '204':
          description: Successfully updated the sandbox network configuration
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      operationId: putSandboxNetwork
    servers:
    - *id001
  /sandboxes/{sandboxID}/refreshes:
    post:
      summary: Refresh sandbox
      description: Refresh the sandbox extending its time to live
      security:
      - ApiKeyAuth: []
      tags:
      - Sandboxes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxRefreshRequest'
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      responses:
        '204':
          description: Successfully refreshed the sandbox
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: postSandboxRefreshes
    servers:
    - *id001
  /sandboxes/{sandboxID}/snapshots:
    post:
      summary: Create snapshot
      description: Create a persistent snapshot from the sandbox's current state.
        Snapshots can be used to create new sandboxes and persist beyond the original
        sandbox's lifetime.
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/sandboxID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxSnapshotRequest'
      responses:
        '201':
          description: Snapshot created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnapshotInfo'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: postSandboxSnapshots
    servers:
    - *id001
  /snapshots:
    get:
      summary: List snapshots
      description: List all snapshots for the team
      tags:
      - Sandboxes
      security:
      - ApiKeyAuth: []
      parameters:
      - name: sandboxID
        in: query
        required: false
        schema:
          type: string
          description: Filter snapshots by source sandbox ID
      - name: name
        in: query
        description: Filter snapshots by name or ID, optionally tag-qualified (e.g.
          "my-snapshot", "my-team/my-snapshot" or "my-snapshot:v1").
        required: false
        schema:
          type: string
      - $ref: '#/components/parameters/paginationLimit'
      - $ref: '#/components/parameters/paginationNextToken'
      responses:
        '200':
          description: Successfully returned snapshots
          headers:
            X-Next-Token:
              $ref: '#/components/headers/XNextToken'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SnapshotInfo'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: listSnapshots
    servers:
    - *id001
  /v3/templates:
    post:
      summary: Create template (v3)
      description: Create a new template
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateBuildRequestV3'
      responses:
        '202':
          description: The build was requested successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateRequestResponseV3'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      operationId: postTemplatesV3
    servers:
    - *id001
  /v2/templates:
    get:
      summary: List templates (v2)
      description: List all templates
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - in: query
        required: false
        name: teamID
        schema:
          type: string
          description: Identifier of the team
      - $ref: '#/components/parameters/paginationNextToken'
      - $ref: '#/components/parameters/paginationLimit'
      responses:
        '200':
          description: Successfully returned all templates
          headers:
            X-Next-Token:
              $ref: '#/components/headers/XNextToken'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Template'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      operationId: listTemplatesV2
    post:
      summary: Create template (v2)
      description: Create a new template
      deprecated: true
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateBuildRequestV2'
      responses:
        '202':
          description: The build was requested successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateLegacy'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: postTemplatesV2
    servers:
    - *id001
  /templates/{templateID}/files/{hash}:
    get:
      summary: Get build upload link
      description: Get an upload link for a tar file containing build layer files
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      - in: path
        name: hash
        required: true
        schema:
          type: string
          description: Hash of the files
      responses:
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '200':
          description: Upload link for the tar file containing build layer files
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateBuildFileUpload'
      operationId: getTemplateFile
    servers:
    - *id001
  /templates:
    get:
      summary: List templates
      description: List all templates
      deprecated: true
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - in: query
        required: false
        name: teamID
        schema:
          type: string
          description: Identifier of the team
      responses:
        '200':
          description: Successfully returned all templates
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Template'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: listTemplates
    post:
      summary: Create template
      description: Create a new template
      deprecated: true
      tags:
      - Templates
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateBuildRequest'
      responses:
        '202':
          description: The build was accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateLegacy'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: postTemplates
    servers:
    - *id001
  /templates/{templateID}:
    get:
      summary: Get template
      description: List all builds for a template
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      - $ref: '#/components/parameters/paginationNextToken'
      - $ref: '#/components/parameters/paginationLimit'
      responses:
        '200':
          description: Successfully returned the template with its builds
          headers:
            X-Next-Token:
              $ref: '#/components/headers/XNextToken'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateWithBuilds'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: getTemplate
    post:
      summary: Rebuild template
      description: Rebuild an template
      deprecated: true
      tags:
      - Templates
      security: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateBuildRequest'
      responses:
        '202':
          description: The build was accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateLegacy'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: postTemplate
    delete:
      summary: Delete template
      description: Delete a template
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      responses:
        '204':
          description: The template was deleted successfully
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: deleteTemplate
    patch:
      summary: Update template
      description: Update template
      deprecated: true
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateUpdateRequest'
      responses:
        '200':
          description: The template was updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateUpdateResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: patchTemplate
    servers:
    - *id001
  /templates/{templateID}/builds/{buildID}:
    post:
      summary: Start build
      description: Start the build
      deprecated: true
      tags:
      - Templates
      security: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      - $ref: '#/components/parameters/buildID'
      responses:
        '202':
          description: The build has started
          content: &id002
            application/json:
              schema:
                type: object
                description: Empty response
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: postTemplateBuild
    servers:
    - *id001
  /v2/templates/{templateID}/builds/{buildID}:
    post:
      summary: Start build (v2)
      description: Start the build
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      - $ref: '#/components/parameters/buildID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateBuildStartV2'
      responses:
        '202':
          description: The build has started
          content: *id002
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: postTemplateBuildV2
    servers:
    - *id001
  /v2/templates/{templateID}:
    patch:
      summary: Update template (v2)
      description: Update template
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateUpdateRequest'
      responses:
        '200':
          description: The template was updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateUpdateResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: patchTemplateV2
    servers:
    - *id001
  /templates/{templateID}/builds/{buildID}/status:
    get:
      summary: Get build status
      description: Get template build info
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      - $ref: '#/components/parameters/buildID'
      - in: query
        name: logsOffset
        schema:
          default: 0
          type: integer
          format: int32
          minimum: 0
        description: Index of the starting build log that should be returned with
          the template
      - in: query
        name: limit
        schema:
          default: 100
          type: integer
          format: int32
          minimum: 0
          maximum: 100
        description: Maximum number of logs that should be returned
      - in: query
        name: level
        schema:
          $ref: '#/components/schemas/LogLevel'
      responses:
        '200':
          description: Successfully returned the template
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateBuildInfo'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: getTemplateBuildStatus
    servers:
    - *id001
  /templates/{templateID}/builds/{buildID}/logs:
    get:
      summary: Get build logs
      description: Get template build logs
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      - $ref: '#/components/parameters/buildID'
      - in: query
        name: cursor
        schema:
          type: integer
          format: int64
          minimum: 0
        description: Starting timestamp of the logs that should be returned in milliseconds
      - in: query
        name: limit
        schema:
          default: 100
          type: integer
          format: int32
          minimum: 0
          maximum: 100
        description: Maximum number of logs that should be returned
      - in: query
        name: direction
        schema:
          $ref: '#/components/schemas/LogsDirection'
      - in: query
        name: level
        schema:
          $ref: '#/components/schemas/LogLevel'
      - in: query
        name: source
        schema:
          $ref: '#/components/schemas/LogsSource'
        description: Source of the logs that should be returned from
      responses:
        '200':
          description: Successfully returned the template build logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateBuildLogsResponse'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: getTemplateBuildLogs
    servers:
    - *id001
  /templates/aliases/{alias}:
    get:
      summary: Get template by alias
      description: Check if template with given alias exists
      tags:
      - Templates
      security:
      - ApiKeyAuth: []
      parameters:
      - name: alias
        in: path
        required: true
        schema:
          type: string
          description: Template alias
      responses:
        '200':
          description: Successfully queried template by alias
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateAliasResponse'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: getTemplatesAlias
    servers:
    - *id001
  /templates/tags:
    post:
      summary: Assign tags
      description: Assign tag(s) to a template build
      tags:
      - Tags
      security:
      - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignTemplateTagsRequest'
      responses:
        '201':
          description: Tag assigned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssignedTemplateTags'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: postTemplatesTags
    delete:
      summary: Delete tags
      description: Delete multiple tags from templates
      tags:
      - Tags
      security:
      - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteTemplateTagsRequest'
      responses:
        '204':
          description: Tags deleted successfully
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: deleteTemplatesTags
    servers:
    - *id001
  /templates/{templateID}/tags:
    get:
      summary: List template tags
      description: List all tags for a template
      tags:
      - Tags
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/templateID'
      responses:
        '200':
          description: Successfully returned the template tags
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TemplateTag'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: getTemplateTags
    servers:
    - *id001
  /volumes:
    get:
      summary: List team volumes
      description: List all team volumes
      tags:
      - Volumes
      security:
      - ApiKeyAuth: []
      responses:
        '200':
          description: Successfully listed all team volumes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Volume'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: listVolumes
    post:
      summary: Create team volume
      description: Create a new team volume
      tags:
      - Volumes
      security:
      - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewVolume'
      responses:
        '201':
          description: Successfully created a new team volume
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VolumeAndToken'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: postVolumes
    servers:
    - *id001
  /volumes/{volumeID}:
    get:
      summary: Team volume
      description: Get team volume info
      tags:
      - Volumes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/volumeID'
      responses:
        '200':
          description: Successfully retrieved a team volume
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VolumeAndToken'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: getVolume
    delete:
      summary: Delete team volume
      description: Delete a team volume
      tags:
      - Volumes
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/volumeID'
      responses:
        '204':
          description: Successfully deleted a team volume
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      operationId: deleteVolume
    servers:
    - *id001
  /health:
    get:
      summary: Check the health of the service
      responses:
        '204':
          description: The service is healthy
        '502': &id003
          description: Sandbox not found
          content:
            application/json:
              schema:
                type: object
                required:
                - sandboxID
                - message
                - code
                properties:
                  message:
                    type: string
                    description: Error message
                  code:
                    type: integer
                    description: Error code
                  sandboxID:
                    type: string
                    description: Identifier of the sandbox
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      operationId: getHealth
      security: []
      tags:
      - Envd
    servers:
    - &id004
      url: https://sandbox.{domain}
      description: Sandbox API (envd) - runs inside each sandbox
      variables:
        domain:
          default: e2b.app
          description: E2B domain
  /metrics:
    get:
      summary: Service stats
      security:
      - &id005
        SandboxAccessTokenAuth: []
      responses:
        '200':
          description: The resource usage metrics of the service
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metrics'
        '502': *id003
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      operationId: getMetrics
      tags:
      - Envd
    servers:
    - *id004
  /envs:
    get:
      summary: Environment variables
      security:
      - *id005
      responses:
        '200':
          description: Environment variables
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvVars'
        '502': *id003
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      operationId: getEnvVars
      tags:
      - Envd
    servers:
    - *id004
  /files:
    get:
      summary: Download a file
      tags:
      - Filesystem
      security:
      - *id005
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - $ref: '#/components/parameters/FilePath'
      - $ref: '#/components/parameters/User'
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/SignatureExpiration'
      responses:
        '200':
          description: Entire file downloaded successfully.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
                description: The raw file content
        '400':
          description: Invalid path
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: path '/home/user/docs' is a directory
                code: 400
        '401':
          description: Invalid user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: 'error looking up user ''nonexistent'': user: unknown user
                  nonexistent'
                code: 401
        '404':
          description: File not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: path '/home/user/missing.txt' does not exist
                code: 404
        '406':
          description: Requested encoding is not supported
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: 'no acceptable encoding found, supported: [identity, gzip]'
                code: 406
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: 'error opening file ''/home/user/file.txt'': permission denied'
                code: 500
        '502': *id003
      operationId: downloadFile
    post:
      summary: Upload a file and ensure the parent directories exist. If the file
        exists, it will be overwritten.
      description: 'Any request header of the form `X-Metadata-<key>: <value>` is
        persisted

        as a user-defined extended attribute on the uploaded file. The

        `X-Metadata-` prefix is stripped and the remaining header name is

        lowercased to form the metadata key; the resulting map is returned on

        `EntryInfo` lookups (e.g. `Stat`, `ListDir`).


        Each upload replaces the file''s metadata with the keys provided in

        that request: keys previously stored but absent from the new request

        are removed, and an upload that sends no `X-Metadata-*` header clears

        all existing metadata.


        Both keys and values must be printable US-ASCII (bytes `0x20`-`0x7E`)

        and are rejected with HTTP 400 otherwise. Each key is capped at 246

        bytes (the Linux VFS xattr-name limit minus the namespace prefix), and

        the combined size of all metadata on a file (keys plus values, with the

        namespace prefix counted per key) is capped at 4096 bytes to stay within

        the filesystem''s per-inode xattr budget. Multiple files in a single

        multipart upload receive the same metadata. If the same

        `X-Metadata-<key>` header is sent more than once, only the first

        value is used.

        '
      tags:
      - Filesystem
      security:
      - *id005
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - $ref: '#/components/parameters/FilePath'
      - $ref: '#/components/parameters/User'
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/SignatureExpiration'
      requestBody:
        $ref: '#/components/requestBodies/File'
      responses:
        '200':
          description: The file was uploaded successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EntryInfo'
              example:
              - path: /home/user/hello.txt
                name: hello.txt
                type: file
        '400':
          description: Invalid path
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: path '/home/user/docs' is a directory
                code: 400
        '401':
          description: Invalid user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: 'error looking up user ''nonexistent'': user: unknown user
                  nonexistent'
                code: 401
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: 'error opening file ''/home/user/file.txt'': permission denied'
                code: 500
        '507':
          description: Not enough disk space
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: not enough disk space available
                code: 507
        '502': *id003
      operationId: uploadFile
    servers:
    - *id004
  /filesystem.Filesystem/CreateWatcher:
    post:
      tags:
      - Filesystem
      summary: CreateWatcher
      description: Non-streaming versions of WatchDir
      operationId: filesystem.Filesystem.CreateWatcher
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/filesystem.CreateWatcherRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/filesystem.CreateWatcherResponse'
        '502': *id003
      security:
      - SandboxAccessTokenAuth: []
        SandboxUserAuth: []
    servers:
    - *id004
  /filesystem.Filesystem/GetWatcherEvents:
    post:
      tags:
      - Filesystem
      summary: GetWatcherEvents
      operationId: filesystem.Filesystem.GetWatcherEvents
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/filesystem.GetWatcherEventsRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/filesystem.GetWatcherEventsResponse'
        '502': *id003
      security:
      - *id005
    servers:
    - *id004
  /filesystem.Filesystem/ListDir:
    post:
      tags:
      - Filesystem
      summary: ListDir
      operationId: filesystem.Filesystem.ListDir
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/filesystem.ListDirRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/filesystem.ListDirResponse'
        '502': *id003
      security:
      - SandboxAccessTokenAuth: []
        SandboxUserAuth: []
    servers:
    - *id004
  /filesystem.Filesystem/MakeDir:
    post:
      tags:
      - Filesystem
      summary: MakeDir
      operationId: filesystem.Filesystem.MakeDir
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/filesystem.MakeDirRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/filesystem.MakeDirResponse'
        '502': *id003
      security:
      - SandboxAccessTokenAuth: []
        SandboxUserAuth: []
    servers:
    - *id004
  /filesystem.Filesystem/Move:
    post:
      tags:
      - Filesystem
      summary: Move
      operationId: filesystem.Filesystem.Move
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/filesystem.MoveRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/filesystem.MoveResponse'
        '502': *id003
      security:
      - SandboxAccessTokenAuth: []
        SandboxUserAuth: []
    servers:
    - *id004
  /filesystem.Filesystem/Remove:
    post:
      tags:
      - Filesystem
      summary: Remove
      operationId: filesystem.Filesystem.Remove
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/filesystem.RemoveRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/filesystem.RemoveResponse'
        '502': *id003
      security:
      - SandboxAccessTokenAuth: []
        SandboxUserAuth: []
    servers:
    - *id004
  /filesystem.Filesystem/RemoveWatcher:
    post:
      tags:
      - Filesystem
      summary: RemoveWatcher
      operationId: filesystem.Filesystem.RemoveWatcher
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/filesystem.RemoveWatcherRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/filesystem.RemoveWatcherResponse'
        '502': *id003
      security:
      - *id005
    servers:
    - *id004
  /filesystem.Filesystem/Stat:
    post:
      tags:
      - Filesystem
      summary: Stat
      operationId: filesystem.Filesystem.Stat
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/filesystem.StatRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/filesystem.StatResponse'
        '502': *id003
      security:
      - SandboxAccessTokenAuth: []
        SandboxUserAuth: []
    servers:
    - *id004
  /filesystem.Filesystem/WatchDir:
    post:
      tags:
      - Filesystem
      summary: WatchDir
      description: Server-streaming RPC. Use the Connect protocol with streaming support.
      operationId: filesystem.Filesystem.WatchDir
      requestBody:
        content:
          application/connect+json:
            schema:
              $ref: '#/components/schemas/filesystem.WatchDirRequest'
        required: true
      responses:
        '200':
          description: Stream of WatchDirResponse events
          content:
            application/connect+json:
              schema:
                $ref: '#/components/schemas/filesystem.WatchDirResponse'
        '502': *id003
      security:
      - SandboxAccessTokenAuth: []
        SandboxUserAuth: []
      parameters:
      - &id006
        name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - &id007
        name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
    servers:
    - *id004
  /process.Process/CloseStdin:
    post:
      tags:
      - Process
      summary: CloseStdin
      description: "Close stdin to signal EOF to the process.\n Only works for non-PTY\
        \ processes. For PTY, send Ctrl+D (0x04) instead."
      operationId: process.Process.CloseStdin
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/process.CloseStdinRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/process.CloseStdinResponse'
        '502': *id003
      security:
      - *id005
    servers:
    - *id004
  /process.Process/Connect:
    post:
      tags:
      - Process
      summary: Connect
      description: Server-streaming RPC. Use the Connect protocol with streaming support.
      operationId: process.Process.Connect
      requestBody:
        content:
          application/connect+json:
            schema:
              $ref: '#/components/schemas/process.ConnectRequest'
        required: true
      responses:
        '200':
          description: Stream of ConnectResponse events
          content:
            application/connect+json:
              schema:
                $ref: '#/components/schemas/process.ConnectResponse'
        '502': *id003
      security:
      - *id005
      parameters:
      - *id006
      - *id007
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
    servers:
    - *id004
  /process.Process/List:
    post:
      tags:
      - Process
      summary: List
      operationId: process.Process.List
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/process.ListRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/process.ListResponse'
        '502': *id003
      security:
      - *id005
    servers:
    - *id004
  /process.Process/SendInput:
    post:
      tags:
      - Process
      summary: SendInput
      operationId: process.Process.SendInput
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/process.SendInputRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/process.SendInputResponse'
        '502': *id003
      security:
      - *id005
    servers:
    - *id004
  /process.Process/SendSignal:
    post:
      tags:
      - Process
      summary: SendSignal
      operationId: process.Process.SendSignal
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/process.SendSignalRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/process.SendSignalResponse'
        '502': *id003
      security:
      - *id005
    servers:
    - *id004
  /process.Process/Start:
    post:
      tags:
      - Process
      summary: Start
      description: Server-streaming RPC. Use the Connect protocol with streaming support.
      operationId: process.Process.Start
      requestBody:
        content:
          application/connect+json:
            schema:
              $ref: '#/components/schemas/process.StartRequest'
        required: true
      responses:
        '200':
          description: Stream of StartResponse events
          content:
            application/connect+json:
              schema:
                $ref: '#/components/schemas/process.StartResponse'
        '502': *id003
      security:
      - SandboxAccessTokenAuth: []
        SandboxUserAuth: []
      parameters:
      - *id006
      - *id007
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
    servers:
    - *id004
  /process.Process/StreamInput:
    post:
      tags:
      - Process
      summary: StreamInput
      description: Client-streaming RPC. Client input stream ensures ordering of messages.
        Use the Connect protocol with streaming support.
      operationId: process.Process.StreamInput
      requestBody:
        content:
          application/connect+json:
            schema:
              $ref: '#/components/schemas/process.StreamInputRequest'
        required: true
      responses:
        '200':
          description: Stream of StreamInputResponse events
          content:
            application/connect+json:
              schema:
                $ref: '#/components/schemas/process.StreamInputResponse'
        '502': *id003
      security:
      - *id005
      parameters:
      - *id006
      - *id007
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
    servers:
    - *id004
  /process.Process/Update:
    post:
      tags:
      - Process
      summary: Update
      operationId: process.Process.Update
      parameters:
      - name: E2b-Sandbox-Id
        in: header
        required: true
        description: Identifier of the target sandbox. Routes the request to that
          sandbox's envd over the shared sandbox host.
        schema:
          type: string
      - name: E2b-Sandbox-Port
        in: header
        required: true
        description: Port envd listens on inside the sandbox (default 49983).
        schema:
          type: integer
          default: 49983
      - name: Connect-Protocol-Version
        in: header
        required: true
        schema:
          $ref: '#/components/schemas/connect-protocol-version'
      - name: Connect-Timeout-Ms
        in: header
        schema:
          $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/process.UpdateRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/process.UpdateResponse'
        '502': *id003
      security:
      - *id005
    servers:
    - *id004
  /teams:
    get:
      summary: List teams
      description: List all teams
      tags:
      - Teams
      security: []
      responses:
        '200':
          description: Successfully returned all teams
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Team'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      operationId: listTeams
    servers:
    - *id001
  /teams/{teamID}/metrics:
    get:
      summary: Get team metrics
      description: Get metrics for the team
      tags:
      - Teams
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/teamID'
      - in: query
        name: start
        schema:
          type: integer
          format: int64
          minimum: 0
        description: Unix timestamp for the start of the interval, in seconds, for
          which the metrics are returned.
      - in: query
        name: end
        schema:
          type: integer
          format: int64
          minimum: 0
        description: Unix timestamp for the end of the interval, in seconds, for which
          the metrics are returned.
      responses:
        '200':
          description: Successfully returned the team metrics
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TeamMetric'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      operationId: getTeamMetrics
    servers:
    - *id001
  /teams/{teamID}/metrics/max:
    get:
      summary: Get team metrics max
      description: Get the maximum metrics for the team in the given interval
      tags:
      - Teams
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/teamID'
      - in: query
        name: start
        schema:
          type: integer
          format: int64
          minimum: 0
        description: Unix timestamp for the start of the interval, in seconds, for
          which the metrics are returned.
      - in: query
        name: end
        schema:
          type: integer
          format: int64
          minimum: 0
        description: Unix timestamp for the end of the interval, in seconds, for which
          the metrics are returned.
      - in: query
        name: metric
        required: true
        schema:
          type: string
          enum:
          - concurrent_sandboxes
          - sandbox_start_rate
        description: Metric to retrieve the maximum value for
      responses:
        '200':
          description: Successfully returned the team metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaxTeamMetric'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      operationId: getTeamMetricsMax
    servers:
    - *id001
  /secrets:
    get:
      summary: List project secrets
      description: List the project's secrets. No response carries a secret value.
      tags:
      - secrets
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/paginationNextToken'
      - $ref: '#/components/parameters/paginationLimit'
      responses:
        '200':
          description: Successfully listed the project's secrets
          headers:
            X-Next-Token:
              $ref: '#/components/headers/XNextToken'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Secret'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '502':
          $ref: '#/components/responses/502'
        '504':
          $ref: '#/components/responses/504'
      operationId: listSecrets
    post:
      summary: Create a secret
      description: Create a secret by storing a runtime marker as its first version.
        The response carries metadata only.
      tags:
      - secrets
      security:
      - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewSecret'
      responses:
        '201':
          description: Successfully created the secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Secret'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '502':
          $ref: '#/components/responses/502'
        '504':
          $ref: '#/components/responses/504'
      operationId: postSecrets
    servers:
    - *id001
  /secrets/{secretID}:
    get:
      summary: Get a secret
      description: Get one secret's metadata, selected by identifier or name.
      tags:
      - secrets
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/secretID'
      responses:
        '200':
          description: Successfully retrieved the secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Secret'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '502':
          $ref: '#/components/responses/502'
        '504':
          $ref: '#/components/responses/504'
      operationId: getSecret
    post:
      summary: Update a secret
      description: Replace the secret's stored marker by appending a new version.
        The response carries metadata only.
      tags:
      - secrets
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/secretID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SecretUpdate'
      responses:
        '200':
          description: Successfully updated the secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Secret'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '502':
          $ref: '#/components/responses/502'
        '504':
          $ref: '#/components/responses/504'
      operationId: postSecret
    delete:
      summary: Delete a secret
      description: Revoke the secret and schedule its versions for cleanup.
      tags:
      - secrets
      security:
      - ApiKeyAuth: []
      parameters:
      - $ref: '#/components/parameters/secretID'
      responses:
        '204':
          description: Successfully deleted the secret
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '502':
          $ref: '#/components/responses/502'
        '504':
          $ref: '#/components/responses/504'
      operationId: deleteSecret
    servers:
    - *id001
components:
  securitySchemes:
    AccessTokenAuth:
      type: http
      scheme: bearer
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    SandboxAccessTokenAuth:
      type: apiKey
      in: header
      name: X-Access-Token
      description: 'Sandbox access token (`envdAccessToken`) for authenticating requests
        to a running sandbox. Returned by: [POST /sandboxes](/api-reference/sandboxes/create-sandbox)
        (on create), [POST /sandboxes/{sandboxID}/connect](/api-reference/sandboxes/connect-to-sandbox)
        (on connect), [POST /sandboxes/{sandboxID}/resume](/api-reference/sandboxes/resume-sandbox)
        (on resume), and [GET /sandboxes/{sandboxID}](/api-reference/sandboxes/get-sandbox)
        (for running or paused sandboxes).'
    SandboxUserAuth:
      type: http
      scheme: basic
      description: Optional system user for the operation. Sets file ownership and
        resolves relative paths. Pass the desired username with no password. Defaults
        to the sandbox's default user when omitted.
  parameters:
    FilePath:
      name: path
      in: query
      required: false
      description: Path to the file, URL encoded. Can be relative to the user's home
        directory (e.g. "file.txt" resolves to ~/file.txt).
      schema:
        type: string
    User:
      name: username
      in: query
      required: false
      description: User for setting file ownership and resolving relative paths. Defaults
        to the sandbox's default user.
      schema:
        type: string
    Signature:
      name: signature
      in: query
      required: false
      description: Signature used for file access permission verification.
      schema:
        type: string
    SignatureExpiration:
      name: signature_expiration
      in: query
      required: false
      description: Unix timestamp (seconds) after which the signature expires. Only
        used with the signature parameter.
      schema:
        type: integer
    clusterID:
      name: clusterID
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Identifier of the cluster
    rigID:
      name: rigID
      in: path
      required: true
      schema:
        type: string
      description: Rig identifier (e.g. "default")
    templateID:
      name: templateID
      in: path
      required: true
      schema:
        type: string
    buildID:
      name: buildID
      in: path
      required: true
      schema:
        type: string
    sandboxID:
      name: sandboxID
      in: path
      required: true
      schema:
        type: string
    teamID:
      name: teamID
      in: path
      required: true
      schema:
        type: string
    nodeID:
      name: nodeID
      in: path
      required: true
      schema:
        type: string
    apiKeyID:
      name: apiKeyID
      in: path
      required: true
      schema:
        type: string
    snapshotID:
      name: snapshotID
      in: path
      required: true
      schema:
        type: string
        description: Identifier of the snapshot (template ID)
    tag:
      name: tag
      in: path
      required: true
      schema:
        type: string
        description: Tag name
    paginationLimit:
      name: limit
      in: query
      description: Maximum number of items to return per page
      required: false
      schema:
        type: integer
        format: int32
        minimum: 1
        default: 100
        maximum: 100
    paginationNextToken:
      name: nextToken
      in: query
      description: Cursor to start the list from
      required: false
      schema:
        type: string
    volumeID:
      name: volumeID
      in: path
      required: true
      schema:
        type: string
    secretID:
      name: secretID
      in: path
      required: true
      schema:
        type: string
        description: 'Identifier of the secret (sec_ prefixed), or its canonical lower-case
          name

          '
  requestBodies:
    File:
      required: true
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              file:
                type: string
                format: binary
        application/octet-stream:
          schema:
            type: string
            format: binary
            description: Raw file content. The 'path' query parameter is required
              when using this content type.
  responses:
    UploadSuccess:
      description: The file was uploaded successfully.
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/EntryInfo'
          example:
          - path: /home/user/hello.txt
            name: hello.txt
            type: file
    DownloadSuccess:
      description: Entire file downloaded successfully.
      content:
        application/octet-stream:
          schema:
            type: string
            format: binary
            description: The raw file content
    NotAcceptable:
      description: Requested encoding is not supported
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: 'no acceptable encoding found, supported: [identity, gzip]'
            code: 406
    InvalidPath:
      description: Invalid path
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: path '/home/user/docs' is a directory
            code: 400
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: 'error opening file ''/home/user/file.txt'': permission denied'
            code: 500
    FileNotFound:
      description: File not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: path '/home/user/missing.txt' does not exist
            code: 404
    InvalidUser:
      description: Invalid user
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: 'error looking up user ''nonexistent'': user: unknown user nonexistent'
            code: 401
    NotEnoughDiskSpace:
      description: Not enough disk space
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: not enough disk space available
            code: 507
    '400':
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '401':
      description: Authentication error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '404':
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '409':
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '500':
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '501':
      description: Not implemented by this deployment
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '502':
      description: Backend error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '503':
      description: Service unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '504':
      description: Backend timeout
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      required:
      - code
      - message
      properties:
        code:
          type: integer
          format: int32
          description: Error code
        error_code:
          type: string
          description: 'Machine-readable semantic error code. Not a closed set; initial
            values: sandbox_capacity_unavailable, sandbox_placement_timeout, sandbox_no_compatible_node,
            sandbox_create_failed, internal_server_error.'
        message:
          type: string
          description: Error
      type: object
    EntryInfo:
      required:
      - path
      - name
      - type
      properties:
        path:
          type: string
          description: Path to the file
        name:
          type: string
          description: Name of the file
        type:
          type: string
          description: Type of the file
          enum:
          - file
          - directory
        metadata:
          type: object
          description: User-defined metadata stored as extended attributes on the
            file.
          additionalProperties:
            type: string
      type: object
    EnvVars:
      additionalProperties:
        type: string
        description: Environment variables for the sandbox
      type: object
    Metrics:
      type: object
      description: Resource usage metrics
      properties:
        ts:
          type: integer
          format: int64
          description: Unix timestamp in UTC for current sandbox time
        cpu_count:
          type: integer
          description: Number of CPU cores
        cpu_used_pct:
          type: number
          format: float
          description: CPU usage percentage
        mem_total:
          type: integer
          description: Total virtual memory in bytes
          format: int64
        mem_used:
          type: integer
          description: Used virtual memory in bytes
          format: int64
        mem_cache:
          type: integer
          description: Cached memory (page cache) in bytes
        mem_total_mib:
          type: integer
          description: Total virtual memory in MiB
          format: int64
        mem_used_mib:
          type: integer
          description: Used virtual memory in MiB
          format: int64
        disk_used:
          type: integer
          description: Used disk space in bytes
          format: int64
        disk_total:
          type: integer
          description: Total disk space in bytes
          format: int64
    connect-protocol-version:
      type: number
      title: Connect-Protocol-Version
      description: Define the version of the Connect protocol
      const: 1
    connect-timeout-header:
      type: number
      title: Connect-Timeout-Ms
      description: Define the timeout, in ms
    filesystem.CreateWatcherRequest:
      type: object
      properties:
        path:
          type: string
          title: path
        recursive:
          type: boolean
          title: recursive
        includeEntry:
          type: boolean
          title: include_entry
          description: If true, each FilesystemEvent includes the EntryInfo of the
            affected entry, when available.
        allowNetworkMounts:
          type: boolean
          title: allow_network_mounts
          description: "If true, allows watching paths on network filesystem mounts\
            \ (NFS, CIFS, SMB, FUSE).\n Events on network mounts may be unreliable\
            \ or not delivered at all."
      title: CreateWatcherRequest
      additionalProperties: false
    filesystem.CreateWatcherResponse:
      type: object
      properties:
        watcherId:
          type: string
          title: watcher_id
      title: CreateWatcherResponse
      additionalProperties: false
    filesystem.EntryInfo:
      type: object
      properties:
        name:
          type: string
          title: name
        type:
          title: type
          $ref: '#/components/schemas/filesystem.FileType'
        path:
          type: string
          title: path
        size:
          type:
          - integer
          - string
          title: size
          format: int64
          description: File size in bytes. Encoded as string for values exceeding
            JSON number precision (int64).
        mode:
          type: integer
          title: mode
        permissions:
          type: string
          title: permissions
        owner:
          type: string
          title: owner
        group:
          type: string
          title: group
        modifiedTime:
          title: modified_time
          $ref: '#/components/schemas/google.protobuf.Timestamp'
        symlinkTarget:
          type:
          - string
          - 'null'
          title: symlink_target
          description: If the entry is a symlink, this field contains the target of
            the symlink.
        metadata:
          type: object
          title: metadata
          additionalProperties:
            type: string
            title: value
          description: "User-defined metadata stored as extended attributes (xattrs)\
            \ on the file.\n Keys live under the `user.e2b.` xattr namespace; the\
            \ prefix is stripped here.\n Plain `user.*` xattrs written by other tooling\
            \ are not reflected."
      title: EntryInfo
      additionalProperties: false
    filesystem.EventType:
      type: string
      title: EventType
      enum:
      - EVENT_TYPE_UNSPECIFIED
      - EVENT_TYPE_CREATE
      - EVENT_TYPE_WRITE
      - EVENT_TYPE_REMOVE
      - EVENT_TYPE_RENAME
      - EVENT_TYPE_CHMOD
    filesystem.FileType:
      type: string
      title: FileType
      enum:
      - FILE_TYPE_UNSPECIFIED
      - FILE_TYPE_FILE
      - FILE_TYPE_DIRECTORY
      - FILE_TYPE_SYMLINK
    filesystem.FilesystemEvent:
      type: object
      properties:
        name:
          type: string
          title: name
        type:
          title: type
          $ref: '#/components/schemas/filesystem.EventType'
        entry:
          oneOf:
          - $ref: '#/components/schemas/filesystem.EntryInfo'
          - type: 'null'
          title: entry
          description: "Info of the entry that triggered the event. Only populated\
            \ when include_entry\n was requested and the entry could be stat-ed (e.g.\
            \ not set for remove/rename-away\n events, where the entry no longer exists\
            \ at this path)."
      title: FilesystemEvent
      additionalProperties: false
    filesystem.GetWatcherEventsRequest:
      type: object
      properties:
        watcherId:
          type: string
          title: watcher_id
      title: GetWatcherEventsRequest
      additionalProperties: false
    filesystem.GetWatcherEventsResponse:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/filesystem.FilesystemEvent'
          title: events
      title: GetWatcherEventsResponse
      additionalProperties: false
    filesystem.ListDirRequest:
      type: object
      properties:
        path:
          type: string
          title: path
        depth:
          type: integer
          title: depth
      title: ListDirRequest
      additionalProperties: false
    filesystem.ListDirResponse:
      type: object
      properties:
        entries:
          type: array
          items:
            $ref: '#/components/schemas/filesystem.EntryInfo'
          title: entries
      title: ListDirResponse
      additionalProperties: false
    filesystem.MakeDirRequest:
      type: object
      properties:
        path:
          type: string
          title: path
      title: MakeDirRequest
      additionalProperties: false
    filesystem.MakeDirResponse:
      type: object
      properties:
        entry:
          title: entry
          $ref: '#/components/schemas/filesystem.EntryInfo'
      title: MakeDirResponse
      additionalProperties: false
    filesystem.MoveRequest:
      type: object
      properties:
        source:
          type: string
          title: source
        destination:
          type: string
          title: destination
      title: MoveRequest
      additionalProperties: false
    filesystem.MoveResponse:
      type: object
      properties:
        entry:
          title: entry
          $ref: '#/components/schemas/filesystem.EntryInfo'
      title: MoveResponse
      additionalProperties: false
    filesystem.RemoveRequest:
      type: object
      properties:
        path:
          type: string
          title: path
      title: RemoveRequest
      additionalProperties: false
    filesystem.RemoveResponse:
      type: object
      title: RemoveResponse
      additionalProperties: false
    filesystem.RemoveWatcherRequest:
      type: object
      properties:
        watcherId:
          type: string
          title: watcher_id
      title: RemoveWatcherRequest
      additionalProperties: false
    filesystem.RemoveWatcherResponse:
      type: object
      title: RemoveWatcherResponse
      additionalProperties: false
    filesystem.StatRequest:
      type: object
      properties:
        path:
          type: string
          title: path
      title: StatRequest
      additionalProperties: false
    filesystem.StatResponse:
      type: object
      properties:
        entry:
          title: entry
          $ref: '#/components/schemas/filesystem.EntryInfo'
      title: StatResponse
      additionalProperties: false
    filesystem.WatchDirRequest:
      type: object
      properties:
        path:
          type: string
          title: path
        recursive:
          type: boolean
          title: recursive
        includeEntry:
          type: boolean
          title: include_entry
          description: If true, each FilesystemEvent includes the EntryInfo of the
            affected entry, when available.
        allowNetworkMounts:
          type: boolean
          title: allow_network_mounts
          description: "If true, allows watching paths on network filesystem mounts\
            \ (NFS, CIFS, SMB, FUSE).\n Events on network mounts may be unreliable\
            \ or not delivered at all."
      title: WatchDirRequest
      additionalProperties: false
    filesystem.WatchDirResponse:
      type: object
      oneOf:
      - properties:
          filesystem:
            title: filesystem
            $ref: '#/components/schemas/filesystem.FilesystemEvent'
        title: filesystem
        required:
        - filesystem
      - properties:
          keepalive:
            title: keepalive
            $ref: '#/components/schemas/filesystem.WatchDirResponse.KeepAlive'
        title: keepalive
        required:
        - keepalive
      - properties:
          start:
            title: start
            $ref: '#/components/schemas/filesystem.WatchDirResponse.StartEvent'
        title: start
        required:
        - start
      title: WatchDirResponse
      additionalProperties: false
    filesystem.WatchDirResponse.KeepAlive:
      type: object
      title: KeepAlive
      additionalProperties: false
    filesystem.WatchDirResponse.StartEvent:
      type: object
      title: StartEvent
      additionalProperties: false
    google.protobuf.Timestamp:
      type: string
      examples:
      - '2023-01-15T01:30:15.01Z'
      - '2024-12-25T12:00:00Z'
      format: date-time
      description: "A Timestamp represents a point in time independent of any time\
        \ zone or local\n calendar, encoded as a count of seconds and fractions of\
        \ seconds at\n nanosecond resolution. The count is relative to an epoch at\
        \ UTC midnight on\n January 1, 1970, in the proleptic Gregorian calendar which\
        \ extends the\n Gregorian calendar backwards to year one.\n\n All minutes\
        \ are 60 seconds long. Leap seconds are \"smeared\" so that no leap\n second\
        \ table is needed for interpretation, using a [24-hour linear\n smear](https://developers.google.com/time/smear).\n\
        \n The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.\
        \ By\n restricting to that range, we ensure that we can convert to and from\
        \ [RFC\n 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n\n # Examples\n\
        \n Example 1: Compute Timestamp from POSIX `time()`.\n\n     Timestamp timestamp;\n\
        \     timestamp.set_seconds(time(NULL));\n     timestamp.set_nanos(0);\n\n\
        \ Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n\n     struct\
        \ timeval tv;\n     gettimeofday(&tv, NULL);\n\n     Timestamp timestamp;\n\
        \     timestamp.set_seconds(tv.tv_sec);\n     timestamp.set_nanos(tv.tv_usec\
        \ * 1000);\n\n Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\
        \n     FILETIME ft;\n     GetSystemTimeAsFileTime(&ft);\n     UINT64 ticks\
        \ = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n\n     // A Windows\
        \ tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n     // is\
        \ 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n     Timestamp\
        \ timestamp;\n     timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n\
        \     timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\n Example\
        \ 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\n     long\
        \ millis = System.currentTimeMillis();\n\n     Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis\
        \ / 1000)\n         .setNanos((int) ((millis % 1000) * 1000000)).build();\n\
        \n Example 5: Compute Timestamp from Java `Instant.now()`.\n\n     Instant\
        \ now = Instant.now();\n\n     Timestamp timestamp =\n         Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n\
        \             .setNanos(now.getNano()).build();\n\n Example 6: Compute Timestamp\
        \ from current time in Python.\n\n     timestamp = Timestamp()\n     timestamp.GetCurrentTime()\n\
        \n # JSON Mapping\n\n In JSON format, the Timestamp type is encoded as a string\
        \ in the\n [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is,\
        \ the\n format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\
        \n where {year} is always expressed using four digits while {month}, {day},\n\
        \ {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n\
        \ seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n\
        \ are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n\
        \ is required. A proto3 JSON serializer should always use UTC (as indicated\
        \ by\n \"Z\") when printing the Timestamp type and a proto3 JSON parser should\
        \ be\n able to accept both UTC and other timezones (as indicated by an offset).\n\
        \n For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n 01:30\
        \ UTC on January 15, 2017.\n\n In JavaScript, one can convert a Date object\
        \ to this format using the\n standard\n [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n\
        \ method. In Python, a standard `datetime.datetime` object can be converted\n\
        \ to this format using\n [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)\
        \ with\n the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java,\
        \ one can use\n the Joda Time's [`ISODateTimeFormat.dateTime()`](\n http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()\n\
        \ ) to obtain a formatter capable of generating timestamps in this format."
    process.CloseStdinRequest:
      type: object
      properties:
        process:
          title: process
          $ref: '#/components/schemas/process.ProcessSelector'
      title: CloseStdinRequest
      additionalProperties: false
    process.CloseStdinResponse:
      type: object
      title: CloseStdinResponse
      additionalProperties: false
    process.ConnectRequest:
      type: object
      properties:
        process:
          title: process
          $ref: '#/components/schemas/process.ProcessSelector'
      title: ConnectRequest
      additionalProperties: false
    process.ConnectResponse:
      type: object
      properties:
        event:
          title: event
          $ref: '#/components/schemas/process.ProcessEvent'
      title: ConnectResponse
      additionalProperties: false
    process.ListRequest:
      type: object
      title: ListRequest
      additionalProperties: false
    process.ListResponse:
      type: object
      properties:
        processes:
          type: array
          items:
            $ref: '#/components/schemas/process.ProcessInfo'
          title: processes
      title: ListResponse
      additionalProperties: false
    process.PTY:
      type: object
      properties:
        size:
          title: size
          $ref: '#/components/schemas/process.PTY.Size'
      title: PTY
      additionalProperties: false
    process.PTY.Size:
      type: object
      properties:
        cols:
          type: integer
          title: cols
        rows:
          type: integer
          title: rows
      title: Size
      additionalProperties: false
    process.ProcessConfig:
      type: object
      properties:
        cmd:
          type: string
          title: cmd
        args:
          type: array
          items:
            type: string
          title: args
        envs:
          type: object
          title: envs
          additionalProperties:
            type: string
            title: value
        cwd:
          type:
          - string
          - 'null'
          title: cwd
      title: ProcessConfig
      additionalProperties: false
    process.ProcessEvent:
      type: object
      oneOf:
      - properties:
          data:
            title: data
            $ref: '#/components/schemas/process.ProcessEvent.DataEvent'
        title: data
        required:
        - data
      - properties:
          end:
            title: end
            $ref: '#/components/schemas/process.ProcessEvent.EndEvent'
        title: end
        required:
        - end
      - properties:
          keepalive:
            title: keepalive
            $ref: '#/components/schemas/process.ProcessEvent.KeepAlive'
        title: keepalive
        required:
        - keepalive
      - properties:
          start:
            title: start
            $ref: '#/components/schemas/process.ProcessEvent.StartEvent'
        title: start
        required:
        - start
      title: ProcessEvent
      additionalProperties: false
    process.ProcessEvent.DataEvent:
      type: object
      oneOf:
      - properties:
          pty:
            type: string
            title: pty
            format: byte
        title: pty
        required:
        - pty
      - properties:
          stderr:
            type: string
            title: stderr
            format: byte
        title: stderr
        required:
        - stderr
      - properties:
          stdout:
            type: string
            title: stdout
            format: byte
        title: stdout
        required:
        - stdout
      title: DataEvent
      additionalProperties: false
    process.ProcessEvent.EndEvent:
      type: object
      properties:
        exitCode:
          type: integer
          title: exit_code
          format: int32
          deprecated: true
          description: 'Deprecated: not populated by the server. Parse the exit code
            from the `status` string (e.g. "exit status 0").'
        exited:
          type: boolean
          title: exited
        status:
          type: string
          title: status
          description: Process exit status string (e.g. "exit status 0"). Parse the
            integer exit code from this field.
        error:
          type:
          - string
          - 'null'
          title: error
      title: EndEvent
      additionalProperties: false
    process.ProcessEvent.KeepAlive:
      type: object
      title: KeepAlive
      additionalProperties: false
    process.ProcessEvent.StartEvent:
      type: object
      properties:
        pid:
          type: integer
          title: pid
      title: StartEvent
      additionalProperties: false
    process.ProcessInfo:
      type: object
      properties:
        config:
          title: config
          $ref: '#/components/schemas/process.ProcessConfig'
        pid:
          type: integer
          title: pid
        tag:
          type:
          - string
          - 'null'
          title: tag
      title: ProcessInfo
      additionalProperties: false
    process.ProcessInput:
      type: object
      oneOf:
      - properties:
          pty:
            type: string
            title: pty
            format: byte
        title: pty
        required:
        - pty
      - properties:
          stdin:
            type: string
            title: stdin
            format: byte
        title: stdin
        required:
        - stdin
      title: ProcessInput
      additionalProperties: false
    process.ProcessSelector:
      type: object
      oneOf:
      - properties:
          pid:
            type: integer
            title: pid
        title: pid
        required:
        - pid
      - properties:
          tag:
            type: string
            title: tag
        title: tag
        required:
        - tag
      title: ProcessSelector
      additionalProperties: false
    process.SendInputRequest:
      type: object
      properties:
        process:
          title: process
          $ref: '#/components/schemas/process.ProcessSelector'
        input:
          title: input
          $ref: '#/components/schemas/process.ProcessInput'
      title: SendInputRequest
      additionalProperties: false
    process.SendInputResponse:
      type: object
      title: SendInputResponse
      additionalProperties: false
    process.SendSignalRequest:
      type: object
      properties:
        process:
          title: process
          $ref: '#/components/schemas/process.ProcessSelector'
        signal:
          title: signal
          $ref: '#/components/schemas/process.Signal'
      title: SendSignalRequest
      additionalProperties: false
    process.SendSignalResponse:
      type: object
      title: SendSignalResponse
      additionalProperties: false
    process.Signal:
      type: string
      title: Signal
      enum:
      - SIGNAL_UNSPECIFIED
      - SIGNAL_SIGTERM
      - SIGNAL_SIGKILL
    process.StartRequest:
      type: object
      properties:
        process:
          title: process
          $ref: '#/components/schemas/process.ProcessConfig'
        pty:
          oneOf:
          - $ref: '#/components/schemas/process.PTY'
          - type: 'null'
          title: pty
        tag:
          type:
          - string
          - 'null'
          title: tag
        stdin:
          type:
          - boolean
          - 'null'
          title: stdin
          description: "This is optional for backwards compatibility.\n We default\
            \ to true. New SDK versions will set this to false by default."
      title: StartRequest
      additionalProperties: false
    process.StartResponse:
      type: object
      properties:
        event:
          title: event
          $ref: '#/components/schemas/process.ProcessEvent'
      title: StartResponse
      additionalProperties: false
    process.StreamInputRequest:
      type: object
      oneOf:
      - properties:
          data:
            title: data
            $ref: '#/components/schemas/process.StreamInputRequest.DataEvent'
        title: data
        required:
        - data
      - properties:
          keepalive:
            title: keepalive
            $ref: '#/components/schemas/process.StreamInputRequest.KeepAlive'
        title: keepalive
        required:
        - keepalive
      - properties:
          start:
            title: start
            $ref: '#/components/schemas/process.StreamInputRequest.StartEvent'
        title: start
        required:
        - start
      title: StreamInputRequest
      additionalProperties: false
    process.StreamInputRequest.DataEvent:
      type: object
      properties:
        input:
          title: input
          $ref: '#/components/schemas/process.ProcessInput'
      title: DataEvent
      additionalProperties: false
    process.StreamInputRequest.KeepAlive:
      type: object
      title: KeepAlive
      additionalProperties: false
    process.StreamInputRequest.StartEvent:
      type: object
      properties:
        process:
          title: process
          $ref: '#/components/schemas/process.ProcessSelector'
      title: StartEvent
      additionalProperties: false
    process.StreamInputResponse:
      type: object
      title: StreamInputResponse
      additionalProperties: false
    process.UpdateRequest:
      type: object
      properties:
        process:
          title: process
          $ref: '#/components/schemas/process.ProcessSelector'
        pty:
          oneOf:
          - $ref: '#/components/schemas/process.PTY'
          - type: 'null'
          title: pty
      title: UpdateRequest
      additionalProperties: false
    process.UpdateResponse:
      type: object
      title: UpdateResponse
      additionalProperties: false
    Team:
      required:
      - teamID
      - name
      - apiKey
      - isDefault
      properties:
        teamID:
          type: string
          description: Identifier of the team
        name:
          type: string
          description: Name of the team
        apiKey:
          type: string
          description: API key for the team
        isDefault:
          type: boolean
          description: Whether the team is the default team
      type: object
    TeamUser:
      required:
      - id
      - email
      properties:
        id:
          type: string
          format: uuid
          description: Identifier of the user
        email:
          type:
          - string
          - 'null'
          deprecated: true
          default: null
          description: Email of the user
      type: object
    TemplateUpdateRequest:
      properties:
        public:
          type: boolean
          description: Whether the template is public or only accessible by the team
      type: object
    TemplateUpdateResponse:
      required:
      - names
      properties:
        names:
          type: array
          description: Names of the template (namespace/alias format when namespaced)
          items:
            type: string
      type: object
    CPUCount:
      type: integer
      format: int32
      minimum: 1
      description: CPU cores for the sandbox
    MemoryMB:
      type: integer
      format: int32
      minimum: 128
      description: Memory for the sandbox in MiB
    DiskSizeMB:
      type: integer
      format: int32
      minimum: 0
      description: Disk size for the sandbox in MiB
    EnvdVersion:
      type: string
      description: Version of the envd running in the sandbox
    SandboxMetadata:
      additionalProperties:
        type: string
        description: Metadata of the sandbox
      type: object
    SandboxState:
      type: string
      description: State of the sandbox
      enum:
      - running
      - paused
    OrderDirection:
      type: string
      description: Sort direction
      default: desc
      enum:
      - asc
      - desc
    SnapshotInfo:
      type: object
      required:
      - snapshotID
      - names
      properties:
        snapshotID:
          type: string
          description: Identifier of the snapshot template including the tag. Uses
            namespace/alias when a name was provided (e.g. team-slug/my-snapshot:default),
            otherwise falls back to the raw template ID (e.g. abc123:default).
        names:
          type: array
          items:
            type: string
          description: Full names of the snapshot template including team namespace
            and tag (e.g. team-slug/my-snapshot:v2)
    Mcp:
      type: object
      description: MCP configuration for the sandbox
      additionalProperties: {}
      nullable: true
    SandboxNetworkConfig:
      type: object
      properties:
        allowPublicTraffic:
          type: boolean
          default: true
          description: Specify if the sandbox URLs should be accessible only with
            authentication.
        allowOut:
          type: array
          description: List of allowed destinations for egress traffic. Each entry
            can be a CIDR block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"),
            or a domain name (e.g. "example.com", "*.example.com"). Allowed entries
            always take precedence over denied entries.
          items:
            type: string
        denyOut:
          type: array
          description: List of denied CIDR blocks or IP addresses for egress traffic.
            Domain names are not supported for deny rules.
          items:
            type: string
        egressProxy:
          $ref: '#/components/schemas/SandboxEgressProxyConfig'
        maskRequestHost:
          type: string
          description: Specify host mask which will be used for all sandbox requests
        rules:
          type: object
          description: 'Per-domain transform rules applied to matching outbound HTTPS
            requests. Keys may be exact DNS names (for example, "api.example.com")
            or a leading wildcard (for example, "*.example.com"), and are normalized
            to lowercase on write. Wildcards match subdomains at any depth but not
            the apex domain; a bare "*" is invalid. Exact rules take precedence, followed
            by the longest matching wildcard suffix, and matching rule sets are not
            merged. Broad wildcards such as "*.com" are allowed and may expose transformed
            credentials to every matching destination the sandbox contacts. Rules
            do not grant network access; configure allowOut separately to permit the
            destination.

            '
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/SandboxNetworkRule'
    SandboxNetworkUpdateConfig:
      type: object
      description: Network configuration update for a running sandbox. Replaces the
        current egress rules with the provided configuration. Omitting a field clears
        it.
      properties:
        allowOut:
          type: array
          description: List of allowed destinations for egress traffic. Each entry
            can be a CIDR block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"),
            or a domain name (e.g. "example.com", "*.example.com"). Allowed entries
            always take precedence over denied entries.
          items:
            type: string
        denyOut:
          type: array
          description: List of denied CIDR blocks or IP addresses for egress traffic.
            Domain names are not supported for deny rules.
          items:
            type: string
        egressProxy:
          $ref: '#/components/schemas/SandboxEgressProxyConfig'
        rules:
          type: object
          description: 'Per-domain transform rules applied to matching outbound HTTPS
            requests. Replaces all existing rules when provided. Keys may be exact
            DNS names or a single leading wildcard (for example, "*.example.com"),
            and are normalized to lowercase on write. Wildcards match subdomains at
            any depth but not the apex domain; a bare "*" is invalid. Exact rules
            take precedence, followed by the longest matching wildcard suffix, and
            matching rule sets are not merged. Broad wildcards such as "*.com" are
            allowed and may expose transformed credentials to every matching destination
            the sandbox contacts. Rules do not grant network access; configure allowOut
            separately to permit the destination.

            '
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/SandboxNetworkRule'
        allow_internet_access:
          type: boolean
          description: Allow sandbox to access the internet. When set to false, it
            behaves the same as specifying denyOut to 0.0.0.0/0 in the network config.
    SandboxNetworkRule:
      type: object
      description: Transform rule applied to egress requests matching a domain pattern.
      properties:
        transform:
          $ref: '#/components/schemas/SandboxNetworkTransform'
    SandboxNetworkTransform:
      type: object
      description: Transformations applied to matching egress requests before forwarding.
      properties:
        headers:
          type: object
          description: 'HTTP headers to inject or override in matching requests. An
            existing header with the same name is replaced. Values are plain strings;
            secret resolution happens client-side before sending to the API.

            '
          additionalProperties:
            type: string
    SandboxEgressProxyConfig:
      type: object
      nullable: true
      description: SOCKS5 proxy for sandbox egress. Outbound TCP is tunneled through
        the proxy after allow/deny filtering; the sandbox is unaware. Domain-matched
        flows use remote DNS (ATYP=domain).
      required:
      - address
      properties:
        address:
          type: string
          description: SOCKS5 proxy address in host:port format (e.g. "proxy.example.com:1080").
        username:
          type: string
          maxLength: 255
          description: Optional SOCKS5 username (RFC 1929), max 255 bytes.
        password:
          type: string
          maxLength: 255
          description: Optional SOCKS5 password (RFC 1929), max 255 bytes.
    SandboxAutoResumeEnabled:
      type: boolean
      description: Auto-resume enabled flag for paused sandboxes. Default false.
      default: false
    SandboxAutoResumeConfig:
      type: object
      description: Auto-resume configuration for paused sandboxes.
      required:
      - enabled
      properties:
        enabled:
          $ref: '#/components/schemas/SandboxAutoResumeEnabled'
    SandboxOnTimeout:
      type: string
      description: Action taken when the sandbox times out.
      enum:
      - kill
      - pause
    SandboxLifecycle:
      type: object
      description: Sandbox lifecycle policy returned by sandbox info.
      required:
      - autoResume
      - onTimeout
      properties:
        autoResume:
          type: boolean
          description: Whether the sandbox can auto-resume.
        onTimeout:
          $ref: '#/components/schemas/SandboxOnTimeout'
    SandboxLog:
      description: Log entry with timestamp and line
      required:
      - timestamp
      - line
      properties:
        timestamp:
          type: string
          format: date-time
          description: Timestamp of the log entry
        line:
          type: string
          description: Log line content
      type: object
    SandboxLogEntry:
      required:
      - timestamp
      - level
      - message
      - fields
      properties:
        timestamp:
          type: string
          format: date-time
          description: Timestamp of the log entry
        message:
          type: string
          description: Log message content
        level:
          $ref: '#/components/schemas/LogLevel'
        fields:
          type: object
          additionalProperties:
            type: string
      type: object
    SandboxLogs:
      required:
      - logs
      - logEntries
      properties:
        logs:
          description: Logs of the sandbox
          type: array
          items:
            $ref: '#/components/schemas/SandboxLog'
        logEntries:
          description: Structured logs of the sandbox
          type: array
          items:
            $ref: '#/components/schemas/SandboxLogEntry'
      type: object
    SandboxLogsV2Response:
      required:
      - logs
      properties:
        logs:
          default: []
          description: Sandbox logs structured
          type: array
          items:
            $ref: '#/components/schemas/SandboxLogEntry'
      type: object
    SandboxMetric:
      description: Metric entry with timestamp and line
      required:
      - timestamp
      - timestampUnix
      - cpuCount
      - cpuUsedPct
      - memUsed
      - memTotal
      - memCache
      - diskUsed
      - diskTotal
      properties:
        timestamp:
          type: string
          format: date-time
          deprecated: true
          description: Timestamp of the metric entry
        timestampUnix:
          type: integer
          format: int64
          description: Timestamp of the metric entry in Unix time (seconds since epoch)
        cpuCount:
          type: integer
          format: int32
          description: Number of CPU cores
        cpuUsedPct:
          type: number
          format: float
          description: CPU usage percentage
        memUsed:
          type: integer
          format: int64
          description: Memory used in bytes
        memTotal:
          type: integer
          format: int64
          description: Total memory in bytes
        memCache:
          type: integer
          format: int64
          description: Cached memory (page cache) in bytes
        diskUsed:
          type: integer
          format: int64
          description: Disk used in bytes
        diskTotal:
          type: integer
          format: int64
          description: Total disk space in bytes
      type: object
    SandboxVolumeMount:
      type: object
      properties:
        name:
          type: string
          description: Name of the volume
        path:
          type: string
          description: Path of the volume
      required:
      - name
      - path
    Sandbox:
      required:
      - templateID
      - sandboxID
      - clientID
      - envdVersion
      properties:
        templateID:
          type: string
          description: Identifier of the template from which is the sandbox created
        sandboxID:
          type: string
          description: Identifier of the sandbox
        alias:
          type: string
          description: Alias of the template
        clientID:
          type: string
          deprecated: true
          description: Identifier of the client
        envdVersion:
          $ref: '#/components/schemas/EnvdVersion'
        envdAccessToken:
          type:
          - string
          - 'null'
          description: 'Access token for authenticating envd requests to this sandbox.
            Only returned when the sandbox is created with `secure: true`. Null for
            non-secure sandboxes (envd endpoints work without auth).'
        trafficAccessToken:
          type:
          - string
          - 'null'
          description: Token required for accessing sandbox via proxy.
        domain:
          type:
          - string
          - 'null'
          description: 'Deprecated: always null. Construct sandbox URLs as `https://{port}-{sandboxID}.e2b.app`.'
          deprecated: true
      type: object
    SandboxDetail:
      required:
      - templateID
      - sandboxID
      - clientID
      - startedAt
      - cpuCount
      - memoryMB
      - diskSizeMB
      - endAt
      - state
      - envdVersion
      properties:
        templateID:
          type: string
          description: Identifier of the template from which is the sandbox created
        alias:
          type: string
          description: Alias of the template
        sandboxID:
          type: string
          description: Identifier of the sandbox
        clientID:
          type: string
          deprecated: true
          description: Identifier of the client
        startedAt:
          type: string
          format: date-time
          description: Time when the sandbox was started
        endAt:
          type: string
          format: date-time
          description: Time when the sandbox will expire
        envdVersion:
          $ref: '#/components/schemas/EnvdVersion'
        envdAccessToken:
          type:
          - string
          - 'null'
          description: 'Access token for authenticating envd requests to this sandbox.
            Only returned when the sandbox is created with `secure: true`. Null for
            non-secure sandboxes (envd endpoints work without auth).'
        allowInternetAccess:
          type:
          - boolean
          - 'null'
          description: Whether internet access was explicitly enabled or disabled
            for the sandbox. Null means it was not explicitly set.
        domain:
          type:
          - string
          - 'null'
          description: 'Deprecated: always null. Construct sandbox URLs as `https://{port}-{sandboxID}.e2b.app`.'
          deprecated: true
        cpuCount:
          $ref: '#/components/schemas/CPUCount'
        memoryMB:
          $ref: '#/components/schemas/MemoryMB'
        diskSizeMB:
          $ref: '#/components/schemas/DiskSizeMB'
        metadata:
          $ref: '#/components/schemas/SandboxMetadata'
        state:
          $ref: '#/components/schemas/SandboxState'
        network:
          $ref: '#/components/schemas/SandboxNetworkConfig'
        lifecycle:
          $ref: '#/components/schemas/SandboxLifecycle'
        volumeMounts:
          type: array
          items:
            $ref: '#/components/schemas/SandboxVolumeMount'
      type: object
    ListedSandbox:
      required:
      - templateID
      - sandboxID
      - clientID
      - startedAt
      - cpuCount
      - memoryMB
      - diskSizeMB
      - endAt
      - state
      - envdVersion
      properties:
        templateID:
          type: string
          description: Identifier of the template from which is the sandbox created
        alias:
          type: string
          description: Alias of the template
        sandboxID:
          type: string
          description: Identifier of the sandbox
        clientID:
          type: string
          deprecated: true
          description: Identifier of the client
        startedAt:
          type: string
          format: date-time
          description: Time when the sandbox was started
        endAt:
          type: string
          format: date-time
          description: Time when the sandbox will expire
        cpuCount:
          $ref: '#/components/schemas/CPUCount'
        memoryMB:
          $ref: '#/components/schemas/MemoryMB'
        diskSizeMB:
          $ref: '#/components/schemas/DiskSizeMB'
        metadata:
          $ref: '#/components/schemas/SandboxMetadata'
        state:
          $ref: '#/components/schemas/SandboxState'
        envdVersion:
          $ref: '#/components/schemas/EnvdVersion'
        volumeMounts:
          type: array
          items:
            $ref: '#/components/schemas/SandboxVolumeMount'
      type: object
    SandboxesWithMetrics:
      required:
      - sandboxes
      properties:
        sandboxes:
          additionalProperties:
            $ref: '#/components/schemas/SandboxMetric'
      type: object
    NewSandbox:
      required:
      - templateID
      properties:
        templateID:
          type: string
          description: Identifier of the required template
        timeout:
          type: integer
          format: int32
          minimum: 0
          default: 15
          description: Time to live for the sandbox in seconds.
        autoPause:
          type: boolean
          default: false
          description: Automatically pauses the sandbox after the timeout
        autoPauseMemory:
          type: boolean
          default: true
          description: Controls the snapshot kind taken when the sandbox auto-pauses
            on timeout (only relevant when autoPause is true). When false, the auto-pause
            drops the in-memory state and persists only the filesystem (a filesystem-only
            snapshot); resuming it cold-boots (reboots) the sandbox from disk. Such
            a snapshot cannot be auto-resumed by traffic and must be resumed explicitly,
            so it cannot be combined with autoResume. Defaults to true (full memory
            snapshot).
        autoResume:
          $ref: '#/components/schemas/SandboxAutoResumeConfig'
        secure:
          type: boolean
          description: Secure all system communication with sandbox
        allow_internet_access:
          type: boolean
          description: Allow sandbox to access the internet. When set to false, it
            behaves the same as specifying denyOut to 0.0.0.0/0 in the network config.
        network:
          $ref: '#/components/schemas/SandboxNetworkConfig'
        metadata:
          $ref: '#/components/schemas/SandboxMetadata'
        envVars:
          $ref: '#/components/schemas/EnvVars'
        mcp:
          $ref: '#/components/schemas/Mcp'
        iam:
          $ref: '#/components/schemas/SandboxIam'
        volumeMounts:
          type: array
          items:
            $ref: '#/components/schemas/SandboxVolumeMount'
      type: object
    SandboxIam:
      type: object
      description: Sandbox workload identity configuration. A non-empty, valid tokens
        map enables workload identity for the sandbox.
      properties:
        tokens:
          $ref: '#/components/schemas/SandboxIamTokens'
    SandboxIamTokens:
      type: object
      description: Named workload-token definitions, keyed by a caller-chosen token
        name.
      additionalProperties:
        $ref: '#/components/schemas/SandboxIamToken'
    SandboxIamToken:
      type: object
      required:
      - audience
      - tokenType
      properties:
        audience:
          type: string
          description: Audience of the workload token, stored exactly as provided.
        tokenType:
          type: string
          description: Workload token type.
    ResumedSandbox:
      properties:
        timeout:
          type: integer
          format: int32
          minimum: 0
          default: 15
          description: Time to live for the sandbox in seconds.
        autoPause:
          type: boolean
          deprecated: true
          description: Automatically pauses the sandbox after the timeout
        memory:
          type: boolean
          x-not-implemented: true
          description: 'Defaults to true. When false, resume from disk state only:
            the sandbox cold-boots fresh and any memory in the snapshot is ignored,
            never modified or deleted. Disk state has crash-recovery semantics — writes
            not flushed before the pause may be lost. A no-op for snapshots that contain
            no memory. Rejected with an error in environments where this capability
            is not enabled, never silently downgraded to a memory restore.'
      type: object
    ConnectSandbox:
      type: object
      required:
      - timeout
      properties:
        timeout:
          description: Timeout in seconds from the current time after which the sandbox
            should expire
          type: integer
          format: int32
          minimum: 0
        memory:
          type: boolean
          x-not-implemented: true
          description: 'Defaults to true. When false and the sandbox is paused, resume
            from disk state only: the sandbox cold-boots fresh and any memory in the
            snapshot is ignored, never modified or deleted. Disk state has crash-recovery
            semantics — writes not flushed before the pause may be lost. A no-op for
            snapshots that contain no memory. Rejected with an error in environments
            where this capability is not enabled, never silently downgraded to a memory
            restore.'
    SandboxTimeoutRequest:
      type: object
      required:
      - timeout
      properties:
        timeout:
          description: Timeout in seconds from the current time after which the sandbox
            should expire
          type: integer
          format: int32
          minimum: 0
    SandboxRefreshRequest:
      type: object
      properties:
        duration:
          description: Duration for which the sandbox should be kept alive in seconds
          type: integer
          maximum: 3600
          minimum: 0
    SandboxSnapshotRequest:
      type: object
      properties:
        name:
          type: string
          description: Optional name for the snapshot template. If a snapshot template
            with this name already exists, a new build will be assigned to the existing
            template instead of creating a new one.
    SandboxPauseRequest:
      type: object
      properties:
        memory:
          type: boolean
          default: true
          description: Whether to capture a full memory snapshot. When false, only
            the filesystem is persisted and resuming the sandbox cold-boots (reboots)
            it from disk, losing in-memory state, running processes, and open connections.
            Resume it with an explicit request (connect or resume); auto-resume, which
            can be triggered by arbitrary traffic, refuses such a sandbox. Defaults
            to true.
    SandboxForkRequest:
      type: object
      properties:
        timeout:
          type: integer
          format: int32
          minimum: 0
          default: 15
          description: Time to live for the new forked sandboxes in seconds.
        count:
          type: integer
          format: int32
          minimum: 1
          maximum: 100
          default: 1
          description: Number of forked sandboxes to create. All forks boot from the
            same snapshot, so the snapshot is captured once regardless of count. Each
            fork succeeds or fails independently; the outcome of each is reported
            in its entry of the response list.
    SandboxForkResult:
      type: object
      description: 'Result of one requested fork. Exactly one of sandbox or error
        is set: sandbox when the fork started successfully, error when it failed to
        start.'
      properties:
        sandbox:
          $ref: '#/components/schemas/Sandbox'
        error:
          $ref: '#/components/schemas/Error'
    TeamMetric:
      description: Team metric with timestamp
      required:
      - timestamp
      - timestampUnix
      - concurrentSandboxes
      - sandboxStartRate
      properties:
        timestamp:
          type: string
          format: date-time
          deprecated: true
          description: Timestamp of the metric entry
        timestampUnix:
          type: integer
          format: int64
          description: Timestamp of the metric entry in Unix time (seconds since epoch)
        concurrentSandboxes:
          type: integer
          format: int32
          description: The number of concurrent sandboxes for the team
        sandboxStartRate:
          type: number
          format: float
          description: Number of sandboxes started per second
      type: object
    MaxTeamMetric:
      description: Team metric with timestamp
      required:
      - timestamp
      - timestampUnix
      - value
      properties:
        timestamp:
          type: string
          format: date-time
          deprecated: true
          description: Timestamp of the metric entry
        timestampUnix:
          type: integer
          format: int64
          description: Timestamp of the metric entry in Unix time (seconds since epoch)
        value:
          type: number
          description: The maximum value of the requested metric in the given interval
      type: object
    Template:
      required:
      - templateID
      - buildID
      - cpuCount
      - memoryMB
      - diskSizeMB
      - public
      - createdAt
      - updatedAt
      - createdBy
      - lastSpawnedAt
      - spawnCount
      - buildCount
      - envdVersion
      - aliases
      - names
      - buildStatus
      properties:
        templateID:
          type: string
          description: Identifier of the template
        buildID:
          type: string
          description: Identifier of the last successful build for given template
        cpuCount:
          $ref: '#/components/schemas/CPUCount'
        memoryMB:
          $ref: '#/components/schemas/MemoryMB'
        diskSizeMB:
          $ref: '#/components/schemas/DiskSizeMB'
        public:
          type: boolean
          description: Whether the template is public or only accessible by the team
        aliases:
          type: array
          description: Aliases of the template
          deprecated: true
          items:
            type: string
        names:
          type: array
          description: Names of the template (namespace/alias format when namespaced)
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          description: Time when the template was created
        updatedAt:
          type: string
          format: date-time
          description: Time when the template was last updated
        createdBy:
          oneOf:
          - $ref: '#/components/schemas/TeamUser'
          - type: 'null'
        lastSpawnedAt:
          type:
          - string
          - 'null'
          format: date-time
          description: Time when the template was last used
        spawnCount:
          type: integer
          format: int64
          description: Number of times the template was used
        buildCount:
          type: integer
          format: int32
          description: Number of times the template was built
        envdVersion:
          $ref: '#/components/schemas/EnvdVersion'
        buildStatus:
          $ref: '#/components/schemas/TemplateBuildStatus'
      type: object
    TemplateRequestResponseV3:
      required:
      - templateID
      - buildID
      - public
      - aliases
      - names
      - tags
      properties:
        templateID:
          type: string
          description: Identifier of the template
        buildID:
          type: string
          description: Identifier of the last successful build for given template
        public:
          type: boolean
          description: Whether the template is public or only accessible by the team
        names:
          type: array
          description: Names of the template
          items:
            type: string
        tags:
          type: array
          description: Tags assigned to the template build
          items:
            type: string
        aliases:
          type: array
          description: Aliases of the template
          deprecated: true
          items:
            type: string
      type: object
    TemplateLegacy:
      required:
      - templateID
      - buildID
      - cpuCount
      - memoryMB
      - diskSizeMB
      - public
      - createdAt
      - updatedAt
      - createdBy
      - lastSpawnedAt
      - spawnCount
      - buildCount
      - envdVersion
      - aliases
      properties:
        templateID:
          type: string
          description: Identifier of the template
        buildID:
          type: string
          description: Identifier of the last successful build for given template
        cpuCount:
          $ref: '#/components/schemas/CPUCount'
        memoryMB:
          $ref: '#/components/schemas/MemoryMB'
        diskSizeMB:
          $ref: '#/components/schemas/DiskSizeMB'
        public:
          type: boolean
          description: Whether the template is public or only accessible by the team
        aliases:
          type: array
          description: Aliases of the template
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          description: Time when the template was created
        updatedAt:
          type: string
          format: date-time
          description: Time when the template was last updated
        createdBy:
          oneOf:
          - $ref: '#/components/schemas/TeamUser'
          - type: 'null'
        lastSpawnedAt:
          type:
          - string
          - 'null'
          format: date-time
          description: Time when the template was last used
        spawnCount:
          type: integer
          format: int64
          description: Number of times the template was used
        buildCount:
          type: integer
          format: int32
          description: Number of times the template was built
        envdVersion:
          $ref: '#/components/schemas/EnvdVersion'
        names:
          type: array
          description: Names of the template (namespace/alias format when namespaced)
          items:
            type: string
        buildStatus:
          $ref: '#/components/schemas/TemplateBuildStatus'
      type: object
    TemplateBuild:
      required:
      - buildID
      - status
      - createdAt
      - updatedAt
      - cpuCount
      - memoryMB
      properties:
        buildID:
          type: string
          format: uuid
          description: Identifier of the build
        status:
          $ref: '#/components/schemas/TemplateBuildStatus'
        createdAt:
          type: string
          format: date-time
          description: Time when the build was created
        updatedAt:
          type: string
          format: date-time
          description: Time when the build was last updated
        finishedAt:
          type: string
          format: date-time
          description: Time when the build was finished
        cpuCount:
          $ref: '#/components/schemas/CPUCount'
        memoryMB:
          $ref: '#/components/schemas/MemoryMB'
        diskSizeMB:
          $ref: '#/components/schemas/DiskSizeMB'
        envdVersion:
          $ref: '#/components/schemas/EnvdVersion'
      type: object
    TemplateWithBuilds:
      required:
      - templateID
      - public
      - aliases
      - names
      - createdAt
      - updatedAt
      - lastSpawnedAt
      - spawnCount
      - builds
      properties:
        templateID:
          type: string
          description: Identifier of the template
        public:
          type: boolean
          description: Whether the template is public or only accessible by the team
        aliases:
          type: array
          description: Aliases of the template
          deprecated: true
          items:
            type: string
        names:
          type: array
          description: Names of the template (namespace/alias format when namespaced)
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          description: Time when the template was created
        updatedAt:
          type: string
          format: date-time
          description: Time when the template was last updated
        lastSpawnedAt:
          type:
          - string
          - 'null'
          format: date-time
          description: Time when the template was last used
        spawnCount:
          type: integer
          format: int64
          description: Number of times the template was used
        builds:
          type: array
          description: List of builds for the template
          items:
            $ref: '#/components/schemas/TemplateBuild'
      type: object
    TemplateAliasResponse:
      required:
      - templateID
      - public
      properties:
        templateID:
          type: string
          description: Identifier of the template
        public:
          type: boolean
          description: Whether the template is public or only accessible by the team
      type: object
    TemplateBuildRequest:
      required:
      - dockerfile
      properties:
        alias:
          description: Alias of the template
          type: string
        dockerfile:
          description: Dockerfile for the template
          type: string
        teamID:
          type: string
          description: Identifier of the team
        startCmd:
          description: Start command to execute in the template after the build
          type: string
        readyCmd:
          description: Ready check command to execute in the template after the build
          type: string
        cpuCount:
          $ref: '#/components/schemas/CPUCount'
        memoryMB:
          $ref: '#/components/schemas/MemoryMB'
      type: object
    TemplateStep:
      description: Step in the template build process
      required:
      - type
      properties:
        type:
          type: string
          description: Type of the step
        args:
          default: []
          type: array
          description: Arguments for the step
          items:
            type: string
        filesHash:
          type: string
          description: Hash of the files used in the step
        force:
          default: false
          type: boolean
          description: Whether the step should be forced to run regardless of the
            cache
      type: object
    TemplateBuildRequestV3:
      properties:
        name:
          description: Name of the template. Can include a tag with colon separator
            (e.g. "my-template" or "my-template:v1"). If tag is included, it will
            be treated as if the tag was provided in the tags array.
          type: string
          maxLength: 128
        tags:
          type: array
          description: Tags to assign to the template build
          items:
            type: string
        alias:
          description: Alias of the template. Deprecated, use name instead.
          type: string
          maxLength: 128
          deprecated: true
        teamID:
          deprecated: true
          type: string
          description: Identifier of the team
        cpuCount:
          $ref: '#/components/schemas/CPUCount'
        memoryMB:
          $ref: '#/components/schemas/MemoryMB'
      type: object
    TemplateBuildRequestV2:
      required:
      - alias
      properties:
        alias:
          description: Alias of the template
          type: string
        teamID:
          deprecated: true
          type: string
          description: Identifier of the team
        cpuCount:
          $ref: '#/components/schemas/CPUCount'
        memoryMB:
          $ref: '#/components/schemas/MemoryMB'
      type: object
    FromImageRegistry:
      oneOf:
      - $ref: '#/components/schemas/AWSRegistry'
      - $ref: '#/components/schemas/GCPRegistry'
      - $ref: '#/components/schemas/GeneralRegistry'
      discriminator:
        propertyName: type
        mapping:
          aws: '#/components/schemas/AWSRegistry'
          gcp: '#/components/schemas/GCPRegistry'
          registry: '#/components/schemas/GeneralRegistry'
    AWSRegistry:
      type: object
      required:
      - type
      - awsAccessKeyId
      - awsSecretAccessKey
      - awsRegion
      properties:
        type:
          type: string
          enum:
          - aws
          description: Type of registry authentication
        awsAccessKeyId:
          type: string
          description: AWS Access Key ID for ECR authentication
        awsSecretAccessKey:
          type: string
          description: AWS Secret Access Key for ECR authentication
        awsRegion:
          type: string
          description: AWS Region where the ECR registry is located
    GCPRegistry:
      type: object
      required:
      - type
      - serviceAccountJson
      properties:
        type:
          type: string
          enum:
          - gcp
          description: Type of registry authentication
        serviceAccountJson:
          type: string
          description: Service Account JSON for GCP authentication
    GeneralRegistry:
      type: object
      required:
      - type
      - username
      - password
      properties:
        type:
          type: string
          enum:
          - registry
          description: Type of registry authentication
        username:
          type: string
          description: Username to use for the registry
        password:
          type: string
          description: Password to use for the registry
    TemplateBuildStartV2:
      type: object
      properties:
        fromImage:
          type: string
          description: Image to use as a base for the template build
        fromTemplate:
          type: string
          description: Template to use as a base for the template build
        fromImageRegistry:
          $ref: '#/components/schemas/FromImageRegistry'
        force:
          default: false
          type: boolean
          description: Whether the whole build should be forced to run regardless
            of the cache
        steps:
          default: []
          description: List of steps to execute in the template build
          type: array
          items:
            $ref: '#/components/schemas/TemplateStep'
        startCmd:
          description: Start command to execute in the template after the build
          type: string
        readyCmd:
          description: Ready check command to execute in the template after the build
          type: string
    TemplateBuildFileUpload:
      required:
      - present
      properties:
        present:
          type: boolean
          description: Whether the file is already present in the cache
        url:
          description: Url where the file should be uploaded to
          type: string
      type: object
    LogLevel:
      type: string
      description: Severity level for log entries (e.g. info, warn, error)
    BuildLogEntry:
      required:
      - timestamp
      - message
      - level
      properties:
        timestamp:
          type: string
          format: date-time
          description: Timestamp of the log entry
        message:
          type: string
          description: Log message content
        level:
          $ref: '#/components/schemas/LogLevel'
        step:
          type: string
          description: Step in the build process related to the log entry
      type: object
    BuildStatusReason:
      required:
      - message
      properties:
        message:
          type: string
          description: Message with the status reason, currently reporting only for
            error status
        step:
          type: string
          description: Step that failed
        logEntries:
          default: []
          description: Log entries related to the status reason
          type: array
          items:
            $ref: '#/components/schemas/BuildLogEntry'
      type: object
    TemplateBuildStatus:
      type: string
      description: Status of the template build
      enum:
      - building
      - waiting
      - ready
      - error
      - uploaded
    TemplateBuildInfo:
      required:
      - templateID
      - buildID
      - status
      - logs
      - logEntries
      properties:
        logs:
          default: []
          description: Build logs
          type: array
          items:
            type: string
        logEntries:
          default: []
          description: Build logs structured
          type: array
          items:
            $ref: '#/components/schemas/BuildLogEntry'
        templateID:
          type: string
          description: Identifier of the template
        buildID:
          type: string
          description: Identifier of the build
        status:
          $ref: '#/components/schemas/TemplateBuildStatus'
        reason:
          $ref: '#/components/schemas/BuildStatusReason'
      type: object
    TemplateBuildLogsResponse:
      required:
      - logs
      properties:
        logs:
          default: []
          description: Build logs structured
          type: array
          items:
            $ref: '#/components/schemas/BuildLogEntry'
      type: object
    LogsDirection:
      type: string
      description: Direction of the logs that should be returned
      enum:
      - forward
      - backward
      x-enum-varnames:
      - LogsDirectionForward
      - LogsDirectionBackward
    LogsSource:
      type: string
      description: Source of the logs that should be returned
      enum:
      - temporary
      - persistent
      x-enum-varnames:
      - LogsSourceTemporary
      - LogsSourcePersistent
    AssignedTemplateTags:
      required:
      - tags
      - buildID
      properties:
        tags:
          type: array
          items:
            type: string
          description: Assigned tags of the template
        buildID:
          type: string
          format: uuid
          description: Identifier of the build associated with these tags
      type: object
    TemplateTag:
      required:
      - tag
      - buildID
      - createdAt
      properties:
        tag:
          type: string
          description: The tag name
        buildID:
          type: string
          format: uuid
          description: Identifier of the build associated with this tag
        createdAt:
          type: string
          format: date-time
          description: Time when the tag was assigned
      type: object
    AssignTemplateTagsRequest:
      required:
      - target
      - tags
      properties:
        target:
          type: string
          description: Target template in "name:tag" format
        tags:
          description: Tags to assign to the template
          type: array
          items:
            type: string
      type: object
    DeleteTemplateTagsRequest:
      required:
      - name
      - tags
      properties:
        name:
          type: string
          description: Name of the template
        tags:
          description: Tags to delete
          type: array
          items:
            type: string
      type: object
    Volume:
      type: object
      properties:
        volumeID:
          type: string
          description: ID of the volume
        name:
          type: string
          description: Name of the volume
      required:
      - volumeID
      - name
    VolumeAndToken:
      type: object
      properties:
        volumeID:
          type: string
          description: ID of the volume
        name:
          type: string
          description: Name of the volume
        token:
          type: string
          description: Auth token to use for interacting with volume content
        domain:
          type: string
          description: 'Domain to use as the destination for volume content requests,

            replacing the default `api.<E2B_DOMAIN>`. Only returned when the

            team is connected to a custom (BYOC) cluster; absent otherwise, in

            which case the default domain is used.

            '
      required:
      - volumeID
      - name
      - token
    NewVolume:
      type: object
      properties:
        name:
          type: string
          description: Name of the volume
          pattern: ^[a-zA-Z0-9_-]+$
      required:
      - name
    SecretMetadata:
      type: object
      description: 'Customer metadata of the secret. Always present, empty when unset.
        At most 32 entries; keys are limited to 128 bytes, values to 1024 bytes, and
        a secret''s metadata to 8192 bytes in total.

        '
      maxProperties: 32
      additionalProperties:
        type: string
        maxLength: 1024
    Secret:
      type: object
      description: Metadata of a secret. It never carries the secret value.
      required:
      - secretID
      - name
      - currentVersion
      - metadata
      - createdAt
      - updatedAt
      properties:
        secretID:
          type: string
          description: Identifier of the secret
        name:
          type: string
          description: Name of the secret, unique within the project
        currentVersion:
          type: integer
          format: int64
          description: Version served to readers that do not name one
        metadata:
          $ref: '#/components/schemas/SecretMetadata'
        createdAt:
          type: string
          format: date-time
          description: Time when the secret was created
        updatedAt:
          type: string
          format: date-time
          description: Time when the secret was last updated
    NewSecret:
      type: object
      required:
      - name
      - value
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[a-zA-Z0-9_-]+$
          description: 'Name of the secret, unique within the project. Names are lower-cased
            before storage and returned in that canonical form; the sec_ prefix is
            reserved for secret identifiers.

            '
        value:
          type: string
          description: Runtime marker stored as the secret's first version. The runtime
            resolves it to a value at sandbox egress.
        metadata:
          $ref: '#/components/schemas/SecretMetadata'
    SecretUpdate:
      type: object
      required:
      - value
      properties:
        value:
          type: string
          description: Runtime marker stored as the secret's new version. The runtime
            resolves it to a value at sandbox egress.
        metadata:
          $ref: '#/components/schemas/SecretMetadata'
  headers:
    XNextToken:
      description: Cursor to fetch the next page of results, if more exist
      schema:
        type: string
    XTotalRunning:
      description: 'Number of running sandboxes matching the filters, before pagination
        is applied. Only present when running sandboxes were requested.

        '
      schema:
        type: integer
        format: int32
tags:
- name: Sandboxes
- name: Templates
- name: Tags
- name: Volumes
- name: Envd
- name: Filesystem
- name: Process
- name: Teams
security: []
