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

# List sandboxes (v2)

> List all sandboxes



## OpenAPI

````yaml /api-reference/e2b-openapi.yaml get /v2/sandboxes
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:
  /v2/sandboxes:
    get:
      tags:
        - sandboxes
      summary: List sandboxes (v2)
      description: List all sandboxes
      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'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    SandboxState:
      type: string
      description: State of the sandbox
      enum:
        - running
        - paused
    OrderDirection:
      type: string
      description: Sort direction
      default: desc
      enum:
        - asc
        - desc
    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'
        size:
          type: string
          enum:
            - small
            - medium
            - large
            - xl
          description: >-
            Anona extension: the sandbox size (vCPU, memory and disk). Absent:
            the template's own size.
    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
    EnvdVersion:
      type: string
      description: Version of the envd running in the sandbox
    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
  parameters:
    paginationNextToken:
      name: nextToken
      in: query
      description: Cursor to start the list from
      required: false
      schema:
        type: string
    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
  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
  responses:
    '400':
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '401':
      description: Authentication error
      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.