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

# Start Sandbox



## OpenAPI

````yaml /openapi/openhands-cloud.json post /api/v1/sandboxes
openapi: 3.1.0
info:
  title: OpenHands
  description: 'OpenHands: Code Less, Make More'
  version: 0.0.1
servers: []
security: []
paths:
  /api/v1/sandboxes:
    post:
      tags:
        - Sandbox
      summary: Start Sandbox
      operationId: start_sandbox_api_v1_sandboxes_post
      parameters:
        - name: sandbox_spec_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Sandbox Spec Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxInfo'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    SandboxInfo:
      properties:
        id:
          type: string
          title: Id
        created_by_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By User Id
        sandbox_spec_id:
          type: string
          title: Sandbox Spec Id
        status:
          $ref: '#/components/schemas/SandboxStatus'
        session_api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Api Key
          description: >-
            Key to access sandbox, to be added as an `X-Session-API-Key` header
            in each request. In cases where the sandbox statues is STARTING or
            PAUSED, or the current user does not have full access the
            session_api_key will be None.
        exposed_urls:
          anyOf:
            - items:
                $ref: '#/components/schemas/ExposedUrl'
              type: array
            - type: 'null'
          title: Exposed Urls
          description: >-
            URLs exposed by the sandbox (App server, Vscode, etc...)Sandboxes
            with a status STARTING / PAUSED / ERROR may not return urls.
        created_at:
          type: string
          format: date-time
          title: Created At
        status_detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Detail
          description: >-
            Last pod/scheduling reason from the runtime (e.g. insufficient kvm,
            ImagePullBackOff), surfaced when a sandbox is stuck or errored.
      type: object
      required:
        - id
        - created_by_user_id
        - sandbox_spec_id
        - status
        - session_api_key
      title: SandboxInfo
      description: Information about a sandbox.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SandboxStatus:
      type: string
      enum:
        - STARTING
        - RUNNING
        - PAUSED
        - ERROR
        - MISSING
      title: SandboxStatus
    ExposedUrl:
      properties:
        name:
          type: string
          title: Name
        url:
          type: string
          title: Url
        port:
          type: integer
          title: Port
      type: object
      required:
        - name
        - url
        - port
      title: ExposedUrl
      description: URL to access some named service within the container.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-Access-Token

````