# Get Finetune Status

`GET /v1/finetune/{job_id}`

Get the status of a finetune job from the pipeline API.

- Base URL: `https://api.qualia.dev`
- Authentication: an API key in the `X-API-Key` header, or `Authorization: Bearer …`

## Parameters

- `job_id` (path, string (uuid), required)

## Responses

- `200` Job status retrieved successfully: `application/json` `FinetuneStatusResponse`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `404` Finetune job not found: `application/json` `ErrorResponse`
- `422` Validation error

## Schemas

```yaml
FinetuneStatusResponse:
  properties:
    job_id:
      type: string
      format: uuid
      description: Unique job identifier
    audience:
      type: string
      enum:
        - internal
        - public
      default: internal
    pipeline_name:
      description: The name of the pipeline template the job runs
      type:
        - string
        - "null"
    project_id:
      description: Project associated with the training run
      format: uuid
      type:
        - string
        - "null"
    current_op:
      type: string
      description: Current op name (the op_type, or a terminal pseudo-state)
    status:
      type: string
      description: "Overall job status: queued, scheduled, running, completed, failed, cancelled"
    metadata:
      $ref: "#/components/schemas/FinetunePublicMetadata"
    ops:
      items:
        $ref: "#/components/schemas/Op"
      type: array
      description: Op history in chronological order
    maps:
      items:
        $ref: "#/components/schemas/MapProgress"
      type: array
      description: "Progress of each map node: the run's per-item fan-outs. A map is one row in ops; its items are paged separately."
    telemetry:
      items:
        additionalProperties: true
        type: object
      type: array
      description: Training telemetry points (loss, gradient norm, learning rate, …) recorded so far, oldest first. Replayed from persisted events so a page load reconstructs the full series without the live SSE stream.
    failure_cause:
      description: "Who caused a failed job. `user`: something you set or authored (the dataset version, a parameter, a field of your pipeline, or your pipeline's wiring) made it fail; its usage is charged, up to the reservation. `platform`: anything else, including a failure with no recorded cause; its credits are refunded in full. None when the job did not fail."
      nullable: true
      type: string
      enum:
        - user
        - platform
    failure_subject:
      description: "What of yours caused a `user` failure: `dataset_version:<id>`, `parameter:<name>`, `config:<node>.<port>` or `pipeline_template:<id>`"
      type:
        - string
        - "null"
    failure_reason:
      description: Why it failed, for a `user` failure
      type:
        - string
        - "null"
    billing_mode:
      type: string
      enum:
        - legacy
        - run
      description: Billed per run (its bound held at start) or by its credit nodes
      default: legacy
    settlement_pending:
      type: boolean
      description: An ended run billed per run whose settlement is still to land
      default: false
    credits:
      description: The job's credit settlement, once it has ended and settled
      nullable: true
      allOf:
        - $ref: "#/components/schemas/CreditReceipt"
  type: object
  required:
    - job_id
    - current_op
    - status
  title: FinetuneStatusResponse
  description: Detailed status of a finetune job.
FinetunePublicMetadata:
  properties:
    job_desc:
      maxLength: 1024
      type:
        - string
        - "null"
    vla_type:
      nullable: true
      type: string
      enum:
        - act
        - pi05
        - smolvla
        - sarm
    job_type:
      nullable: true
      type: string
      enum:
        - vla
        - reward
        - vla_w_reward
    model_name:
      maxLength: 193
      type:
        - string
        - "null"
    dataset_version_id:
      format: uuid
      type:
        - string
        - "null"
    base_model:
      nullable: true
      allOf:
        - $ref: "#/components/schemas/PublicModelIdentity"
    reward_model:
      nullable: true
      allOf:
        - $ref: "#/components/schemas/PublicModelIdentity"
    use_rabc:
      type: boolean
      default: false
    training_hours:
      maximum: 168
      exclusiveMinimum: 0
      type:
        - number
        - "null"
    batch_size:
      maximum: 512
      minimum: 1
      type:
        - integer
        - "null"
    instance_type:
      maxLength: 128
      type:
        - string
        - "null"
    region:
      maxLength: 128
      type:
        - string
        - "null"
    created_at:
      format: date-time
      type:
        - string
        - "null"
  additionalProperties: false
  type: object
  title: FinetunePublicMetadata
  description: |-
    Fixed public projection of durable pipeline inputs.

    Storage locations, read capabilities, internal principals, compute
    overrides, and the raw run snapshot are deliberately not representable.
PublicModelIdentity:
  properties:
    hub_id:
      type: string
      maxLength: 193
      minLength: 3
    revision:
      type: string
      pattern: ^[0-9a-f]{40}$
  additionalProperties: false
  type: object
  required:
    - hub_id
    - revision
  title: PublicModelIdentity
  description: Immutable external model identity safe to return to clients.
Op:
  properties:
    name:
      type: string
      description: Op name (the op_type)
    op_run_id:
      description: Identity of this op instance
      type:
        - string
        - "null"
    node_id:
      description: Template node for this instance
      type:
        - string
        - "null"
    label:
      description: Human display label from the op's template
      type:
        - string
        - "null"
    started_message:
      description: Template copy for the started event (clients reuse it for live SSE lines so fetch and stream read identically)
      type:
        - string
        - "null"
    completed_message:
      description: Template copy for the completed event
      type:
        - string
        - "null"
    status:
      type: string
      description: "Op status: pending, queued, in_progress, completed, failed"
    started_at:
      description: When the op started
      format: date-time
      type:
        - string
        - "null"
    completed_at:
      description: When the op completed
      format: date-time
      type:
        - string
        - "null"
    events:
      items:
        $ref: "#/components/schemas/OpEvent"
      type: array
      description: Events in this phase
    error:
      description: Error message if phase failed
      type:
        - string
        - "null"
    failure_cause:
      description: "Who caused this op's failure: `user` (something you set or authored) or `platform` (ours). None when it did not fail."
      nullable: true
      type: string
      enum:
        - user
        - platform
    failure_subject:
      description: What of yours caused it, when `user`
      type:
        - string
        - "null"
  type: object
  required:
    - name
    - status
  title: Op
  description: |-
    One pipeline op as rendered in the execution timeline (1:1 with op_runs);
    ``name`` is the op_type, ``label`` its template display name. Two nodes
    may run the same op_type; ``op_run_id`` identifies each instance.
OpEvent:
  properties:
    status:
      description: "Event status: started, completed, failed"
      type:
        - string
        - "null"
    message:
      description: Event message
      type:
        - string
        - "null"
    error:
      description: Error details if failed
      type:
        - string
        - "null"
    timestamp:
      type: string
      format: date-time
      description: Event timestamp
    retry_attempt:
      type: integer
      description: Retry attempt number
      default: 0
    data:
      description: Additional event data
      nullable: true
      additionalProperties: true
      type: object
  type: object
  required:
    - status
    - timestamp
  title: OpEvent
  description: A single event within a phase.
MapProgress:
  properties:
    op_run_id:
      type: string
      format: uuid
      description: The map's own op run (its row in ops)
    node_id:
      type: string
      description: The map node in the template
    counts:
      $ref: "#/components/schemas/MapItemCounts"
    kind:
      type: string
      enum:
        - map
        - pipeline
      description: A map (one body per item) or a nested pipeline (one body)
      default: map
  type: object
  required:
    - op_run_id
    - node_id
    - counts
  title: MapProgress
  description: |-
    A map node's progress: the op (op_type ``map``) it runs as, and its
    items by status. Its items are paged from
    ``GET /v1/runs/{job_id}/maps/{op_run_id}/items``.
MapItemCounts:
  properties:
    total:
      type: integer
      default: 0
    pending:
      type: integer
      default: 0
    running:
      type: integer
      default: 0
    completed:
      type: integer
      default: 0
    failed:
      type: integer
      default: 0
    cancelled:
      type: integer
      default: 0
    skipped:
      type: integer
      default: 0
  type: object
  title: MapItemCounts
  description: How a map's items ended so far, by the status of their latest attempt.
CreditReceipt:
  properties:
    reserved:
      type: integer
      description: Credits reserved when the job started
    charged:
      type: integer
      description: Credits charged
    refunded:
      type: integer
      description: Credits returned to your balance
    reason:
      description: Why the job was charged or refunded
      type:
        - string
        - "null"
  type: object
  required:
    - reserved
    - charged
    - refunded
  title: CreditReceipt
  description: What a finished job was charged and refunded, and why.
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
```
