{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/made-app/json-schema/made-app-job-schema.json",
  "title": "Job",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/made-app-openapi.json#/components/schemas/Job",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "id",
    "status",
    "model",
    "costCents",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "image",
        "video",
        "audio"
      ]
    },
    "model": {
      "type": "string"
    },
    "toolId": {
      "type": "string",
      "description": "The tool that made this job, when one did."
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "processing",
        "succeeded",
        "failed",
        "canceled"
      ]
    },
    "progress": {
      "type": "number",
      "minimum": 0,
      "maximum": 100
    },
    "costCents": {
      "type": "number",
      "description": "The charge in cents. Refunded automatically if the job fails or is canceled."
    },
    "inputs": {
      "type": "object",
      "additionalProperties": true,
      "description": "The settings the job ran with."
    },
    "result": {
      "type": "object",
      "properties": {
        "assets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Asset"
          }
        },
        "data": {
          "type": "object",
          "additionalProperties": true,
          "description": "Output that isn't a file, such as a voiceover's word timings."
        }
      }
    },
    "error": {
      "type": "string",
      "description": "Why the job failed."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "Asset": {
      "type": "object",
      "required": [
        "type",
        "url"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "image",
            "video",
            "audio"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Signed download URL, re-signed on every read of the job."
        },
        "thumbnailUrl": {
          "type": "string",
          "format": "uri"
        },
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        },
        "durationSec": {
          "type": "number"
        }
      }
    }
  }
}