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

# Connect sandbox (v2)

> Returns sandbox details. If the sandbox is paused, it will be resumed. TTL is only extended. The request body is optional; an omitted timeout defaults to 300 seconds.

Anona: resuming a paused sandbox when no sandbox host has room for it is `503` `sandbox_capacity_unavailable` with `Should-Retry: true` and `Retry-After`. The sandbox stays paused and nothing in it is lost; a host is started for it, and the same request resumes it once there is room.



## OpenAPI

````yaml /api-reference/e2b-openapi.yaml post /v2/sandboxes/{sandboxID}/connect
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/{sandboxID}/connect:
    post:
      tags:
        - sandboxes
      summary: Connect sandbox (v2)
      description: >-
        Returns sandbox details. If the sandbox is paused, it will be resumed.
        TTL is only extended. The request body is optional; an omitted timeout
        defaults to 300 seconds.


        Anona: resuming a paused sandbox when no sandbox host has room for it is
        `503` `sandbox_capacity_unavailable` with `Should-Retry: true` and
        `Retry-After`. The sandbox stays paused and nothing in it is lost; a
        host is started for it, and the same request resumes it once there is
        room.
      parameters:
        - $ref: '#/components/parameters/sandboxID'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectSandboxV2'
      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'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
        '504':
          $ref: '#/components/responses/504'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    sandboxID:
      name: sandboxID
      in: path
      required: true
      schema:
        type: string
  schemas:
    ConnectSandboxV2:
      type: object
      properties:
        timeout:
          description: >-
            Timeout in seconds from the current time after which the sandbox
            should expire
          type: integer
          format: int32
          minimum: 1
          default: 300
        memory:
          type: boolean
          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.
    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
          description: Access token used for envd communication
        trafficAccessToken:
          type: string
          nullable: true
          description: Token required for accessing sandbox via proxy.
        domain:
          type: string
          nullable: true
          description: Base domain where the sandbox traffic is accessible
    EnvdVersion:
      type: string
      description: Version of the envd running in the sandbox
    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
  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'
    '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
      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'
    '503':
      description: Service unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '504':
      description: Backend timeout
      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.