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

# Create dataset

> Create a dataset from JSON examples. The default request body limit is 1 MiB.



## OpenAPI

````yaml /openapi.json post /v1/datasets
openapi: 3.1.0
info:
  title: DecisionOne workbench
  description: >-
    Native decisions, immutable datasets, adaptation and shared-base deployment.
    Authenticate with `Authorization: Bearer d1_sk_...` when accounts are on. A
    short guide for coding agents is at /llms.txt. Hosted account APIs accept a
    Bearer API key or a browser session. Browser mutations require the
    configured Origin and X-CSRF-Token from /auth/session. Account recovery and
    history remain available to blocked accounts. Waitlisted accounts can read
    their account summary and model catalogue and request early access; private
    member APIs require admission. Money fields ending in _usd are exact decimal
    strings; never interpret them as integer cents. Authenticated customer reads
    and existing-operation replays share read_rpm. Exhausted budgets return 429
    with Retry-After; unavailable admission storage returns 503.
  version: 0.1.0
servers:
  - url: https://console.sqwish.ai
security: []
tags:
  - name: Decisions
    description: Probabilities for questions with fixed outcomes.
  - name: Feedback
    description: Report outcomes and turn them into training data.
  - name: Models
    description: Base models, adapters and named models with versions.
  - name: Datasets
    description: Validated training examples. A dataset never changes.
  - name: Fine-tuning
    description: Training jobs, their events and held-out results.
  - name: Prompt tuning
    description: Better wording for a decision, tested on your rows. Words, not weights.
  - name: Labeling
    description: Teacher labels for real queries, reviewed by you.
  - name: Accounts
    description: Email OTP sign-in, revocable sessions, security and API keys.
  - name: Billing
    description: Exact USD balances, purchases, automatic top-ups and referrals.
  - name: Integrations
    description: Endpoints other tools call, such as Claude Code.
  - name: System
    description: Health and discovery.
