{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vidplate-app/json-schema/vidplate-app-render-schema.json",
  "title": "Render",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vidplate-app-openapi.json#/components/schemas/Render",
  "type": "object",
  "properties": {
    "object": {
      "const": "render"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "queued",
        "waiting_for_node",
        "rendering",
        "completed",
        "failed",
        "cancelled",
        "expired"
      ]
    },
    "kind": {
      "enum": [
        "static",
        "video"
      ]
    },
    "waiting_reason": {
      "enum": [
        "no_node_online",
        "no_capable_node_online"
      ],
      "description": "Only while waiting_for_node: no render node is online, or none online can make its outputs (size, frame rate or codec)."
    },
    "template_id": {
      "type": "string"
    },
    "template_version": {
      "type": [
        "integer",
        "null"
      ]
    },
    "brand_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "batch_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "external_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": "object"
    },
    "render_preset": {
      "type": [
        "string",
        "null"
      ],
      "description": "The render_preset code the render was created with. Only present when one was sent."
    },
    "output_count": {
      "type": "integer"
    },
    "progress": {
      "$ref": "#/$defs/RenderProgress"
    },
    "outputs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RenderOutput"
      }
    },
    "ai_credits": {
      "type": "object",
      "description": "AI credits for this render. Captions on API renders cost 1 AI credit per captioned output, charged when the render is created, every time (a cached transcript or the same video in several formats is still charged per output). An output that fails, expires or is cancelled before its captions are made gets its credit back.",
      "properties": {
        "charged": {
          "type": "number",
          "description": "Every credit charged, retries included."
        },
        "refunded": {
          "type": "number",
          "description": "Credits given back."
        },
        "net": {
          "type": "number",
          "description": "What the render cost: charged minus refunded."
        },
        "captioned_outputs": {
          "type": "integer",
          "description": "Outputs with captions."
        }
      }
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "cancelled_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "deadline_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "app_url": {
      "type": "string"
    },
    "routing": {
      "type": "object",
      "properties": {
        "renderer": {
          "type": "string"
        },
        "nodes_online": {
          "type": "integer"
        }
      }
    }
  },
  "$defs": {
    "RenderOutput": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "format": {
          "type": "string"
        },
        "variant_index": {
          "type": "integer"
        },
        "duration_seconds": {
          "type": [
            "number",
            "null"
          ]
        },
        "width": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Real pixels (also for the plain ratio formats, which older responses gave as ratio numbers such as 9 x 16)."
        },
        "height": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Real pixels."
        },
        "resolution": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "720p",
            "1080p",
            "1440p",
            "2160p",
            null
          ],
          "description": "The resolution asked for (short edge). Null: the format's own size."
        },
        "preset": {
          "type": "string",
          "description": "Video, when a platform preset was used."
        },
        "fps": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Video: the frame rate. Null until the render starts when none was asked for (the template's own)."
        },
        "codec": {
          "enum": [
            "h264",
            "hevc",
            "vp9",
            "av1"
          ],
          "description": "Video only."
        },
        "container": {
          "enum": [
            "mp4",
            "webm"
          ],
          "description": "Video only."
        },
        "quality": {
          "enum": [
            "standard",
            "high",
            "max"
          ],
          "description": "Video only."
        },
        "video_bitrate_kbps": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Video: the bitrate the file was encoded at, reported when it finished. Null until then."
        },
        "max_file_size_mb": {
          "type": [
            "number",
            "null"
          ],
          "description": "Video: the size cap asked for (directly or by a preset)."
        },
        "audio": {
          "type": "object",
          "description": "Video only: mode, channels, sample_rate and bitrate_kbps, as delivered when known. mode is include, mute, or none when the finished file has no audio track because the template has no sound.",
          "properties": {
            "mode": {
              "enum": [
                "include",
                "mute",
                "none"
              ]
            },
            "channels": {
              "type": [
                "string",
                "null"
              ]
            },
            "sample_rate": {
              "type": [
                "integer",
                "null"
              ]
            },
            "bitrate_kbps": {
              "type": [
                "integer",
                "null"
              ]
            }
          }
        },
        "image_format": {
          "enum": [
            "png",
            "jpg",
            "webp"
          ],
          "description": "Static only."
        },
        "image_quality": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Static jpg or webp only."
        },
        "mime_type": {
          "enum": [
            "video/mp4",
            "video/webm",
            "image/png",
            "image/jpeg",
            "image/webp"
          ]
        },
        "status": {
          "enum": [
            "queued",
            "waiting_for_node",
            "rendering",
            "completed",
            "failed",
            "cancelled",
            "expired"
          ]
        },
        "failure_code": {
          "enum": [
            "render_failed",
            "file_size_limit_unreachable"
          ],
          "description": "Failed outputs only. file_size_limit_unreachable: the file was still over max_file_size_mb after a second encode at a lower bitrate."
        },
        "completed_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "retention_expires_at": {
          "type": [
            "string",
            "null"
          ],
          "description": "File retention deadline for a new managed API output; null means keep. Separate from signed download URL expiry."
        },
        "file_expired_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "file_available": {
          "type": "boolean"
        },
        "stored_bytes": {
          "type": [
            "integer",
            "null"
          ]
        },
        "destination": {
          "type": [
            "object",
            "null"
          ],
          "description": "Bring your own storage: where this output is delivered. Only on renders that use a storage destination.",
          "properties": {
            "status": {
              "enum": [
                "pending",
                "delivered",
                "failed"
              ]
            },
            "copy_mode": {
              "enum": [
                "safety_buffer",
                "none",
                "retain"
              ]
            },
            "bucket": {
              "type": [
                "string",
                "null"
              ]
            },
            "key": {
              "type": [
                "string",
                "null"
              ]
            },
            "url_hint": {
              "type": [
                "string",
                "null"
              ],
              "description": "s3://bucket/key. Not a link: the file is private in your bucket."
            },
            "etag": {
              "type": [
                "string",
                "null"
              ]
            },
            "size_bytes": {
              "type": [
                "integer",
                "null"
              ]
            },
            "delivered_at": {
              "type": [
                "string",
                "null"
              ]
            },
            "failure_code": {
              "type": [
                "string",
                "null"
              ],
              "description": "For example permission_denied, destination_key_exists, buffer_expired, destination_deleted."
            },
            "failure_reason": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "render_preset": {
          "type": [
            "string",
            "null"
          ],
          "description": "The 3D render preset this output uses (its own, or the render's). Only present when the render or the output named one; null when this output opted out."
        },
        "render_preset_applied": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "true: the preset's 3D settings are used for this output. false: the template has no 3D content (or makes images), so the preset was accepted and ignored. null: no preset."
        },
        "download_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Only from GET /renders/{render_id}/outputs. Null with copy_mode none (the file is only in your storage)."
        },
        "expires_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "file_name": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "RenderProgress": {
      "type": "object",
      "required": [
        "completed",
        "failed",
        "total",
        "percent"
      ],
      "description": "Progress across the render's outputs, for static and video renders alike.",
      "properties": {
        "completed": {
          "type": "integer",
          "description": "Outputs finished with a file."
        },
        "failed": {
          "type": "integer",
          "description": "Outputs that failed."
        },
        "total": {
          "type": "integer",
          "description": "Every output of the render."
        },
        "percent": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "The share of outputs finished either way (completed + failed), rounded down."
        }
      }
    }
  }
}