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

# Create dataset

> Two bodies share this route. `multipart/form-data` (`name` + `file`) uploads a one-shot JSONL, which becomes a stream with one snapshot (`snap-1`). `application/json` `{name, format, auto_snapshot_rows?}` creates an EMPTY append-only stream with a locked row format (`prompt` | `preference` | `completion` | `chat`); append rows with POST /v1/datasets/{id}/rows.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/datasets
openapi: 3.1.0
info:
  title: Veri API
  description: >-
    REST API for the Veri RL post-training platform. All requests require a
    Bearer API key (`vk_` prefix).
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.veri.studio
    description: Production
security: []
tags:
  - name: Training jobs
    description: Create, monitor, and manage training jobs.
  - name: Datasets
    description: Upload and connect training datasets.
  - name: Deployments
    description: Serve trained models and run inference.
  - name: Volumes
    description: Persistent file storage mounted into jobs.
  - name: Models
    description: Custom model registry deployments serve from.
  - name: Regions
    description: Discover available launch regions.
  - name: GPU
    description: Live GPU availability by provider and region.
  - name: Compatibility
    description: Advisory model and runtime compatibility guidance.
  - name: Code artifacts
    description: Upload custom training script bundles.
  - name: Billing
    description: Credit balance and transaction history.
  - name: API keys
    description: Create and revoke API keys.
  - name: Account
    description: The authenticated caller's identity.
  - name: SSH keys
    description: Manage SSH key pairs for compute access.
  - name: Settings
    description: Account-level integrations (Weights & Biases).
  - name: Metrics
    description: Prometheus metrics export for your own observability stack.
paths:
  /v1/datasets:
    post:
      tags:
        - Datasets
      summary: Create dataset
      description: >-
        Two bodies share this route. `multipart/form-data` (`name` + `file`)
        uploads a one-shot JSONL, which becomes a stream with one snapshot
        (`snap-1`). `application/json` `{name, format, auto_snapshot_rows?}`
        creates an EMPTY append-only stream with a locked row format (`prompt` |
        `preference` | `completion` | `chat`); append rows with POST
        /v1/datasets/{id}/rows.
      operationId: create
      requestBody:
        description: >-
          JSON `{name, format}` for an empty stream, or a multipart JSONL file
          upload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatasetStreamCreate'
          multipart/form-data:
            schema:
              type: string
        required: true
      responses:
        '200':
          description: The created (or existing, on content-hash match) dataset
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetResponse'
        '409':
          description: 'JSON create: a dataset with that name already exists'
        '422':
          description: >-
            Empty file, invalid JSONL, a row missing the 'prompt' field, or an
            unknown format
      security:
        - bearerAuth: []
components:
  schemas:
    DatasetStreamCreate:
      type: object
      description: 'JSON body for `POST /v1/datasets`: an empty stream with a locked format.'
      required:
        - name
        - format
      properties:
        name:
          type: string
        format:
          $ref: '#/components/schemas/RowFormat'
          description: Row format every append is validated against.
        auto_snapshot_rows:
          type:
            - integer
            - 'null'
          format: int32
          description: |-
            Optional rule: cut a snapshot automatically once this many rows have
            landed since the newest snapshot (evaluated by the reconciler).
    DatasetResponse:
      type: object
      required:
        - object
        - id
        - name
        - created_at
      properties:
        object:
          type: string
        id:
          type: string
        name:
          type: string
        source_type:
          type: string
        source_uri:
          type:
            - string
            - 'null'
        huggingface_dataset:
          type:
            - string
            - 'null'
        num_rows:
          type:
            - integer
            - 'null'
          format: int32
        created_at:
          type: string
          format: date-time
        format:
          type:
            - string
            - 'null'
          description: |-
            Locked row format (prompt | preference | completion | chat). Null on
            a legacy dataset until its first append locks it.
        head_row:
          type: integer
          format: int64
          description: >-
            Highest row_id appended so far (0 = empty stream). Includes
            supersede

            and tombstone entries, so it is the log length, not the live row
            count.
        auto_snapshot_rows:
          type:
            - integer
            - 'null'
          format: int32
          description: '"cut a snapshot every N new rows" rule; null = off.'
        latest_snapshot_id:
          type:
            - string
            - 'null'
          description: >-
            Newest snapshot id ("<id>@snap-N"); populated by GET
            /v1/datasets/{id}.
        unsnapshotted_rows:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            Rows appended since the newest snapshot; populated by GET
            /v1/datasets/{id}.
        snapshot_count:
          type:
            - integer
            - 'null'
          format: int64
    RowFormat:
      type: string
      description: |-
        The locked row format of a stream. Detected from the first row and
        enforced on every later append (a mismatched row 400s the whole batch).
      enum:
        - prompt
        - preference
        - completion
        - chat
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: API key with the `vk_` prefix. Create one from the dashboard.

````