> ## 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 training job checkpoint TTL

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



## OpenAPI

````yaml put /v1/training_projects/{training_project_id}/jobs/{training_job_id}/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/training_projects/{training_project_id}/jobs/{training_job_id}/checkpoints/{checkpoint_id}/ttl:
    parameters:
      - $ref: '#/components/parameters/training_project_id'
      - $ref: '#/components/parameters/training_job_id'
      - $ref: '#/components/parameters/checkpoint_id'
    put:
      summary: Sets a training job checkpoint's TTL
      description: >-
        Sets when a training job checkpoint expires, counted from now, or
        removes its TTL so it never expires.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetTrainingJobCheckpointTtlRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingJobCheckpointV1'
      x-codeSamples:
        - lang: bash
          source: >-
            curl --request PUT \

            --url
            https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/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/training_projects/{training_project_id}/jobs/{training_job_id}/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:
    training_project_id:
      schema:
        type: string
      name: training_project_id
      in: path
      required: true
    training_job_id:
      schema:
        type: string
      name: training_job_id
      in: path
      required: true
    checkpoint_id:
      schema:
        type: string
      name: checkpoint_id
      in: path
      required: true
  schemas:
    SetTrainingJobCheckpointTtlRequestV1:
      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 never expires.
          title: Ttl Seconds
      required:
        - ttl_seconds
      title: SetTrainingJobCheckpointTtlRequestV1
      type: object
    TrainingJobCheckpointV1:
      description: A checkpoint for a training job.
      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
        training_job_id:
          description: The ID of the training job.
          title: Training Job Id
          type: string
        expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            When the checkpoint expires and is deleted. Null means it never
            expires.
          title: Expires At
      required:
        - checkpoint_id
        - created_at
        - checkpoint_type
        - base_model
        - lora_adapter_config
        - size_bytes
        - id
        - training_job_id
        - expires_at
      title: TrainingJobCheckpointV1
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````