{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pennycompute-com/json-schema/pennycompute-com-job-schema.json",
  "title": "Job",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pennycompute-com-openapi.json#/components/schemas/Job",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "service_id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "active",
        "cancelling",
        "succeeded",
        "failed",
        "cancelled",
        "expired"
      ],
      "description": "queued: accepted and waiting for a renderer; it occupies no slot. active: a renderer is working on it. cancelling: cancellation was requested while it was running. succeeded: final; the output is ready and the job is charged. failed: final; not charged. cancelled: final; not charged. expired: final; no renderer took it within max_wait_seconds (failure_code no_capacity); not charged."
    },
    "failure_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "Why a job did not succeed; null otherwise. On failed: download_failed (a link could not be fetched), invalid_input (the media does not fit the input, for example a required sound stream is missing), runner_failed (the render program failed), upload_failed (the finished file could not be stored), lease_expired (the renderer stopped answering), provider_offline (the renderer went away), internal_error (a fault on our side), commit_conflict (the job was finished twice; rare), no_capacity (the job was given back unstarted; nothing was rendered or charged, so send the same job again. Rare: a renderer that has no room when offered a job returns it to the queue, where it waits out its max_wait_seconds). On expired: no_capacity (no renderer took the job within max_wait_seconds; it never started). On cancelled: buyer_cancelled."
    },
    "failure_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "A sentence beside failure_code saying what went wrong, for example which link could not be fetched."
    },
    "outstanding_micros": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Millionths of one US dollar"
    },
    "charged_fee_micros": {
      "type": [
        "string",
        "null"
      ],
      "description": "Final charge in millionths of a US dollar after successful completion."
    },
    "priority": {
      "type": "string"
    },
    "client_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "output_file": {
      "type": [
        "object",
        "null"
      ],
      "description": "What the finished file is. null until the output exists. The output link serves the file under this content type.",
      "properties": {
        "extension": {
          "type": "string",
          "enum": [
            "mp4",
            "webm",
            "mov",
            "png",
            "jpg",
            "webp",
            "json",
            "wav",
            "mp3",
            "m4a"
          ]
        },
        "content_type": {
          "type": "string",
          "description": "For example video/mp4 or video/webm."
        }
      }
    },
    "result": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Facts about the output, up to 64 KB, or null until the job completes: duration_seconds, width and height as measured (an image has width and height and no length), plus what the service reports. ffmpeg.timeline_export.v1 adds sound. ffmpeg.frames.v1 adds cells. ffmpeg.audio.v1 reports duration_seconds, sample_rate, channels, integrated_lufs and true_peak_dbtp. media.measure.v1 reports MeasureResult.",
      "properties": {
        "duration_seconds": {
          "type": "number"
        },
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        },
        "sound": {
          "type": "object",
          "description": "The sound report of a timeline export, measured on the finished file.",
          "properties": {
            "codec": {
              "type": "string"
            },
            "sample_rate": {
              "type": "integer"
            },
            "channels": {
              "type": "integer"
            },
            "bitrate_kbps": {
              "type": "number",
              "description": "The measured bitrate of the stream, not the one asked for. A silent or nearly silent mix measures very low, a few kbps, whatever bitrate was asked for."
            },
            "duration_seconds": {
              "type": "number"
            },
            "true_peak_dbtp": {
              "type": [
                "number",
                "null"
              ]
            },
            "integrated_lufs": {
              "type": [
                "number",
                "null"
              ]
            },
            "peak_correction_db": {
              "type": "number",
              "description": "How much lower the final encode is than the first."
            },
            "correction_passes": {
              "type": "integer",
              "description": "How many times the sound was encoded again."
            }
          }
        },
        "resolved_props": {
          "description": "For remotion.render.v1 with resolved_props: the resolved props of the named composition, or the value at prop inside them. Any JSON."
        },
        "cells": {
          "type": "array",
          "description": "For ffmpeg.frames.v1: one entry per cell, with the seconds of the frame grabbed from a video, or null for an image.",
          "items": {
            "type": "object",
            "properties": {
              "seconds": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the job was submitted."
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When a renderer first took the job, or null while none has. A job that expired with no_capacity, or was cancelled while queued, keeps null. A job tried again on another renderer keeps the first time."
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the job reached succeeded, failed, cancelled or expired, or null until then. Date a charge by this."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the job last changed. On a finished job this is the moment it ended, the same as completed_at: nothing changes it afterwards."
    }
  },
  "required": [
    "id",
    "service_id",
    "status"
  ]
}