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

# Start a family

> Start a new family with its first fine-tune, from a base or one of your models
(`from`), on a dataset. Its model joins the family as family@1 if it passes its gate.



## OpenAPI

````yaml /openapi.json post /v1/fine-tuning/jobs
openapi: 3.1.0
info:
  title: DecisionOne workbench
  description: >-
    Native decisions, versioned 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. An API key reads its account but can't
    change it: keys, billing and settings change in the console. 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, and other customer writes except decisions and estimates share
    write_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: Models
    description: Base models, adapters and named models with versions.
  - name: Families
    description: >-
      Lines of models trained on one dataset, and the switches that let them
      answer calls.
  - name: Datasets
    description: >-
      Validated training examples. A dataset grows in versions, and a version
      never changes.
  - name: Evaluations
    description: Reusable model results on a dataset's fixed evaluation rows.
  - 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/fine-tuning/jobs:
    post:
      tags:
        - Fine-tuning
      summary: Start a family
      description: >-
        Start a new family with its first fine-tune, from a base or one of your
        models

        (`from`), on a dataset. Its model joins the family as family@1 if it
        passes its gate.
      operationId: createFineTuningJob
      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/JobCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                properties:
                  id:
                    type: string
                    title: Id
                  dataset_id:
                    type: string
                    title: Dataset Id
                  model:
                    type: string
                    title: Model
                  method:
                    type: string
                    enum:
                      - sft
                      - reward
                    title: Method
                  hyperparameters:
                    $ref: '#/components/schemas/ResolvedHyperparameters'
                  dataset_evaluation:
                    anyOf:
                      - $ref: '#/components/schemas/Evaluation'
                      - type: 'null'
                  family:
                    anyOf:
                      - type: string
                      - type: 'null'
                    title: Family
                    description: The family the job adds a model to.
                  family_deleted:
                    type: boolean
                    title: Family Deleted
                    description: >-
                      True once you deleted that family. The job and its charge
                      stay.
                  parent:
                    anyOf:
                      - type: string
                      - type: 'null'
                    title: Parent
                    description: The id of the model it trains from, or null from a base.
                  dataset_version:
                    type: integer
                    title: Dataset Version
                    description: The version of its dataset it trains on.
                  status:
                    type: string
                    enum:
                      - queued
                      - running
                      - cancelling
                      - succeeded
                      - failed
                      - cancelled
                    title: Status
                  outcome:
                    anyOf:
                      - type: string
                        enum:
                          - joined
                          - gate_failed
                          - failed
                          - cancelled
                          - rolled_back
                      - type: 'null'
                    title: Outcome
                    description: >-
                      How it ended for its family: its model joined the family
                      with the next number, or failed its gate and is not kept
                      for you, or the run failed or was cancelled, or a rollback
                      discarded the model that joined. Only a failed run or a
                      cancellation is free and leaves the data for another try.
                      Null while it runs.
                  created_at:
                    type: number
                    title: Created At
                  updated_at:
                    type: number
                    title: Updated At
                  attempts:
                    type: integer
                    title: Attempts
                  output_model:
                    anyOf:
                      - type: string
                      - type: 'null'
                    title: Output Model
                  metrics:
                    anyOf:
                      - additionalProperties: true
                        type: object
                      - type: 'null'
                    title: Metrics
                    description: Evaluation groups and the gate, when complete.
                  error:
                    anyOf:
                      - type: string
                      - additionalProperties: true
                        type: object
                      - type: 'null'
                    title: Error
                  progress:
                    anyOf:
                      - additionalProperties: true
                        type: object
                      - type: 'null'
                    title: Progress
                  curve:
                    anyOf:
                      - items:
                          $ref: '#/components/schemas/CurvePoint'
                        type: array
                      - type: 'null'
                    title: Curve
                    description: >-
                      The training loss over steps, at most 300 points, each the
                      means of a run of consecutive steps. Null until the job
                      succeeds, or when its trainer kept none. Lists of jobs
                      leave it out.
                  limits:
                    additionalProperties:
                      type: integer
                    type: object
                    title: Limits
                  split:
                    additionalProperties:
                      type: integer
                    type: object
                    title: Split
                  lineage:
                    anyOf:
                      - additionalProperties: true
                        type: object
                      - type: 'null'
                    title: Lineage
                  price_usd:
                    type: string
                    title: Price Usd
                    description: The fee held for this job, as exact USD.
                  charge:
                    type: string
                    enum:
                      - free
                      - reserved
                      - charged
                      - released
                    title: Charge
                    description: >-
                      What the fee is doing: held while the job runs, charged if
                      it succeeds, released if it fails or is cancelled.
                  rows_deleted:
                    type: boolean
                    title: Rows Deleted
                    description: >-
                      True once a dataset whose rows its specification held was
                      deleted: the job, its model and its metrics stay, but its
                      held-out records are gone.
                type: object
                required:
                  - id
                  - dataset_id
                  - model
                  - method
                  - hyperparameters
                  - family
                  - family_deleted
                  - parent
                  - dataset_version
                  - status
                  - outcome
                  - created_at
                  - updated_at
                  - attempts
                  - output_model
                  - metrics
                  - error
                  - progress
                  - limits
                  - split
                  - lineage
                  - price_usd
                  - charge
                title: FineTuningJob
        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:
    JobCreate:
      properties:
        dataset_id:
          type: string
          pattern: ^ds_[a-f0-9]{24}$
          title: Dataset Id
        from:
          type: string
          maxLength: 140
          minLength: 1
          title: From
          description: >-
            Where the family starts: a base model that can be fine-tuned, or one
            of your models as family@N, which it trains from on that model's
            base. Left out, Core.
          default: sqwish-d1-core
        family:
          type: string
          maxLength: 63
          pattern: ^[a-z](?:-?[a-z0-9]){1,62}$
          title: Family
          description: >-
            The new family's name: lowercase letters and digits, with single
            hyphens between them, 2 to 63 characters. A name already taken is
            refused with family_exists.
        method:
          type: string
          enum:
            - sft
            - reward
          title: Method
          default: sft
        hyperparameters:
          $ref: '#/components/schemas/Hyperparameters'
        max_price_usd:
          anyOf:
            - type: string
              pattern: ^\d{1,9}(\.\d{1,9})?$
            - type: 'null'
          title: Max Price Usd
          description: >-
            The most you agree to pay for this job, in USD, such as the price
            you were shown. If it costs more when it is admitted, it is refused
            with price_changed and nothing is held.
      additionalProperties: false
      type: object
      required:
        - dataset_id
        - family
      title: JobCreate
      description: A new family's first fine-tune, from a base or one of your models.
    ResolvedHyperparameters:
      properties:
        steps:
          type: integer
          title: Steps
        learning_rate:
          type: number
          title: Learning Rate
        lora_rank:
          type: integer
          title: Lora Rank
        seed:
          type: integer
          title: Seed
        checkpoint_every:
          type: integer
          title: Checkpoint Every
        kl_coefficient:
          type: number
          title: Kl Coefficient
        gradient_accumulation:
          type: integer
          title: Gradient Accumulation
        max_prompt_tokens:
          type: integer
          title: Max Prompt Tokens
      type: object
      required:
        - steps
        - learning_rate
        - lora_rank
        - seed
        - checkpoint_every
        - kl_coefficient
      title: ResolvedHyperparameters
    Evaluation:
      properties:
        id:
          type: string
          title: Id
        dataset_id:
          type: string
          title: Dataset Id
        dataset_version:
          type: integer
          title: Dataset Version
          description: The dataset version whose evaluation rows it scores.
        model_id:
          type: string
          title: Model Id
        model_sha256:
          type: string
          title: Model Sha256
        model_label:
          type: string
          title: Model Label
        model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Name
        version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Version
        status:
          type: string
          enum:
            - queued
            - running
            - cancelling
            - succeeded
            - failed
            - cancelled
          title: Status
        created_at:
          type: number
          title: Created At
        updated_at:
          type: number
          title: Updated At
        generation:
          type: integer
          title: Generation
        training_job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Training Job Id
        dataset_sha256:
          type: string
          title: Dataset Sha256
        evaluation_sha256:
          type: string
          title: Evaluation Sha256
        method:
          type: string
          enum:
            - sft
            - reward
          title: Method
        evaluation_rows:
          type: integer
          title: Evaluation Rows
        decisions:
          type: integer
          title: Decisions
        named:
          type: string
          title: Named
          description: >-
            The family, or the model by its number, the request named, whose
            idle clock the run moves when it finishes.
        completed_rows:
          type: integer
          title: Completed Rows
        metrics:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metrics
          description: >-
            Null until the evaluation succeeds. Then `n`, the decisions scored,
            with `accuracy`, `loss`, `brier` and `ece` for expected answers or
            `expected_reward` for rewards, and `latency_ms`, the median server
            milliseconds per request, when it was measured. A result taken from
            a fine-tune's own held-out scoring sends no request, so it has none.
        error:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Error
      type: object
      required:
        - id
        - dataset_id
        - dataset_version
        - model_id
        - model_sha256
        - model_label
        - model_name
        - version
        - status
        - created_at
        - updated_at
        - generation
        - training_job_id
        - dataset_sha256
        - evaluation_sha256
        - method
        - evaluation_rows
        - decisions
        - completed_rows
        - metrics
        - error
      title: Evaluation
    CurvePoint:
      properties:
        step:
          type: integer
          title: Step
          description: The last training step the point covers.
        loss:
          type: number
          title: Loss
          description: The mean training loss over the steps it covers.
        grad_norm:
          type: number
          title: Grad Norm
          description: The mean gradient norm, before clipping.
        learning_rate:
          type: number
          title: Learning Rate
          description: The mean learning rate.
      type: object
      required:
        - step
        - loss
        - grad_norm
        - learning_rate
      title: CurvePoint
    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
    Hyperparameters:
      properties:
        steps:
          anyOf:
            - type: integer
              maximum: 2000
              minimum: 1
            - type: 'null'
          title: Steps
          description: >-
            Training steps. Left out, about one pass over the training rows. At
            most the policy's limits.fine_tune_passes passes (10 by default), or
            20 steps. The fee is per training example, whatever the number of
            steps.
        learning_rate:
          type: number
          maximum: 0.01
          exclusiveMinimum: 0
          title: Learning Rate
          default: 0.00005
        lora_rank:
          type: integer
          enum:
            - 8
            - 16
          title: Lora Rank
          default: 8
        seed:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Seed
          default: 42
        checkpoint_every:
          type: integer
          maximum: 1000
          minimum: 1
          title: Checkpoint Every
          default: 10
        kl_coefficient:
          type: number
          maximum: 10
          minimum: 0
          title: Kl Coefficient
          default: 0.05
      additionalProperties: false
      type: object
      title: Hyperparameters
    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
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: d1_sk_...
      description: Create an API key in the console. Required when accounts are enabled.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.