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

# Set a checkpoint TTL

> Sets when a Loops checkpoint expires, or removes its TTL so it's kept until you delete it.



## OpenAPI

````yaml put /v1/loops/checkpoints/{checkpoint_id}/ttl
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/checkpoints/{checkpoint_id}/ttl:
    parameters:
      - $ref: '#/components/parameters/checkpoint_id'
    put:
      summary: Sets a Loops checkpoint's TTL
      description: >-
        Sets when a Loops checkpoint expires, counted from now, or removes its
        TTL so it's kept until you delete it. An expired checkpoint is deleted
        within 24 hours. If it's in use when it expires, it's deleted within 24
        hours after it stops being used.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetLoopsCheckpointTtlRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoopsCheckpointV1'
      x-codeSamples:
        - lang: bash
          source: >-
            curl --request PUT \

            --url
            https://api.baseten.co/v1/loops/checkpoints/{checkpoint_id}/ttl \

            --header "Authorization: Bearer $BASETEN_API_KEY" \

            --data '{
              "ttl_seconds": null
            }'
        - 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/checkpoints/{checkpoint_id}/ttl"


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


            response = requests.request(
                "PUT",
                url,
                headers=headers,
                json={'ttl_seconds': None}
            )


            print(response.text)
components:
  parameters:
    checkpoint_id:
      schema:
        type: string
      name: checkpoint_id
      in: path
      required: true
  schemas:
    SetLoopsCheckpointTtlRequestV1:
      properties:
        ttl_seconds:
          anyOf:
            - maximum: 315360000
              minimum: 3600
              type: integer
            - type: 'null'
          description: >-
            Seconds from now until the checkpoint expires and is deleted, from
            3600 (1 hour) to 315360000 (10 years). Null removes the TTL, so the
            checkpoint is kept until you delete it.
          title: Ttl Seconds
      required:
        - ttl_seconds
      title: SetLoopsCheckpointTtlRequestV1
      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.
        expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            When the checkpoint expires and is deleted, set from the TTL it was
            saved with. Null means it's kept until you delete it. A checkpoint
            that's still in use when it expires, for example deployed, is
            deleted once it's released.
          title: Expires At
      required:
        - checkpoint_id
        - created_at
        - checkpoint_type
        - base_model
        - lora_adapter_config
        - size_bytes
        - id
        - lora_config
        - run_id
        - target
        - expires_at
      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.

````