{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aiand-com/json-schema/aiand-com-upload-object-schema.json",
  "title": "UploadObject",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aiand-com-uploads-api-openapi.yml#/components/schemas/UploadObject",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Stable upload session id with `upload-` prefix"
    },
    "object": {
      "type": "string",
      "const": "upload"
    },
    "bytes": {
      "type": "integer",
      "description": "Declared total size of the file being uploaded"
    },
    "created_at": {
      "type": "integer",
      "description": "Unix timestamp"
    },
    "expires_at": {
      "type": "integer",
      "description": "Unix timestamp (1 hour from creation by default)"
    },
    "filename": {
      "type": [
        "string",
        "null"
      ]
    },
    "purpose": {
      "type": "string",
      "enum": [
        "vision",
        "video",
        "audio",
        "document"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "completed",
        "cancelled",
        "expired",
        "failed"
      ]
    },
    "file": {
      "oneOf": [
        {
          "$ref": "#/$defs/FileObject"
        },
        {
          "type": "null"
        }
      ],
      "description": "Populated once status is `completed`"
    }
  },
  "required": [
    "id",
    "object",
    "bytes",
    "created_at",
    "expires_at",
    "filename",
    "purpose",
    "status",
    "file"
  ],
  "$defs": {
    "FileObject": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable file id with `file-` prefix"
        },
        "object": {
          "type": "string",
          "const": "file"
        },
        "bytes": {
          "type": "integer"
        },
        "created_at": {
          "type": "integer",
          "description": "Unix timestamp"
        },
        "expires_at": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Unix timestamp; defaults to 30 days from upload"
        },
        "filename": {
          "type": [
            "string",
            "null"
          ]
        },
        "purpose": {
          "type": "string",
          "enum": [
            "vision",
            "video",
            "audio",
            "document"
          ]
        },
        "page_count": {
          "type": "integer",
          "description": "Rendered page count; present only for `document` files"
        }
      },
      "required": [
        "id",
        "object",
        "bytes",
        "created_at",
        "expires_at",
        "filename",
        "purpose"
      ]
    }
  }
}