{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rendry-io/json-schema/rendry-io-prepare-art-reply-schema.json",
  "title": "PrepareArtReply",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rendry-io-rendering-api-openapi.yml#/components/schemas/PrepareArtReply",
  "oneOf": [
    {
      "$ref": "#/$defs/ArtQuote"
    },
    {
      "$ref": "#/$defs/ArtJobStarted"
    },
    {
      "$ref": "#/$defs/ArtJobProgress"
    },
    {
      "$ref": "#/$defs/ArtTestPlaceholder"
    }
  ],
  "$defs": {
    "ArtJobProgress": {
      "type": "object",
      "properties": {
        "job_id": {
          "type": "string",
          "format": "uuid"
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "done",
            "failed",
            "interrupted"
          ]
        },
        "made": {
          "type": "integer",
          "minimum": 0
        },
        "cached": {
          "type": "integer",
          "minimum": 0
        },
        "failed": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "prompt": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "refunded": {
                "type": "boolean"
              }
            },
            "required": [
              "prompt",
              "reason",
              "refunded"
            ]
          }
        },
        "assets": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "prompt": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "storage_key": {
                "type": "string"
              }
            },
            "required": [
              "prompt",
              "url",
              "storage_key"
            ]
          }
        },
        "credits_charged": {
          "type": "number",
          "minimum": 0,
          "description": "Credits from the shared per-image price; cached images cost nothing."
        },
        "message": {
          "type": "string"
        },
        "autofixed_fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "autofix_note": {
          "type": "string"
        }
      },
      "required": [
        "job_id",
        "status",
        "made",
        "cached",
        "failed",
        "assets",
        "credits_charged"
      ]
    },
    "ArtJobStarted": {
      "type": "object",
      "properties": {
        "job_id": {
          "type": "string",
          "format": "uuid"
        },
        "to_make": {
          "type": "integer",
          "minimum": 0
        },
        "price_credits": {
          "type": "number",
          "minimum": 0,
          "description": "Credits from the shared per-image price; cached images cost nothing."
        },
        "autofixed_fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "autofix_note": {
          "type": "string"
        }
      },
      "required": [
        "job_id",
        "to_make",
        "price_credits"
      ]
    },
    "ArtPromptQuote": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string"
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "existing",
            "to_make"
          ]
        }
      },
      "required": [
        "prompt",
        "rows",
        "status"
      ]
    },
    "ArtQuote": {
      "type": "object",
      "properties": {
        "distinct": {
          "type": "integer",
          "minimum": 0
        },
        "existing": {
          "type": "integer",
          "minimum": 0
        },
        "to_make": {
          "type": "integer",
          "minimum": 0
        },
        "price_credits": {
          "type": "number",
          "minimum": 0,
          "description": "Credits from the shared per-image price; cached images cost nothing."
        },
        "limit_check": {
          "type": "object",
          "properties": {
            "fits": {
              "type": "boolean"
            },
            "reason": {
              "type": "string"
            }
          },
          "required": [
            "fits"
          ]
        },
        "prompts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ArtPromptQuote"
          }
        },
        "autofixed_fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "autofix_note": {
          "type": "string"
        }
      },
      "required": [
        "distinct",
        "existing",
        "to_make",
        "price_credits",
        "limit_check",
        "prompts"
      ]
    },
    "ArtTestPlaceholder": {
      "type": "object",
      "properties": {
        "placeholder": {
          "type": "boolean"
        },
        "to_make": {
          "type": "integer",
          "minimum": 0
        },
        "price_credits": {
          "type": "number",
          "minimum": 0,
          "description": "Credits from the shared per-image price; cached images cost nothing."
        },
        "message": {
          "type": "string"
        },
        "autofixed_fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "autofix_note": {
          "type": "string"
        }
      },
      "required": [
        "placeholder",
        "to_make",
        "price_credits",
        "message"
      ]
    }
  }
}