# Start a sandbox



## OpenAPI

````yaml ${THUNDER_API_BASE}/openapi.json post /sandboxes/start
openapi: 3.1.0
info:
  contact:
    email: support@thundercompute.one
    name: Thunder Compute API Support
    url: https://www.thundercompute.one/contact
  description: >-
    Retrieve current GPU availability using mode-less spec keys

    Recommended for new integrations. The /status and /v1/status endpoints
    retain their legacy configuration keys for compatibility.
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: Thunder Compute API
  version: '1.0'
servers:
  - description: Production server
    url: ${THUNDER_API_BASE}/v1
  - description: Production server
    url: ${THUNDER_API_BASE}
security: []
externalDocs:
  description: ''
  url: ''
paths:
  /sandboxes/start:
    post:
      tags:
        - Sandboxes
      summary: Start a sandbox
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/thundertypes.SandboxStartRequest'
              summary: body
              description: Sandbox start request
        description: Sandbox start request
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.SandboxStartResponse'
          description: Accepted
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Forbidden
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.QuotaExceededResponse'
          description: The sandbox would exceed one of the organization's quotas
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: >-
            The organization's quotas could not be checked, or concurrent
            changes kept the request from committing; retry
      security:
        - ApiKeyAuth: []
components:
  schemas:
    thundertypes.SandboxStartRequest:
      properties:
        env:
          additionalProperties:
            type: string
          type: object
        gatedFeatures:
          additionalProperties: {}
          description: >-
            GatedFeatures contains optional feature settings restricted to
            administrators.
          type: object
        image_id:
          description: >-
            ImageID optionally selects a READY organization-owned container
            image.

            When omitted, the sandbox is a Firecracker VM without a container.
          type: string
        lifetime:
          $ref: '#/components/schemas/thundertypes.SandboxLifetime'
        name:
          description: >-
            Name is an optional label. It must be free of any other live sandbox
            in

            the organization and defaults to the assigned ID. It never addresses
            a

            sandbox: requests are made by ID.
          type: string
        network_policy:
          $ref: '#/components/schemas/thundertypes.SandboxNetworkPolicy'
        queue:
          description: >-
            Queue waits for capacity without a scheduling timeout. Runtime TTL
            starts at readiness.
          type: boolean
        spec:
          $ref: '#/components/schemas/thundertypes.SandboxResourceSpec'
        workspace_id:
          form: workspace_id
          type: string
      required:
        - lifetime
        - network_policy
        - spec
      type: object
    thundertypes.SandboxStartResponse:
      properties:
        id:
          type: string
        name:
          type: string
        workspace_id:
          type: string
      required:
        - id
        - name
      type: object
    thundertypes.ErrorResponse:
      properties:
        code:
          example: 400
          type: integer
        error:
          example: invalid_request
          type: string
        message:
          example: The request is malformed
          type: string
      type: object
    thundertypes.QuotaExceededResponse:
      properties:
        code:
          example: 409
          type: integer
        error:
          example: quota_exceeded
          type: string
        message:
          type: string
        quota:
          $ref: '#/components/schemas/thundertypes.QuotaExceeded'
      type: object
    thundertypes.SandboxLifetime:
      properties:
        enforce_ttl:
          type: boolean
        max_grace_seconds:
          type: integer
        max_ttl_seconds:
          type: integer
      type: object
    thundertypes.SandboxNetworkPolicy:
      properties:
        cidr_allowlist:
          items:
            type: string
          type: array
          uniqueItems: false
        domain_allowlist:
          items:
            type: string
          type: array
          uniqueItems: false
        internet_access:
          $ref: '#/components/schemas/thundertypes.SandboxInternetAccess'
      required:
        - internet_access
      type: object
    thundertypes.SandboxResourceSpec:
      properties:
        cpu_count:
          type: integer
        gpu_count:
          type: integer
        gpu_type:
          $ref: '#/components/schemas/thundertypes.SandboxGPUType'
        memory_gib:
          type: integer
        storage_gib:
          type: integer
      required:
        - cpu_count
        - memory_gib
        - storage_gib
      type: object
    thundertypes.QuotaExceeded:
      properties:
        key:
          enum:
            - standard_gpus
            - premium_gpus
            - instances
            - sandboxes
            - sandbox_memory_gib
            - max_gpus_per_instance
          example: instances
          type: string
        limit:
          example: 10
          type: integer
        requested:
          example: 1
          type: integer
        usage:
          example: 10
          type: integer
      type: object
    thundertypes.SandboxInternetAccess:
      enum:
        - closed
        - open
        - restricted
      type: string
      x-enum-varnames:
        - SandboxInternetAccessClosed
        - SandboxInternetAccessOpen
        - SandboxInternetAccessRestricted
    thundertypes.SandboxGPUType:
      enum:
        - A6000
        - A100
        - A100XL
        - H100
      type: string
      x-enum-varnames:
        - SandboxGPUTypeA6000
        - SandboxGPUTypeA100
        - SandboxGPUTypeA100XL
        - SandboxGPUTypeH100
  securitySchemes:
    ApiKeyAuth:
      description: >-
        Bearer token authentication. Provide your API token prefixed with
        "Bearer ", e.g. "Bearer your-api-token".
      in: header
      name: Authorization
      type: apiKey

````
