> ## 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 fine-tuning job

> Start a fine-tuning job, optionally creating a version of a named model.



## OpenAPI

````yaml /openapi.json post /v1/fine-tuning/jobs
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/fine-tuning/jobs:
    post:
      tags:
        - Fine-tuning
      summary: Create fine-tuning job
      description: Start a fine-tuning job, optionally creating a version of a named model.
      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'
                  validation_fraction:
                    type: number
                    title: Validation Fraction
                  model_name:
                    anyOf:
                      - type: string
                      - type: 'null'
                    title: Model Name
                  parent:
                    anyOf:
                      - type: string
                      - type: 'null'
                    title: Parent
                  replay:
                    type: number
                    title: Replay
                  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
                  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 promotion 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
                  base_model:
                    type: string
                    title: Base Model
                  base_revision:
                    type: string
                    title: Base Revision
                  base_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                    title: Base Id
                  initialization:
                    anyOf:
                      - additionalProperties: true
                        type: object
                      - type: 'null'
                    title: Initialization
                  base_artifact_sha256:
                    anyOf:
                      - type: string
                      - type: 'null'
                    title: Base Artifact Sha256
                  compute_dtype:
                    type: string
                    title: Compute Dtype
                  layout:
                    type: string
                    title: Layout
                  limits:
                    additionalProperties:
                      type: integer
                    type: object
                    title: Limits
                  full_spec_sha256:
                    type: string
                    title: Full Spec Sha256
                  split:
                    additionalProperties:
                      type: integer
                    type: object
                    title: Split
                  lineage:
                    anyOf:
                      - additionalProperties: true
                        type: object
                      - type: 'null'
                    title: Lineage
                  price_cents:
                    type: integer
                    title: Price Cents
                type: object
                required:
                  - id
                  - dataset_id
                  - model
                  - method
                  - hyperparameters
                  - validation_fraction
                  - model_name
                  - parent
                  - replay
                  - status
                  - created_at
                  - updated_at
                  - attempts
                  - output_model
                  - metrics
                  - error
                  - progress
                  - base_model
                  - base_revision
                  - base_id
                  - initialization
                  - base_artifact_sha256
                  - compute_dtype
                  - layout
                  - limits
                  - full_spec_sha256
                  - split
                  - lineage
                  - price_cents
                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
        model:
          type: string
          enum:
            - sqwish-d1-core
            - sqwish-d1-bit
            - sqwish-d1-dot
          title: Model
          default: sqwish-d1-core
        method:
          type: string
          enum:
            - sft
            - reward
          title: Method
          default: sft
        hyperparameters:
          $ref: '#/components/schemas/Hyperparameters'
        validation_fraction:
          type: number
          maximum: 0.5
          minimum: 0.1
          title: Validation Fraction
          default: 0.2
        model_name:
          anyOf:
            - type: string
              pattern: ^[a-z][a-z0-9-]{1,62}$
            - type: 'null'
          title: Model Name
        parent:
          anyOf:
            - type: string
              maxLength: 140
              minLength: 1
            - type: 'null'
          title: Parent
        replay:
          type: number
          maximum: 4
          minimum: 0
          title: Replay
          default: 1
      additionalProperties: false
      type: object
      required:
        - dataset_id
      title: JobCreate
    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
    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
        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.

````