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

# Delete a sandbox image

> Deletes a sandbox image and its tags.

Deletes the image repository and all its tags. The API rejects deletion if an
active deployment references any version. The response contains the deleted image.

For a cURL procedure, see
[Delete an image version or repository](/sandboxes/manage-images#delete-an-image-or-a-version).


## OpenAPI

````yaml delete /v1/sandboxes/images/{image_name}
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/sandboxes/images/{image_name}:
    parameters:
      - $ref: '#/components/parameters/SandboxImageName'
    delete:
      tags:
        - Images
      summary: Delete a sandbox image
      description: >-
        Delete the image repository and all its tags. Reject deletion if any
        version is referenced by an active deployment. Return the deleted image.
      operationId: DeleteImage
      parameters:
        - $ref: '#/components/parameters/TeamId'
        - $ref: '#/components/parameters/TeamIdHeader'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxImageV1'
              examples:
                complete:
                  $ref: '#/components/examples/ImageReady'
        '401':
          $ref: '#/components/responses/SandboxError401'
        '403':
          $ref: '#/components/responses/SandboxError403'
        '404':
          $ref: '#/components/responses/SandboxError404'
        '409':
          $ref: '#/components/responses/SandboxError409'
        '429':
          $ref: '#/components/responses/SandboxError429'
        '500':
          $ref: '#/components/responses/SandboxError500'
components:
  parameters:
    SandboxImageName:
      name: image_name
      in: path
      required: true
      description: Image repository name.
      schema:
        type: string
        minLength: 1
        example: base-image
    TeamId:
      name: team_id
      in: query
      required: false
      description: >-
        Optional team ID. Must match X-Team-Id when both are supplied. If
        neither selector is supplied, defaults to the caller's only accessible
        team. Callers with multiple accessible teams must select a team.
        Requests without access to any team are forbidden.
      schema:
        minLength: 1
        type: string
    TeamIdHeader:
      name: X-Team-Id
      in: header
      required: false
      description: >-
        Optional team ID. Must match the team_id query parameter when both are
        supplied. If neither selector is supplied, defaults to the caller's only
        accessible team. Callers with multiple accessible teams must select a
        team. Requests without access to any team are forbidden.
      schema:
        minLength: 1
        type: string
  schemas:
    SandboxImageV1:
      description: >-
        Sandbox image repository. Get operations return a summary with an empty
        tags array.
      allOf:
        - $ref: '#/components/schemas/SandboxImageSummaryV1'
        - type: object
          properties:
            tags:
              type: array
              description: >-
                Empty for get summary responses. Use GET
                /sandboxes/images/{image_name}/tags to retrieve paginated image
                versions.
              items:
                $ref: '#/components/schemas/SandboxImageTagV1'
              example: []
          required:
            - tags
      example:
        name: base-image
        status: BUILT
        created_at: '2026-09-15T21:20:00Z'
        updated_at: '2026-09-16T21:25:00Z'
        last_deployed_at: '2026-09-16T21:26:58.545765901Z'
        size: 260046848
        tag_count: 2
        tags: []
    SandboxImageSummaryV1:
      type: object
      description: >-
        Sandbox image repository summary. Fetch tags through GET
        /sandboxes/images/{image_name}/tags.
      properties:
        name:
          type: string
          description: Stable repository name supplied when pushing the image.
          example: base-image
        status:
          description: Image processing status. Only BUILT images are ready to use.
          allOf:
            - $ref: '#/components/schemas/SandboxImageStatusV1'
          example: BUILT
        created_at:
          type: string
          description: Time the image was created.
          format: date-time
          readOnly: true
          example: '2026-09-15T21:20:00Z'
        updated_at:
          type: string
          description: Time the image was last updated.
          format: date-time
          readOnly: true
          example: '2026-09-16T21:25:00Z'
        last_deployed_at:
          type: string
          description: Most recent deployment time across all tags, if deployed.
          format: date-time
          readOnly: true
          example: '2026-09-16T21:26:58.545765901Z'
        size:
          type: integer
          description: Total repository size in bytes.
          format: int64
          minimum: 0
          readOnly: true
          example: 260046848
        tag_count:
          type: integer
          format: int64
          minimum: 0
          readOnly: true
          description: Number of image versions in the repository.
          example: 2
      required:
        - name
        - status
      example:
        name: base-image
        status: BUILT
        created_at: '2026-09-15T21:20:00Z'
        updated_at: '2026-09-16T21:25:00Z'
        last_deployed_at: '2026-09-16T21:26:58.545765901Z'
        size: 260046848
        tag_count: 2
    SandboxImageTagV1:
      type: object
      description: A tag identifying a version of a sandbox image.
      properties:
        name:
          type: string
          description: Image tag name.
          example: latest
        created_at:
          type: string
          description: Time the tag was created.
          format: date-time
          readOnly: true
          example: '2026-09-16T21:20:00Z'
        updated_at:
          type: string
          description: Time the tag was last updated.
          format: date-time
          readOnly: true
          example: '2026-09-16T21:25:00Z'
        size:
          type: integer
          description: Image size in bytes.
          format: int64
          minimum: 0
          readOnly: true
          example: 134217728
      required:
        - name
      example:
        name: latest
        created_at: '2026-09-16T21:20:00Z'
        updated_at: '2026-09-16T21:25:00Z'
        size: 134217728
    SandboxImageStatusV1:
      type: string
      description: Image processing status. Only BUILT images are ready to use.
      enum:
        - UPLOADING
        - BUILDING
        - BUILT
        - FAILED
      readOnly: true
      example: BUILT
  examples:
    ImageReady:
      summary: Built image with all metadata and tags
      value:
        name: base-image
        status: BUILT
        created_at: '2026-09-15T21:20:00Z'
        updated_at: '2026-09-16T21:25:00Z'
        last_deployed_at: '2026-09-16T21:26:58.545765901Z'
        size: 260046848
        tags:
          - name: latest
            created_at: '2026-09-16T21:20:00Z'
            updated_at: '2026-09-16T21:25:00Z'
            size: 134217728
          - name: '20260915212000'
            created_at: '2026-09-15T21:20:00Z'
            updated_at: '2026-09-15T21:25:00Z'
            size: 125829120
      description: >-
        Dates and byte sizes are representative example data. Image references
        use the b10 namespace.
  responses:
    SandboxError401:
      description: >-
        Missing or invalid authentication. Returns a JSON error with code,
        message, and optional details.
      content:
        application/json:
          example:
            code: UNAUTHORIZED
            message: Provide a valid authentication token in the Authorization header.
            details:
              header: Authorization
    SandboxError403:
      description: >-
        Insufficient permissions. Returns a JSON error with code, message, and
        optional details.
      content:
        application/json:
          example:
            code: FORBIDDEN
            message: >-
              This authentication token does not grant permission to perform
              this operation.
            details:
              request_id: a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043
    SandboxError404:
      description: >-
        Resource not found. Returns a JSON error with code, message, and
        optional details.
      content:
        application/json:
          example:
            code: NOT_FOUND
            message: The requested resource was not found.
            details:
              request_id: a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043
    SandboxError409:
      description: >-
        Resource is currently in use or conflicts with the requested operation.
        Returns a JSON error with code, message, and optional details.
      content:
        application/json:
          example:
            code: RESOURCE_IN_USE
            message: >-
              The resource is currently in use or conflicts with the requested
              operation.
            details:
              request_id: a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043
    SandboxError429:
      description: >-
        Request limit exceeded. Returns a JSON error with code, message, and
        optional details.
      content:
        application/json:
          example:
            code: RATE_LIMITED
            message: Too many requests. Try again in 30 seconds.
            details:
              retry_after_seconds: 30
    SandboxError500:
      description: >-
        Internal server error. Returns a JSON error with code, message, and
        optional details.
      content:
        application/json:
          example:
            code: INTERNAL_ERROR
            message: The request could not be completed. Try again later.
            details:
              request_id: a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````