{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudinary/json-schema/cloudinary-generate-image-result-schema.json",
  "title": "GenerateImageResult",
  "description": "Successful synchronous image-generation response.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudinary-media-generation-openapi.yml#/components/schemas/GenerateImageResult",
  "type": "object",
  "required": [
    "request_id"
  ],
  "properties": {
    "data": {
      "$ref": "#/$defs/GeneratedAssets"
    },
    "limits": {
      "$ref": "#/$defs/Limits"
    },
    "notices": {
      "$ref": "#/$defs/Notices"
    },
    "request_id": {
      "type": "string",
      "description": "Unique identifier for this request, for correlation and support."
    }
  },
  "$defs": {
    "AddonQuota": {
      "type": "object",
      "description": "Credit usage for a single add-on.",
      "required": [
        "type",
        "used_by_request",
        "remaining",
        "limit"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/Feature"
        },
        "used_by_request": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Credits used by this request; 0 when no image was generated."
        },
        "remaining": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Credits remaining in the current period."
        },
        "limit": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Credits available per period."
        }
      }
    },
    "Feature": {
      "type": "string",
      "description": "The add-on a quota applies to.",
      "enum": [
        "image_generation"
      ]
    },
    "GeneratedAsset": {
      "type": "object",
      "description": "A generated asset: where it is stored (`storage`) plus its media\nmetadata. The media fields are populated once the task completes; an\nin-progress asset carries only `storage`.\n",
      "required": [
        "storage"
      ],
      "properties": {
        "storage": {
          "$ref": "#/$defs/Storage"
        },
        "format": {
          "type": "string",
          "enum": [
            "png",
            "jpeg",
            "webp"
          ],
          "description": "The image format of the stored asset."
        },
        "width": {
          "type": "integer",
          "description": "The width of the generated image in pixels; zero if the model doesn't provide dimensions."
        },
        "height": {
          "type": "integer",
          "description": "The height of the generated image in pixels; zero if the model doesn't provide dimensions."
        },
        "bytes": {
          "type": "integer",
          "format": "int64",
          "description": "The size of the generated image in bytes."
        },
        "model": {
          "$ref": "#/$defs/Model"
        },
        "seed": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The seed used for generation. Echoes input or returns the\nmodel-generated seed. Null when the model doesn't support seeds.\n"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp when the image was generated."
        }
      }
    },
    "GeneratedAssets": {
      "type": "object",
      "description": "Wrapper holding the array of generated assets.",
      "required": [
        "assets"
      ],
      "properties": {
        "assets": {
          "type": "array",
          "description": "The generated assets. Currently a single asset is returned.",
          "items": {
            "$ref": "#/$defs/GeneratedAsset"
          }
        }
      }
    },
    "Limits": {
      "type": "object",
      "description": "Rate limit information for the account's add-on quotas.",
      "properties": {
        "addons_quota": {
          "type": "array",
          "description": "Per-add-on quota usage for this account.",
          "items": {
            "$ref": "#/$defs/AddonQuota"
          }
        }
      }
    },
    "ManagedAssetStorage": {
      "type": "object",
      "description": "A generated asset stored as a permanent managed asset. Reference it in\nother Cloudinary APIs by `asset_id`, or by the\n`resource_type` / `type` / `public_id` triple.\n",
      "additionalProperties": false,
      "required": [
        "storage_type",
        "secure_url",
        "public_id",
        "resource_type",
        "type",
        "version"
      ],
      "properties": {
        "storage_type": {
          "type": "string",
          "description": "Discriminator identifying this as managed-asset storage.",
          "enum": [
            "managed_asset"
          ]
        },
        "secure_url": {
          "type": "string",
          "format": "uri",
          "description": "The URL to fetch the generated asset."
        },
        "asset_id": {
          "type": "string",
          "description": "Cloudinary asset ID — a stable, globally-unique reference to the asset."
        },
        "public_id": {
          "type": "string",
          "description": "Public ID of the stored asset."
        },
        "resource_type": {
          "type": "string",
          "description": "Cloudinary resource type of the stored asset.",
          "enum": [
            "image",
            "video",
            "raw"
          ]
        },
        "type": {
          "type": "string",
          "description": "Cloudinary delivery type of the stored asset (e.g. `upload`, `private`, `authenticated`)."
        },
        "version": {
          "type": "integer",
          "format": "int64",
          "description": "Version of the stored asset."
        }
      }
    },
    "Model": {
      "type": "object",
      "description": "Identifies the model that produced a generation result.",
      "required": [
        "family",
        "tier",
        "id"
      ],
      "properties": {
        "family": {
          "type": "string",
          "description": "The family this model belongs to. `none` when the model is not part\nof any family.\n\nA family holds exactly two tiers (`standard` and `premium`), so the\nfamily/tier taxonomy names only part of the roster. The remaining\nmodels are selected by `id` alone and are not part of any family,\nwhich is reported as `none` rather than as a family the model does\nnot belong to. This describes the model, not how it was selected: a\nmodel that belongs to a family reports it whether it was chosen by\n`family` and `tier` or pinned by `id`.\n\nNot an enum: new families are added over time, so treat any value\nas possible.\n"
        },
        "tier": {
          "type": "string",
          "description": "The quality tier this model holds within its family. `none` when\nthe model is not part of any family. See `family`.\n"
        },
        "id": {
          "type": "string",
          "description": "The exact model identifier used for generation. Always a concrete\nmodel, and the reliable field to key on: unlike `family` and\n`tier`, it is never `none`.\n"
        }
      }
    },
    "Notice": {
      "type": "object",
      "description": "A single tip or piece of guidance, with how much weight to give it.",
      "required": [
        "severity",
        "text"
      ],
      "properties": {
        "severity": {
          "type": "string",
          "description": "How much weight to give the message.\n* `info`: for awareness; nothing to do.\n* `warning`: worth relaying to the user before continuing.\n* `blocking`: the request was not served; the text says what\n  unblocks it.\n",
          "enum": [
            "info",
            "warning",
            "blocking"
          ]
        },
        "text": {
          "type": "string",
          "description": "The tip or guidance, in plain text. Show it as-is or follow it; the wording may change between releases."
        }
      }
    },
    "Notices": {
      "type": "array",
      "x-experimental": true,
      "description": "Tips and guidance attached to the response to help you get the most\nout of the generation. Each entry is plain text you can show to a\nuser or act on as-is. Omitted when there is nothing to add.\n",
      "items": {
        "$ref": "#/$defs/Notice"
      }
    },
    "Storage": {
      "description": "Where the generated asset is actually stored, determined by\n`storage_type`. Usually matches the request `target`; a `managed_asset`\nrequest falls back to `temporary` when the caller lacks upload\npermission. `secure_url` is always present.\n",
      "oneOf": [
        {
          "$ref": "#/$defs/ManagedAssetStorage"
        },
        {
          "$ref": "#/$defs/TemporaryStorage"
        }
      ]
    },
    "TemporaryStorage": {
      "type": "object",
      "description": "A generated asset stored as a short-lived asset on the upload service.",
      "additionalProperties": false,
      "required": [
        "storage_type",
        "secure_url",
        "expires_at"
      ],
      "properties": {
        "storage_type": {
          "type": "string",
          "description": "Discriminator identifying this as temporary storage.",
          "enum": [
            "temporary"
          ]
        },
        "secure_url": {
          "type": "string",
          "format": "uri",
          "description": "The URL to fetch the generated asset."
        },
        "expires_at": {
          "type": "string",
          "format": "date-time",
          "description": "Time in UTC when secure_url stops being valid."
        }
      }
    }
  }
}