{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/octen-ai/json-schema/octen-ai-video-task-schema.json",
  "title": "VideoTask",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/octen-ai-videos-api-openapi.yml#/components/schemas/VideoTask",
  "type": "object",
  "required": [
    "id",
    "model",
    "status",
    "created"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique task id, used to download the video."
    },
    "model": {
      "type": "string",
      "description": "The model used for this task."
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "in_progress",
        "completed",
        "failed"
      ],
      "description": "Task state."
    },
    "created": {
      "type": "integer",
      "description": "Unix timestamp in seconds when the task was created."
    },
    "video_url": {
      "type": "string",
      "description": "Signed download URL for the video file, present when `status` is `completed`. Valid for 7 days after generation."
    },
    "expires_at": {
      "type": "integer",
      "description": "Unix timestamp in seconds when `video_url` expires. Present when `status` is `completed`."
    },
    "duration": {
      "type": "integer",
      "description": "Length of the generated video in seconds. Present when `status` is `completed`."
    },
    "resolution": {
      "type": "string",
      "description": "Resolution of the generated video. Present when `status` is `completed`."
    },
    "usage": {
      "$ref": "#/$defs/VideoUsage"
    },
    "error": {
      "type": "string",
      "description": "Failure reason, present when `status` is `failed`."
    },
    "code": {
      "type": "string",
      "description": "Machine-readable failure code, present when `status` is `failed`."
    }
  },
  "$defs": {
    "VideoUsage": {
      "type": "object",
      "description": "Metering for the task. Present only when `status` is `completed`.",
      "properties": {
        "video_seconds": {
          "type": "integer",
          "description": "Video length in seconds."
        },
        "video_tokens": {
          "type": "integer",
          "description": "Billed token count."
        },
        "input_image_count": {
          "type": "integer",
          "description": "Number of input images, returned when images were supplied."
        }
      }
    }
  }
}