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

# Creates a model weight snapshot

> Creates a model weight snapshot for the specified model and returns the snapshot.



## OpenAPI

````yaml post /v1/model_apis/snapshots
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/model_apis/snapshots:
    post:
      summary: Creates a model weight snapshot
      description: >-
        Creates a model weight snapshot for the specified model and returns the
        snapshot.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateModelWeightSnapshotRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelWeightSnapshotV1'
      x-codeSamples:
        - lang: bash
          source: |-
            curl --request POST \
            --url https://api.baseten.co/v1/model_apis/snapshots \
            --header "Authorization: Bearer $BASETEN_API_KEY" \
            --data '{
              "model": null,
              "snapshot_uri": 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/model_apis/snapshots"

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

            response = requests.request(
                "POST",
                url,
                headers=headers,
                json={'model': None, 'snapshot_uri': None}
            )

            print(response.text)
components:
  schemas:
    CreateModelWeightSnapshotRequestV1:
      description: A request to create a model weight snapshot.
      properties:
        model:
          description: Unique identifier of the model
          title: Model
          type: string
        snapshot_uri:
          description: Path to the model weight snapshot
          title: Snapshot Uri
          type: string
      required:
        - model
        - snapshot_uri
      title: CreateModelWeightSnapshotRequestV1
      type: object
    ModelWeightSnapshotV1:
      description: A model weight snapshot.
      properties:
        model:
          description: Unique identifier of the model
          title: Model
          type: string
        snapshot_uri:
          description: Path to the model weight snapshot
          title: Snapshot Uri
          type: string
        received_at:
          description: Time of the snapshot
          format: date-time
          title: Received At
          type: string
      required:
        - model
        - snapshot_uri
        - received_at
      title: ModelWeightSnapshotV1
      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.

````