> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandbox

> Get a sandbox by id



## OpenAPI

````yaml /api-reference/e2b-openapi.yaml get /sandboxes/{sandboxID}
openapi: 3.0.0
info:
  title: Anona Compute API (E2B-compatible routes)
  version: 0.1.0
  description: >-
    The E2B-compatible API operations the Anona Compute gateway serves, for use
    with the E2B SDK.
servers:
  - url: https://api.compute.anonalabs.com
security: []
tags:
  - name: sandboxes
paths:
  /sandboxes/{sandboxID}:
    get:
      tags:
        - sandboxes
      summary: Sandbox
      description: Get a sandbox by id
      parameters:
        - $ref: '#/components/parameters/sandboxID'
      responses:
        '200':
          description: Successfully returned the sandbox
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxDetail'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    sandboxID:
      name: sandboxID
      in: path
      required: true
      schema:
        type: string
  schemas:
    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
          description: Access token used for envd communication
        allowInternetAccess:
          type: boolean
          nullable: true
          description: >-
            Whether internet access was explicitly enabled or disabled for the
            sandbox. Null means it was not explicitly set.
        domain:
          type: string
          nullable: true
          description: Base domain where the sandbox traffic is accessible
        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'
        pauseMode:
          $ref: '#/components/schemas/SandboxPauseMode'
        volumeMounts:
          type: array
          items:
            $ref: '#/components/schemas/SandboxVolumeMount'
        size:
          type: string
          enum:
            - small
            - medium
            - large
            - xl
          description: >-
            Anona extension: the sandbox size (vCPU, memory and disk). Absent:
            the template's own size.
    EnvdVersion:
      type: string
      description: Version of the envd running in the sandbox
    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
    SandboxMetadata:
      additionalProperties:
        type: string
        description: Metadata of the sandbox
    SandboxState:
      type: string
      description: State of the sandbox
      enum:
        - running
        - paused
    SandboxNetworkConfig:
      type: object
      properties:
        allowPublicTraffic:
          type: boolean
          nullable: true
          description: >-
            Whether sandbox URLs accept traffic without the sandbox's traffic
            access token. When omitted or null on create, the project's default
            applies, which is true unless the project changed it.
        allowOut:
          type: array
          description: >-
            Destinations to allow: IPv4 addresses, CIDR blocks (e.g.
            "203.0.113.0/24") and exact host names (e.g. "api.example.com").
            Allowed entries take precedence over denied entries. Anona: a host
            name needs public egress off (`allow_internet_access: false`, or
            `0.0.0.0/0` in `denyOut`). Wildcard names such as `*.example.com`
            are refused with 400 (wildcard host names are not supported yet;
            name exact hosts), and so are names that do not resolve yet and
            destinations in private or reserved ranges, including names that
            resolve into them. The sandbox's DNS resolvers, 1.1.1.1 and 1.0.0.1,
            are always allowed.
          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
        dnsServers:
          type: array
          maxItems: 10
          description: >-
            Anona: sandboxes resolve names through 1.1.1.1 and 1.0.0.1, which
            are always allowed, and this field does not change that or the
            sandbox's /etc/resolv.conf. Any other IPv4 address listed here is
            added to the allowed destinations when `allowOut` has a host name
            and public egress is off; otherwise it is accepted and has no
            effect. The free plan accepts only 1.1.1.1 and 1.0.0.1, and an
            address in a reserved range is refused with 400.
          items:
            type: string
        egressProxy:
          type: object
          nullable: true
          description: >-
            Not supported on Anona. Any value other than `null` is refused with
            400 (`SOCKS5 egress proxies are not supported`), on create and on
            update.
        maskRequestHost:
          type: string
          description: Specify host mask which will be used for all sandbox requests
        httpsPorts:
          type: array
          description: >-
            Sandbox ports that serve HTTPS rather than plaintext HTTP. Affects
            how the proxy reaches the service inside the sandbox; the public URL
            is HTTPS either way. Certificates are not verified, so self-signed
            ones work. The envd port (49983) cannot be listed.
          maxItems: 128
          uniqueItems: true
          items:
            type: integer
            format: uint32
            minimum: 1
            maximum: 65535
        rules:
          type: object
          description: >-
            Per-host header rules for the sandbox's outbound HTTPS requests.
            Anona: each key is one exact host name, normalized to lowercase. A
            wildcard key such as `*.example.com` is refused with 400 (`a
            wildcard is not allowed here; name the exact host`), and so is an IP
            address. Rules apply to HTTPS only. A rule does not allow the host
            on its own: with public egress off, list the host in `allowOut` too,
            or the rule is dropped with a warning. The host must be on the
            secret's allowed hosts (403 otherwise), and a rule that needs a new
            credential binding needs a caller who may create one (403
            otherwise); see Networking.
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/SandboxNetworkRule'
    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'
    SandboxPauseMode:
      type: string
      description: >-
        What the sandbox's latest pause saved. `full` saved the filesystem and
        the memory, and resuming restores the sandbox where it left off.
        `filesystem` saved only the filesystem, and resuming reboots the sandbox
        from disk. Returned for a paused sandbox once its pause has finished,
        and omitted while it is still pausing.
      enum:
        - full
        - filesystem
    SandboxVolumeMount:
      type: object
      properties:
        name:
          type: string
          description: Name of the volume
        path:
          type: string
          description: Path of the volume
      required:
        - name
        - path
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: Error code
        error_code:
          type: string
          description: >-
            Machine-readable error code. Not a closed set; the gateway sends
            plan_limit_exceeded (a plan limit; the body also has limit_name,
            limit, current and plan), rate_limited (a rate limit, with
            Retry-After), sandbox_quota_exceeded (a platform cap that is not a
            plan limit: fork checkpoints, builds in progress), credit_exhausted
            (the credit is spent), sandbox_snapshot_storage_full (pause and fork
            cannot store a snapshot; retrying does not help),
            template_not_found, template_not_ready (the template exists but
            cannot start a sandbox), sandbox_capacity_unavailable,
            sandbox_engine_starting and sandbox_engine_unavailable (retry after
            Retry-After), sandbox_create_failed (retry), sandbox_create_refused,
            invalid_request and internal_server_error.
        message:
          type: string
          description: Error
    SandboxNetworkRule:
      type: object
      description: Transform rule applied to egress requests matching a domain pattern.
      properties:
        transform:
          $ref: '#/components/schemas/SandboxNetworkTransform'
    SandboxOnTimeout:
      type: string
      description: Action taken when the sandbox times out.
      enum:
        - kill
        - pause
    SandboxNetworkTransform:
      type: object
      description: Transformations applied to matching egress requests before forwarding.
      properties:
        headers:
          type: object
          description: >-
            HTTP headers to set on matching requests; an existing header with
            the same name is replaced. Anona: every value must be one credential
            vault placeholder, `${vault.<name>}`, optionally after `Bearer ` or
            `Basic `. The egress proxy fills it in on the way out, and the
            sandbox never sees the value. A literal value is refused with 400
            (`value must be ${vault.<name>}, optionally prefixed by "Bearer " or
            "Basic "; literal values are not accepted`), as is a value with more
            than one placeholder and an empty `headers` object
            (`transform.headers: empty`). `Host`, `Content-Length`,
            `Transfer-Encoding`, `Connection`, `Upgrade`, `TE`, `Trailer`,
            `Keep-Alive` and `Proxy-*` headers cannot be set.
          additionalProperties:
            type: string
  responses:
    '401':
      description: Authentication error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '404':
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: Too many requests
      headers:
        Retry-After:
          description: >-
            When present, the number of seconds to wait before retrying the
            request.
          required: false
          schema:
            type: integer
            minimum: 0
          example: 30
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '500':
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.