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

# Delete (kill) a sandbox

> Accepts the deletion. A 202 response means the deletion intent has been persisted and the instance enters `deleting`; it only becomes `deleted` after the backing resources are confirmed released. If the release fails, the instance stays in `deleting` and reconciliation retries — **there is no force parameter**: skipping the release would leave orphaned billable resources.

Once the deletion intent is persisted the call is safely replayable: repeating it against a sandbox already being deleted returns 202 again, not 409.




## OpenAPI

````yaml /api-spec/sandbox_api.yaml delete /sandboxes/{id}
openapi: 3.0.3
info:
  title: GMI Sandbox API
  description: >-
    REST API for GMI Sandbox: create isolated execution environments from
    templates, manage their lifecycle on the control plane, and run commands or
    transfer files through each sandbox's own data plane.
  contact:
    name: GMI Cloud Support
    email: support@gmicloud.ai
  version: '2.0'
servers:
  - url: https://console.gmicloud.ai/api/v2
    description: Control plane
security:
  - bearerAuth: []
tags:
  - name: Sandbox
    description: |
      Sandbox instance lifecycle management (Sandbox v2, /api/v2/sandboxes)
  - name: SandboxTemplate
    description: Sandbox template management (Sandbox v2, `/api/v2/templates`)
  - name: Sandbox-Exec
    description: >
      Sandbox execution data plane (accessed via the sandbox host and sandbox
      access token). These endpoints are not under the control plane's `/api/v2`
      path; clients connect directly to `https://{sandbox_key}.{domain}` and
      authenticate with `X-Access-Token`.
  - name: Sandbox-Files
    description: >
      Sandbox file data plane (`/files`). **These endpoints are not under
      `/api/v2`** and do not use `Authorization: Bearer`: they are served by the
      sandbox's own data-plane entry point — clients connect directly to
      `https://{sandbox_key}.{domain}` and authenticate with `X-Access-Token`.
      `{sandbox_key}` is the `sandbox_key` returned by the create/connect
      endpoints, used for data-plane host addressing. `{domain}` and
      `X-Access-Token` are the `domain` and `sandbox_access_token` from the same
      responses — no extra endpoint is needed to obtain them.


      This split is not historical baggage but the nature of a data plane: file
      transfer is long-lived, high-volume, and addressed per sandbox, differing
      from the control plane's short requests in both capacity model and failure
      domain, so they do not share an entry point.


      **One unified abstraction.** The same contract is served by two backend
      kinds (an in-sandbox file service / a data-center data-plane proxy);
      clients need not — and cannot — tell them apart. The cost is that the
      contract is their intersection: `Content-Length` on download and resumable
      download (`Range`/`206`) are **optional capabilities** that vary by data
      center, and clients must work correctly when they are absent. See the
      per-operation notes below.
paths:
  /sandboxes/{id}:
    delete:
      tags:
        - Sandbox
      summary: Delete (kill) a sandbox
      description: >
        Accepts the deletion. A 202 response means the deletion intent has been
        persisted and the instance enters `deleting`; it only becomes `deleted`
        after the backing resources are confirmed released. If the release
        fails, the instance stays in `deleting` and reconciliation retries —
        **there is no force parameter**: skipping the release would leave
        orphaned billable resources.


        Once the deletion intent is persisted the call is safely replayable:
        repeating it against a sandbox already being deleted returns 202 again,
        not 409.
      operationId: deleteSandbox
      parameters:
        - $ref: '#/components/parameters/SandboxIdPathParam'
      responses:
        '202':
          description: Deletion accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxDeleteAcceptedResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    SandboxIdPathParam:
      name: id
      in: path
      required: true
      description: >-
        Unique sandbox resource ID (UUID; the `id` field of the create
        response). The data-plane key (`sandbox_key`) cannot be used here.
      schema:
        type: string
        format: uuid
      example: 3f6f0d3e-6f0a-4a2e-9c58-0d3e6f0a4a2e
  schemas:
    SandboxDeleteAcceptedResponse:
      type: object
      required:
        - request_id
        - data
      properties:
        request_id:
          type: string
        data:
          type: object
          properties:
            id:
              type: string
              format: uuid
            state:
              type: string
              example: deleting
    ErrorResponse:
      type: object
      required:
        - code
        - message
        - request_id
      properties:
        code:
          type: string
          description: Machine-readable business error code
          example: Resource.QuotaExceeded
        message:
          type: string
          description: Human-readable error description
          example: The resource quota is not enough.
        request_id:
          type: string
          description: Tracing ID
          example: req-xxxx
        details:
          type: object
          description: Field-level error details
          additionalProperties: true
  responses:
    Unauthorized:
      description: Unauthenticated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: Auth.Unauthorized
            message: Authentication required
            request_id: req-xxxx
    Forbidden:
      description: The caller cannot access the organization-scoped resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: Resource.NotFound
            message: The requested resource was not found
            request_id: req-xxxx
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: Internal.ServerError
            message: An internal server error occurred
            request_id: req-xxxx
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        API Key or Access Token, always sent as `Authorization: Bearer <token>`.
        The gateway recognizes the token type automatically.

````