paths:
  /v1/datasets:
    post:
      tags:
        - Datasets
      summary: Create dataset
      description: >-
        Create a dataset from JSON examples. The default request body limit is 1
        MiB.
      operationId: createDataset
      parameters:
        - name: idempotency-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatasetCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                properties:
                  id:
                    type: string
                    title: Id
                  name:
                    type: string
                    title: Name
                  created_at:
                    type: number
                    title: Created At
                  sha256:
                    type: string
                    title: Sha256
                  status:
                    type: string
                    const: validated
                    title: Status
                  rows:
                    type: integer
                    title: Rows
                  contexts:
                    type: integer
                    title: Contexts
                  duplicates_removed:
                    type: integer
                    title: Duplicates Removed
                  method:
                    type: string
                    enum:
                      - sft
                      - reward
                    title: Method
                  augmentation:
                    type: string
                    const: none
                    title: Augmentation
                  deleted_at:
                    anyOf:
                      - type: number
                      - type: 'null'
                    title: Deleted At
                  input:
                    $ref: '#/components/schemas/InputReceipt'
                  labeling:
                    $ref: '#/components/schemas/LabelingLineage'
                  source:
                    type: string
                    title: Source
                  metadata_filter:
                    anyOf:
                      - additionalProperties:
                          type: string
                        type: object
                      - type: 'null'
                    title: Metadata Filter
                type: object
                required:
                  - id
                  - name
                  - created_at
                  - sha256
                  - status
                  - rows
                  - contexts
                  - duplicates_removed
                  - method
                  - augmentation
                  - deleted_at
                title: Dataset
        4XX:
          description: >-
            Client error. On a 422, `error.details` lists each field that
            failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        5XX:
          description: Server error. A 503 names what is not running on this server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    DatasetCreate:
      properties:
        name:
          type: string
          maxLength: 120
          minLength: 1
          title: Name
        examples:
          items:
            $ref: '#/components/schemas/Example'
          type: array
          maxItems: 20000
          minItems: 2
          title: Examples
      additionalProperties: false
      type: object
      required:
        - name
        - examples
      title: DatasetCreate
    InputReceipt:
      properties:
        format:
          type: string
          enum:
            - json
            - jsonl
          title: Format
        sha256:
          type: string
          title: Sha256
        bytes:
          type: integer
          title: Bytes
      type: object
      required:
        - format
        - sha256
        - bytes
      title: InputReceipt
    LabelingLineage:
      properties:
        job_id:
          type: string
          title: Job Id
        source_id:
          type: string
          title: Source Id
        source_sha256:
          type: string
          title: Source Sha256
        source_input_sha256:
          type: string
          title: Source Input Sha256
        spec_sha256:
          type: string
          title: Spec Sha256
        prompt_version:
          type: string
          title: Prompt Version
        teacher_models:
          items:
            type: string
          type: array
          title: Teacher Models
        row_indices:
          items:
            type: integer
          type: array
          title: Row Indices
        selection_sha256:
          type: string
          title: Selection Sha256
        target_method:
          type: string
          const: mean_one_hot_teacher_votes
          title: Target Method
      type: object
      required:
        - job_id
        - source_id
        - source_sha256
        - source_input_sha256
        - spec_sha256
        - prompt_version
        - teacher_models
        - row_indices
        - selection_sha256
        - target_method
      title: LabelingLineage
    ErrorResponse:
      description: >-
        The body of every error. app.failure() builds it; this model documents
        it.
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      required:
        - error
      title: ErrorResponse
      type: object
    Example:
      properties:
        model:
          anyOf:
            - type: string
              maxLength: 128
              minLength: 1
            - type: 'null'
          title: Model
        context:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - items: {}
              type: array
          title: Context
        decisions:
          items:
            $ref: '#/components/schemas/Decision'
          type: array
          maxItems: 64
          minItems: 1
          title: Decisions
        independent:
          type: boolean
          title: Independent
          default: false
        store:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Store
        metadata:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Metadata
        fallback:
          anyOf:
            - type: string
              enum:
                - auto
                - none
            - items:
                type: string
              type: array
            - type: 'null'
          title: Fallback
        targets:
          anyOf:
            - additionalProperties:
                additionalProperties:
                  type: number
                type: object
              type: object
            - type: 'null'
          title: Targets
        rewards:
          anyOf:
            - additionalProperties:
                additionalProperties:
                  type: number
                type: object
              type: object
            - type: 'null'
          title: Rewards
      additionalProperties: false
      type: object
      required:
        - context
        - decisions
      title: Example
    ErrorBody:
      properties:
        code:
          description: A stable code to branch on, such as invalid_request.
          title: Code
          type: string
        message:
          description: What went wrong and what to change, in plain words.
          title: Message
          type: string
        retryable:
          description: >-
            True when another attempt may succeed; it does not prove that no
            work was done. Respect Retry-After when present. Only operations
            that support Idempotency-Key replay a prior result, including
            /v1/decide for 24 hours.
          title: Retryable
          type: boolean
        request_id:
          description: Also sent as X-Request-ID. Quote it in bug reports.
          title: Request Id
          type: string
        details:
          anyOf:
            - items:
                $ref: '#/components/schemas/ErrorDetail'
              type: array
            - type: 'null'
          default: null
          description: On validation errors, one entry for each field that failed.
          title: Details
      required:
        - code
        - message
        - retryable
        - request_id
      title: ErrorBody
      type: object
    Decision:
      properties:
        id:
          type: string
          maxLength: 128
          minLength: 1
          title: Id
        question:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - items: {}
              type: array
          title: Question
        kind:
          type: string
          enum:
            - single
            - binary
            - ordinal
          title: Kind
          default: single
        outcomes:
          title: Outcomes
        rubric:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Rubric
        weights:
          anyOf:
            - additionalProperties:
                type: number
              type: object
            - type: 'null'
          title: Weights
        costs:
          anyOf:
            - additionalProperties:
                additionalProperties:
                  type: number
                type: object
              type: object
            - type: 'null'
          title: Costs
        abstain:
          anyOf:
            - $ref: '#/components/schemas/Abstain'
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - id
        - question
      title: Decision
    ErrorDetail:
      properties:
        path:
          description: Where the problem is, such as ["body", "decisions", 0, "outcomes"].
          items:
            anyOf:
              - type: string
              - type: integer
          title: Path
          type: array
        message:
          title: Message
          type: string
        type:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Type
      required:
        - path
        - message
      title: ErrorDetail
      type: object
    Abstain:
      properties:
        min_probability:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Min Probability
        cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost
      additionalProperties: false
      type: object
      title: Abstain
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: d1_sk_...
      description: Create an API key in the console. Required when accounts are enabled.

````