{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mint-gg/json-schema/mint-gg-asset-pack-generation-operation-schema.json",
  "title": "AssetPackGenerationOperation",
  "description": "A long-running operation acting on one Mint asset_pack.",
  "x-generated": "2026-12-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/mint-gg-api-openapi.json#/components/schemas/AssetPackGenerationOperation",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "object",
    "id",
    "type",
    "generationMode",
    "status",
    "resource",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "operation",
      "description": "Stable object discriminator."
    },
    "id": {
      "type": "string",
      "description": "Mint operation ID used for polling."
    },
    "type": {
      "type": "string",
      "enum": [
        "asset_pack_generation"
      ],
      "description": "The work this operation performs."
    },
    "generationMode": {
      "type": "string",
      "enum": [
        "auto",
        "review"
      ],
      "description": "Workflow mode for this operation."
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "preview_ready",
        "billing_required",
        "succeeded",
        "partially_succeeded",
        "failed",
        "canceled"
      ],
      "description": "Current operation lifecycle status."
    },
    "prompt": {
      "type": "string",
      "description": "Developer-supplied generation brief or revision feedback."
    },
    "generationPreset": {
      "type": "string",
      "enum": [
        "fast",
        "standard",
        "production"
      ],
      "description": "Public generation preset selected for this operation."
    },
    "resource": {
      "description": "The Mint asset created by this operation, or null before the asset exists.",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "description": "The Mint asset_pack affected by this operation.",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "asset_pack",
              "description": "Mint resource type."
            },
            "id": {
              "type": "string",
              "description": "Mint resource ID."
            }
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "billing": {
      "type": "object",
      "additionalProperties": false,
      "description": "The billing action required before this operation can continue.",
      "required": [
        "reason",
        "resource",
        "stage",
        "requiredCredits",
        "actionUrl"
      ],
      "properties": {
        "reason": {
          "type": "string",
          "enum": [
            "subscription_required",
            "past_due",
            "quota_exhausted_upgrade_available",
            "quota_exhausted_top_tier",
            "insufficient_credits",
            "insufficient_completion_credits"
          ]
        },
        "resource": {
          "type": "string",
          "enum": [
            "preview",
            "world",
            "model",
            "asset_pack",
            "material",
            "material_pack",
            "image",
            "audio",
            "video"
          ]
        },
        "stage": {
          "type": "string",
          "enum": [
            "preview",
            "final"
          ]
        },
        "requiredCredits": {
          "type": "number",
          "minimum": 0
        },
        "availableCredits": {
          "type": "number",
          "minimum": 0
        },
        "committedCredits": {
          "type": "number",
          "minimum": 0
        },
        "stageCredits": {
          "type": "number",
          "minimum": 0
        },
        "completionCredits": {
          "type": "number",
          "minimum": 0
        },
        "ctaKind": {
          "type": "string",
          "enum": [
            "view_plans",
            "upgrade_plan",
            "buy_top_up_credits"
          ]
        },
        "actionUrl": {
          "type": "string",
          "format": "uri",
          "description": "Platform billing URL where the developer can add Credits or subscribe."
        }
      }
    },
    "credits": {
      "type": "object",
      "additionalProperties": false,
      "description": "Credit estimate, active reservation, finalized charge, and post-reservation balance for this operation.",
      "required": [
        "estimated",
        "reserved",
        "finalized",
        "availableAfterReservation"
      ],
      "properties": {
        "estimated": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "description": "Current best estimate for all requested stages of this operation."
        },
        "reserved": {
          "type": "number",
          "minimum": 0,
          "description": "Credits currently reserved for unfinished work."
        },
        "finalized": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "description": "Credits finalized for completed provider work, or null while Modeler usage is pending verification."
        },
        "availableAfterReservation": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "description": "Account Credits remaining after the latest reservation or settlement update."
        }
      }
    },
    "error": {
      "type": "object",
      "additionalProperties": false,
      "description": "Terminal failure details when the operation failed.",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable machine-readable failure code."
        },
        "message": {
          "type": "string",
          "description": "Developer-readable failure explanation."
        }
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the operation was created."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the operation last changed."
    },
    "completedAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the operation completed."
    },
    "canceledAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the operation was canceled."
    }
  }
}