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

# Create Snapshot

> Split a dataset into training and validation and build a snapshot.



## OpenAPI

````yaml POST /api/v1/public/snapshots/create
openapi: 3.1.0
info:
  version: 0.0.1
  title: Prem Studio API
  description: Studio autofinetuning agent API
servers:
  - url: http://studio.premai.io
    description: Current environment
  - url: https://studio.premai.io
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v1/public/snapshots/create:
    post:
      tags:
        - Public Snapshots
      description: Create snapshot from dataset with train/validation split
      operationId: snapshots.create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSnapshotRequest'
      responses:
        '200':
          description: Snapshot created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnapshotResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Dataset not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateSnapshotRequest:
      type: object
      properties:
        dataset_id:
          type: string
          format: uuid
          description: >-
            Dataset ID to snapshot. The dataset must belong to the authenticated
            workspace.
        split_percentage:
          type: integer
          minimum: 1
          maximum: 99
          default: 80
          description: >-
            Percentage of datapoints to assign to training. Remaining datapoints
            go to validation.
      required:
        - dataset_id
    SnapshotResponse:
      type: object
      properties:
        snapshot_id:
          type: string
          format: uuid
      required:
        - snapshot_id
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````