> ## 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 run

> Permanently deletes a Loops run and its checkpoints, keeping checkpoints that are still in use.



## OpenAPI

````yaml delete /v1/loops/runs/{run_id}
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/loops/runs/{run_id}:
    parameters:
      - $ref: '#/components/parameters/run_id'
    delete:
      summary: Deletes a Loops run
      description: >-
        Deletes a Loops run by ID, deactivating it first if it is active, and
        deletes its checkpoints. Checkpoints still in use, such as deployed
        ones, are kept and listed in the response; they stay usable until that
        use stops. Deletion is permanent, and storage for some checkpoints is
        reclaimed later.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteLoopsRunResponseV1'
      x-codeSamples:
        - lang: bash
          source: |
            curl --request DELETE \
            --url https://api.baseten.co/v1/loops/runs/{run_id} \
            --header "Authorization: Bearer $BASETEN_API_KEY"
        - lang: python
          source: |-
            import requests
            import os
            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
            url = "https://api.baseten.co/v1/loops/runs/{run_id}"

            headers = {"Authorization": f"Bearer {API_KEY}"}

            response = requests.request(
                "DELETE",
                url,
                headers=headers,
                json={}
            )

            print(response.text)
components:
  parameters:
    run_id:
      schema:
        type: string
      name: run_id
      in: path
      required: true
  schemas:
    DeleteLoopsRunResponseV1:
      description: A Loops run whose delete was accepted.
      properties:
        id:
          description: The deleted Loops run ID.
          title: Id
          type: string
        kept_checkpoints:
          description: >-
            The run's checkpoints that were not deleted because something still
            uses them, such as a deployment. They stay usable until that stops.
          items:
            $ref: '#/components/schemas/LoopsCheckpointV1'
          title: Kept Checkpoints
          type: array
      required:
        - id
        - kept_checkpoints
      title: DeleteLoopsRunResponseV1
      type: object
    LoopsCheckpointV1:
      description: A checkpoint saved by a Loops run.
      properties:
        checkpoint_id:
          description: The ID of the checkpoint.
          title: Checkpoint Id
          type: string
        created_at:
          description: The timestamp of the checkpoint in ISO 8601 format.
          format: date-time
          title: Created At
          type: string
        checkpoint_type:
          description: The type of checkpoint.
          title: Checkpoint Type
          type: string
        base_model:
          anyOf:
            - type: string
            - type: 'null'
          description: The base model of the checkpoint.
          title: Base Model
        lora_adapter_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: The adapter config of the checkpoint.
          title: Lora Adapter Config
        size_bytes:
          description: The size of the checkpoint in bytes.
          title: Size Bytes
          type: integer
        sync_status:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: 'Sync state of the checkpoint: SYNCING or COMPLETE.'
          title: Sync Status
        id:
          description: The checkpoint ID.
          title: Id
          type: string
        lora_config:
          anyOf:
            - $ref: '#/components/schemas/LoopsLoRAConfigV1'
            - type: 'null'
          description: >-
            The immutable LoRA config used to save this checkpoint. Null means
            the checkpoint is unsupported and cannot be loaded.
        run_id:
          description: The ID of the run that produced the checkpoint.
          title: Run Id
          type: string
        target:
          $ref: '#/components/schemas/TrainerCheckpointTarget'
          description: Whether this checkpoint is loadable by the sampler or by the run.
      required:
        - checkpoint_id
        - created_at
        - checkpoint_type
        - base_model
        - lora_adapter_config
        - size_bytes
        - id
        - lora_config
        - run_id
        - target
      title: LoopsCheckpointV1
      type: object
    LoopsLoRAConfigV1:
      description: >-
        A published LoRA config: which modules the adapter targets and how
        experts are laid out.
      properties:
        config_version:
          description: The config version, like v1.
          title: Config Version
          type: string
        targets:
          description: The module names the LoRA adapter targets.
          items:
            type: string
          title: Targets
          type: array
        expert_layout:
          anyOf:
            - enum:
                - per_expert
                - shared_outer
                - shared_adapter
              type: string
            - type: 'null'
          default: null
          description: >-
            How routed-expert LoRA weights are laid out. Null when no experts
            are targeted.
          title: Expert Layout
      required:
        - config_version
        - targets
      title: LoopsLoRAConfigV1
      type: object
    TrainerCheckpointTarget:
      description: >-
        Whether a TrainerServerCheckpoint is loadable by the sampler or the
        trainer.


        SAMPLER checkpoints are consumed by the sampling server for inference;

        TRAINER checkpoints capture full trainer state for resuming training.

        Mirrored in the bt:// URI as

        ``bt://loops:<trainer_id>/(sampler_weights|weights)/<name>``.
      enum:
        - sampler
        - trainer
      title: TrainerCheckpointTarget
      type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````