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

# Keep a family warm

> Keep the model a family serves loaded between requests, or stop. Switching on a family
that serves no model gets 409 family_empty, and one that is switched off 409 family_off.
With `served`, the id of the model it served when the caller looked, only while it still
serves that model: 409 served_changed otherwise. Keep warm follows the family when it
moves. `switch_off` stops keep warm on families or models in the same step and leaves
their switches on, so a request at the limit can swap. Past the account's limit, 409
warm_limit lists the models still kept warm after that, least recently used first
(`used_at`), each with the keep warms that hold it: its own (`keep_warm`) and its
families' (`families`). A size with no kept-warm place left answers 503 warm_capacity,
unless `switch_off` stops a model of that size.



## OpenAPI

````yaml /openapi.json post /v1/families/{family}/keep-warm
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/families/{family}/keep-warm:
    post:
      tags:
        - Families
      summary: Keep a family warm
      description: >-
        Keep the model a family serves loaded between requests, or stop.
        Switching on a family

        that serves no model gets 409 family_empty, and one that is switched off
        409 family_off.

        With `served`, the id of the model it served when the caller looked,
        only while it still

        serves that model: 409 served_changed otherwise. Keep warm follows the
        family when it

        moves. `switch_off` stops keep warm on families or models in the same
        step and leaves

        their switches on, so a request at the limit can swap. Past the
        account's limit, 409

        warm_limit lists the models still kept warm after that, least recently
        used first

        (`used_at`), each with the keep warms that hold it: its own
        (`keep_warm`) and its

        families' (`families`). A size with no kept-warm place left answers 503
        warm_capacity,

        unless `switch_off` stops a model of that size.
      operationId: keepFamilyWarm
      parameters:
        - name: family
          in: path
          required: true
          schema:
            type: string
            title: Family
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KeepWarm'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                properties:
                  continue:
                    anyOf:
                      - $ref: '#/components/schemas/Continuation'
                      - type: 'null'
                    description: >-
                      What continuing it would do now, from the family's dataset
                      and jobs. It doesn't check credit, storage allowance or
                      queue room, which the start refuses with
                      insufficient_credit, storage_allowance, queue_full or
                      tenant_queue_full. Null for a family with no dataset. A
                      list of families reads no dataset: there `new_data` and
                      `retry` only say a version no finished job used is
                      waiting, and the counts and fee are null. The answers of a
                      switch, keep warm or rollback leave it out.
                  id:
                    type: string
                    title: Id
                  object:
                    type: string
                    const: family
                    title: Object
                  switched_on:
                    type: boolean
                    title: Switched On
                    description: Whether calls to its name are answered.
                  used_at:
                    type: number
                    title: Used At
                    description: >-
                      Its idle clock: the latest of its last production call by
                      an API key that named it, its last evaluation that named
                      it, and when it was switched on.
                  switches_off_at:
                    anyOf:
                      - type: number
                      - type: 'null'
                    title: Switches Off At
                    description: >-
                      When idling switches it off unless it's used. Null while
                      it is off or kept warm on its own switch, and when idling
                      never switches anything off. A family's is also null while
                      it serves no model.
                  off_reason:
                    anyOf:
                      - type: string
                        enum:
                          - owner
                          - idle
                      - type: 'null'
                    title: Off Reason
                    description: >-
                      Why it is off: owner when it was switched off by hand,
                      idle when nothing used it for too long. Null otherwise.
                  off_at:
                    anyOf:
                      - type: number
                      - type: 'null'
                    title: Off At
                    description: When it went off, with off_reason. Null otherwise.
                  dataset_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                    title: Dataset Id
                    description: The dataset it grows on.
                  origin:
                    anyOf:
                      - type: string
                      - type: 'null'
                    title: Origin
                    description: 'Where it started: a base model, or one of your models.'
                  created_at:
                    type: number
                    title: Created At
                    description: When it was named, as its first fine-tune was queued.
                  served:
                    anyOf:
                      - $ref: '#/components/schemas/ModelVersion'
                      - type: 'null'
                    description: >-
                      The model calls to its name get while it is switched on,
                      or null for none yet.
                  latest:
                    anyOf:
                      - $ref: '#/components/schemas/ModelVersion'
                      - type: 'null'
                    description: Its newest model, neither deleted nor discarded.
                  models:
                    items:
                      anyOf:
                        - $ref: '#/components/schemas/ModelVersion'
                        - $ref: '#/components/schemas/DeletedModelVersion'
                    type: array
                    title: Models
                    description: >-
                      Every model of its line, oldest first. A deleted one shows
                      only where it stood.
                  keep_warm:
                    type: boolean
                    title: Keep Warm
                  keep_warm_window:
                    anyOf:
                      - $ref: '#/components/schemas/KeepWarmWindow'
                      - type: 'null'
                    description: >-
                      The hour of keep warm being billed for the model the
                      family serves, while the family is kept warm. Null
                      otherwise: a model kept warm on its own shows its own
                      hour.
                  keep_warm_stopped_at:
                    anyOf:
                      - type: number
                      - type: 'null'
                    title: Keep Warm Stopped At
                    description: >-
                      When keep warm switched off because the next hour couldn't
                      be reserved, while it stays off. Otherwise null.
                  move:
                    anyOf:
                      - $ref: '#/components/schemas/FamilyMove'
                      - type: 'null'
                    description: >-
                      The move to its latest model it waits to make, and what it
                      waits for. Null while it serves its latest model, or is
                      switched off.
                  moved:
                    anyOf:
                      - $ref: '#/components/schemas/FamilyMoved'
                      - type: 'null'
                    description: >-
                      When it last moved by itself to the model it serves, and
                      from which. Null when it never did, or serves another
                      model or was rolled back since.
                  jobs:
                    items:
                      $ref: '#/components/schemas/FamilyJob'
                    type: array
                    title: Jobs
                    description: >-
                      Its fine-tunes, newest first, with how each ended. Lists
                      of families, and the answers of a switch, keep warm or
                      rollback, leave it out.
                type: object
                required:
                  - id
                  - object
                  - switched_on
                  - used_at
                  - switches_off_at
                  - off_reason
                  - off_at
                  - dataset_id
                  - origin
                  - created_at
                  - served
                  - latest
                  - models
                  - keep_warm
                  - keep_warm_window
                  - keep_warm_stopped_at
                  - move
                  - moved
                title: Family
        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:
    KeepWarm:
      properties:
        enabled:
          type: boolean
          title: Enabled
        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 the first hour, which switching keep
            warm on holds, 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.
        served:
          anyOf:
            - type: string
              maxLength: 140
            - type: 'null'
          title: Served
          description: >-
            The id of the model the family served when the caller looked:
            refused unless it still does. Null for none.
        switch_off:
          items:
            type: string
          type: array
          maxItems: 20
          title: Switch Off
          description: >-
            Families, such as router, and models, such as router@2, whose keep
            warm stops in the same step, to make room when the account is at its
            limit (warm_limit) or the model's size has no kept-warm place left
            (warm_capacity). Their switches stay on.
      additionalProperties: false
      type: object
      required:
        - enabled
      title: KeepWarm
    Continuation:
      properties:
        state:
          type: string
          enum:
            - new_data
            - retry
            - no_new_data
            - not_enough_evaluation_data
            - queued
            - training
            - origin_gone
            - dataset_deleted
            - dataset_archived
            - fine_tuning_off
          title: State
          description: >-
            `new_data` when it can start on a version no finished job of the
            family used, and `retry` when it can start on the version its last
            run failed or was cancelled on. Otherwise what refuses it now: no
            training rows newer than the family last trained on, fewer
            evaluation decisions than its gate needs, a fine-tune of the family
            queued or training, an empty family whose origin model was deleted
            or discarded, its dataset deleted or archived, or fine-tuning off on
            this server. A family whose dataset was deleted never continues
            again: start a new family from its latest model.
        version:
          type: integer
          title: Version
          description: 'The dataset version a continuation trains on: its newest.'
        added_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Added At
          description: When that version was added.
        added_from:
          anyOf:
            - type: string
            - type: 'null'
          title: Added From
          description: The family whose page added that version, or null when none did.
        evaluation_decisions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Evaluation Decisions
          description: >-
            The evaluation decisions about new contexts its gate could judge.
            Null while a job is queued or training, and when it is refused
            whatever the data.
        needed:
          type: integer
          title: Needed
          description: How many of those the gate needs.
        rows:
          anyOf:
            - $ref: '#/components/schemas/ContinueRows'
            - type: 'null'
          description: The rows it would take. Null when evaluation_decisions is.
        price_usd:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Usd
          description: >-
            The exact fee a continuation would hold now, as USD. Null unless it
            can start.
      type: object
      required:
        - state
        - version
        - added_at
        - added_from
        - evaluation_decisions
        - needed
        - rows
        - price_usd
      title: Continuation
    ModelVersion:
      properties:
        version:
          type: integer
          title: Version
        ref:
          type: string
          title: Ref
        adapter:
          type: string
          title: Adapter
        status:
          type: string
          title: Status
        discarded_at:
          type: number
          title: Discarded At
        on_at:
          anyOf:
            - type: number
            - type: 'null'
          title: On At
          description: >-
            When its own switch went on, so it answers calls to its number. Null
            while off.
        keep_warm:
          type: boolean
          title: Keep Warm
          description: Whether it is kept warm on its own switch.
        keep_warm_stopped_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Keep Warm Stopped At
          description: >-
            When its own keep warm switched off because the next hour couldn't
            be reserved, while it stays off. Otherwise null.
        used_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Used At
          description: >-
            Its idle clock: the latest of its last production call by an API key
            that named it, its last evaluation that named it, and when it was
            switched on.
        switches_off_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Switches Off At
          description: >-
            When idling switches it off unless it's used. Null while it is off
            or kept warm on its own switch, and when idling never switches
            anything off. A family's is also null while it serves no model.
        off_reason:
          anyOf:
            - type: string
              enum:
                - owner
                - idle
            - type: 'null'
          title: Off Reason
          description: >-
            Why it is off: owner when it was switched off by hand, idle when
            nothing used it for too long. Null otherwise.
        off_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Off At
          description: When it went off, with off_reason. Null otherwise.
        state:
          anyOf:
            - type: string
              enum:
                - loaded
                - loading
                - asleep
            - type: 'null'
          title: State
        parent:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent
        created_at:
          anyOf:
            - type: number
            - type: 'null'
          title: Created At
        gate:
          anyOf:
            - $ref: '#/components/schemas/Gate'
            - type: 'null'
        heldout:
          additionalProperties:
            type: number
          type: object
          title: Heldout
      type: object
      required:
        - version
        - ref
        - adapter
        - status
        - on_at
        - keep_warm
        - keep_warm_stopped_at
        - used_at
        - switches_off_at
        - off_reason
        - off_at
        - state
        - parent
        - created_at
        - gate
        - heldout
      title: ModelVersion
    DeletedModelVersion:
      properties:
        version:
          type: integer
          title: Version
        ref:
          type: string
          title: Ref
        adapter:
          type: string
          title: Adapter
        parent:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent
          description: The id of the model it trained from, or null from a base.
        status:
          type: string
          const: deleted
          title: Status
        deleted_at:
          type: number
          title: Deleted At
      type: object
      required:
        - version
        - ref
        - adapter
        - parent
        - status
        - deleted_at
      title: DeletedModelVersion
      description: >-
        A model you deleted, as its family's line shows it: where it stood, and
        when it went.
    KeepWarmWindow:
      properties:
        started_at:
          type: number
          title: Started At
        ends_at:
          type: number
          title: Ends At
          description: When this hour's hold ends and the next is reserved.
        reserved_usd:
          type: string
          title: Reserved Usd
          description: >-
            The hour's fee held, as exact USD. The minutes used are charged when
            the hour rolls over or keep warm is switched off.
      type: object
      required:
        - started_at
        - ends_at
        - reserved_usd
      title: KeepWarmWindow
    FamilyMove:
      properties:
        to:
          type: string
          title: To
          description: The model it moves to, its latest, such as router@5.
        waiting_for:
          type: string
          enum:
            - place
            - warm_place
            - warm_capacity
            - engines
          title: Waiting For
          description: >-
            `place` while the account has no place left for the move, which
            takes one only if the model the family serves keeps answering by its
            own switch, or it serves none yet. The move waits until a model is
            switched off or the tier goes up. A kept-warm family takes a warm
            place only if the model it serves stays warm by its own keep warm.
            `warm_place` while the account keeps as many models warm as its tier
            allows. That wait ends when a model's keep warm is turned off or the
            tier goes up. `warm_capacity` while the model's size has no
            kept-warm place free on our engines. That wait ends when one frees.
            Turning the family's keep warm off ends either wait. `engines`
            otherwise: the model loads, or waits to be tried again after a
            failed load.
        reason:
          anyOf:
            - type: string
              enum:
                - live_limit
                - warm_limit
                - warm_capacity
            - type: 'null'
          title: Reason
          description: >-
            The code of the refusal that holds a waiting move: `live_limit` for
            `place`, `warm_limit` for `warm_place` and `warm_capacity` for
            `warm_capacity`, as switching on, keep warm and rollback name them.
            Null while it waits for engines.
      type: object
      required:
        - to
        - waiting_for
        - reason
      title: FamilyMove
    FamilyMoved:
      properties:
        at:
          type: number
          title: At
          description: When it moved.
        from:
          anyOf:
            - type: string
            - type: 'null'
          title: From
          description: >-
            The model it served before, such as router@4, or null when it served
            none.
      type: object
      required:
        - at
        - from
      title: FamilyMoved
    FamilyJob:
      properties:
        id:
          type: string
          title: Id
        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: its model joined the family, failed its gate, the run
            failed or was cancelled, or a rollback discarded the model it made.
            Null while it runs.
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: >-
            Why it made no model, in one line: the gate's first reason, or the
            first line of the error of a run that failed. Otherwise null.
        dataset_version:
          type: integer
          title: Dataset Version
        output_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Output Model
        created_at:
          type: number
          title: Created At
        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 once
            training finishes, whatever the gate says, released if the run fails
            or is cancelled.
      type: object
      required:
        - id
        - status
        - outcome
        - reason
        - dataset_version
        - output_model
        - created_at
        - price_usd
        - charge
      title: FamilyJob
    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
    ContinueRows:
      properties:
        new:
          type: integer
          title: New
          description: Training rows added since the family last trained.
        earlier:
          type: integer
          title: Earlier
          description: Earlier training rows sampled to train on with them.
        evaluation:
          type: integer
          title: Evaluation
          description: Evaluation rows its gate would measure on.
      type: object
      required:
        - new
        - earlier
        - evaluation
      title: ContinueRows
    Gate:
      properties:
        passed:
          type: boolean
          title: Passed
        against:
          type: string
          enum:
            - parent
            - base
          title: Against
        reasons:
          items:
            type: string
          type: array
          title: Reasons
        groups:
          additionalProperties:
            additionalProperties: true
            type: object
          type: object
          title: Groups
        deltas:
          additionalProperties:
            type: number
          type: object
          title: Deltas
        ece:
          additionalProperties:
            anyOf:
              - type: number
              - type: 'null'
          type: object
          title: Ece
      type: object
      required:
        - passed
        - against
        - reasons
      title: Gate
    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.