E2B

E2B Sandboxes API

The Sandboxes API from E2B — 12 operation(s) for sandboxes.

Operations 15

GET /sandboxes List sandboxes #
POST /sandboxes Create a sandbox #
GET /sandboxes/{sandboxID} Get sandbox #
DELETE /sandboxes/{sandboxID} Terminate a sandbox #
POST /sandboxes/{sandboxID}/pause Pause a sandbox #
POST /sandboxes/{sandboxID}/resume Resume a paused sandbox #
POST /sandboxes/{sandboxID}/timeout Set sandbox timeout #
GET /sandboxes/{sandboxID}/logs Get sandbox logs #
GET /sandboxes/{sandboxID}/metrics Get sandbox metrics #
POST /sandboxes/{sandboxID}/files/upload Upload a file into the sandbox #
GET /sandboxes/{sandboxID}/files/download Download a file from the sandbox #
GET /sandboxes/{sandboxID}/files/list List files in a sandbox directory #
POST /sandboxes/{sandboxID}/processes Start a process inside the sandbox #
GET /sandboxes/{sandboxID}/processes List processes in the sandbox #
POST /sandboxes/{sandboxID}/processes/{processID}/signal Send a signal to a sandbox process #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/e2b-sandboxes-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

e2b-sandboxes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: E2B Sandbox Sandboxes API
  description: 'REST API for creating and controlling per-agent Linux microVM sandboxes,

    managing custom templates, performing filesystem operations, and starting

    and signalling processes. Authentication is via an API key passed in the

    X-API-Key header. This specification is a best-effort, documentation-derived

    description and may omit fields.

    '
  version: 1.0.0
  contact:
    name: E2B
    url: https://e2b.dev/docs
servers:
- url: https://api.e2b.dev
  description: Production
security:
- E2BApiKey: []
tags:
- name: Sandboxes
paths:
  /sandboxes:
    get:
      summary: List sandboxes
      operationId: listSandboxes
      parameters:
      - in: query
        name: metadata
        schema:
          type: string
        description: URL-encoded key=value pairs to filter sandboxes by metadata.
      responses:
        '200':
          description: List of sandboxes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Sandbox'
        '401':
          $ref: '#/components/responses/Unauthorized'
      tags:
      - Sandboxes
    post:
      summary: Create a sandbox
      operationId: createSandbox
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                templateID:
                  type: string
                metadata:
                  type: object
                  additionalProperties:
                    type: string
                timeout:
                  type: integer
                  description: Seconds until the sandbox auto-terminates.
      responses:
        '201':
          description: Sandbox created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sandbox'
        '401':
          $ref: '#/components/responses/Unauthorized'
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}:
    parameters:
    - $ref: '#/components/parameters/SandboxID'
    get:
      summary: Get sandbox
      operationId: getSandbox
      responses:
        '200':
          description: Sandbox detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sandbox'
      tags:
      - Sandboxes
    delete:
      summary: Terminate a sandbox
      operationId: deleteSandbox
      responses:
        '204':
          description: Terminated
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}/pause:
    post:
      summary: Pause a sandbox
      operationId: pauseSandbox
      parameters:
      - $ref: '#/components/parameters/SandboxID'
      responses:
        '200':
          description: Sandbox paused
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}/resume:
    post:
      summary: Resume a paused sandbox
      operationId: resumeSandbox
      parameters:
      - $ref: '#/components/parameters/SandboxID'
      responses:
        '200':
          description: Sandbox resumed
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}/timeout:
    post:
      summary: Set sandbox timeout
      operationId: setSandboxTimeout
      parameters:
      - $ref: '#/components/parameters/SandboxID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                timeout:
                  type: integer
                  description: New idle timeout in seconds.
      responses:
        '200':
          description: Timeout updated
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}/logs:
    get:
      summary: Get sandbox logs
      operationId: getSandboxLogs
      parameters:
      - $ref: '#/components/parameters/SandboxID'
      responses:
        '200':
          description: Logs
          content:
            application/json:
              schema:
                type: object
                properties:
                  logs:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}/metrics:
    get:
      summary: Get sandbox metrics
      operationId: getSandboxMetrics
      parameters:
      - $ref: '#/components/parameters/SandboxID'
      responses:
        '200':
          description: Metrics
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}/files/upload:
    post:
      summary: Upload a file into the sandbox
      operationId: uploadFile
      parameters:
      - $ref: '#/components/parameters/SandboxID'
      - in: query
        name: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: File uploaded
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}/files/download:
    get:
      summary: Download a file from the sandbox
      operationId: downloadFile
      parameters:
      - $ref: '#/components/parameters/SandboxID'
      - in: query
        name: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: File contents
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}/files/list:
    get:
      summary: List files in a sandbox directory
      operationId: listFiles
      parameters:
      - $ref: '#/components/parameters/SandboxID'
      - in: query
        name: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Directory listing
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FileEntry'
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}/processes:
    parameters:
    - $ref: '#/components/parameters/SandboxID'
    post:
      summary: Start a process inside the sandbox
      operationId: startProcess
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                command:
                  type: string
                cwd:
                  type: string
                envs:
                  type: object
                  additionalProperties:
                    type: string
      responses:
        '200':
          description: Process started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Process'
      tags:
      - Sandboxes
    get:
      summary: List processes in the sandbox
      operationId: listProcesses
      responses:
        '200':
          description: Processes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Process'
      tags:
      - Sandboxes
  /sandboxes/{sandboxID}/processes/{processID}/signal:
    post:
      summary: Send a signal to a sandbox process
      operationId: signalProcess
      parameters:
      - $ref: '#/components/parameters/SandboxID'
      - in: path
        name: processID
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                signal:
                  type: string
                  example: SIGTERM
      responses:
        '200':
          description: Signal delivered
      tags:
      - Sandboxes
components:
  schemas:
    Process:
      type: object
      properties:
        processID:
          type: string
        command:
          type: string
        state:
          type: string
    Sandbox:
      type: object
      properties:
        sandboxID:
          type: string
        templateID:
          type: string
        clientID:
          type: string
          deprecated: true
        startedAt:
          type: string
          format: date-time
        endAt:
          type: string
          format: date-time
        cpuCount:
          type: integer
        memoryMB:
          type: integer
        diskSizeMB:
          type: integer
        state:
          type: string
          enum:
          - running
          - paused
        envdVersion:
          type: string
        alias:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: string
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    FileEntry:
      type: object
      properties:
        name:
          type: string
        path:
          type: string
        type:
          type: string
          enum:
          - file
          - dir
        size:
          type: integer
  parameters:
    SandboxID:
      in: path
      name: sandboxID
      required: true
      schema:
        type: string
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    E2BApiKey:
      type: apiKey
      in: header
      name: X-API-Key