{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lazybird-app/json-schema/lazybird-app-job-schema.json",
  "title": "Job",
  "description": "Fields without a value are left out",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lazybird-app-jobs-api-openapi.yml#/components/schemas/Job",
  "type": "object",
  "required": [
    "id",
    "kind",
    "status",
    "pool",
    "input",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "kind": {
      "$ref": "#/$defs/JobKind"
    },
    "status": {
      "$ref": "#/$defs/JobStatus"
    },
    "pool": {
      "$ref": "#/$defs/JobPool"
    },
    "input": {
      "type": "object",
      "additionalProperties": true,
      "description": "What the job was asked for, as it was submitted"
    },
    "output": {
      "type": "object",
      "description": "What the job made, once it is `completed`",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The file, for `video`, `avatar`, `image` and `music`"
        },
        "data": {
          "description": "What a reading found: the text and word timings (`transcript`, `timings`), the faces (`faces`), `nsfw` and its score (`safety`), or the languages heard, best first (`language`)"
        },
        "seconds": {
          "type": "number",
          "description": "The output's own length"
        },
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        },
        "lastFrameUrl": {
          "type": "string",
          "format": "uri",
          "description": "The clip's last frame as a picture, for `avatar` and `video`: what the next clip opens on to carry on (`firstFrame: { jobId }`, or a `video` job's `imageUrl`)"
        }
      }
    },
    "assetId": {
      "type": "string",
      "description": "The asset its file is, once a job that makes a file has `completed`"
    },
    "credits": {
      "type": "number",
      "description": "What the job was charged, on what it delivered and never more than a clip held at the start: video credits for a render, voice credits for a song"
    },
    "error": {
      "type": "string",
      "description": "Why a `failed` job failed"
    },
    "firstFrameUrl": {
      "type": "string",
      "format": "uri",
      "description": "For `avatar`: the picture the clip opens on, settled when it was asked for — the still picked for it (one the clip renders first is at this address once the avatar's `stills` list it), the one named, or the frame handed in"
    },
    "readyAt": {
      "type": "string",
      "format": "date-time",
      "description": "When a `queued` or `running` job should be ready, worked out from the work ahead of it in its pool and the GPUs running that pool; moves as the queue does"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "JobKind": {
      "type": "string",
      "enum": [
        "video",
        "avatar",
        "avatar-setup",
        "image",
        "music",
        "transcript",
        "timings",
        "faces",
        "safety",
        "language"
      ],
      "description": "`video` a clip that brings a picture to life (on `h3`, 1 video credit a second at `720p` and `1080p`, half at `480p`; `h3-lite` half of that; up to 60 s); `avatar` one of your avatars speaking a clip (1 credit a second at `720p`, half at `480p`, 2 at `1080p`; as long as what it says); `avatar-setup` makes an avatar from a picture (10 credits — `POST /avatars` submits it); `image` a still (3 credits); `music` a song from a style and lyrics, or an instrumental (10 voice credits a second, up to 300 s); `transcript`, `timings`, `faces`, `safety` and `language` read a file and are free."
    },
    "JobPool": {
      "type": "string",
      "enum": [
        "priority",
        "offpeak"
      ],
      "default": "priority",
      "description": "Which GPUs run the job, and for a render which video-credit pool pays: `priority` starts it now on rented capacity, `offpeak` waits for our own GPUs to be idle."
    },
    "JobStatus": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "completed",
        "failed",
        "cancelled"
      ]
    }
  }
}