{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/canva/json-schema/canva-create-image-generation-job-request-schema.json",
  "title": "CreateImageGenerationJobRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canva-image-generation-api-openapi.yml#/components/schemas/CreateImageGenerationJobRequest",
  "properties": {
    "prompt": {
      "description": "A plain-text description of the image to generate.",
      "maxLength": 5000,
      "minLength": 1,
      "type": "string"
    },
    "aspect_ratio": {
      "$ref": "#/$defs/ImageGenerationAspectRatio"
    },
    "model": {
      "$ref": "#/$defs/ImageGenerationModel"
    },
    "idempotency_key": {
      "description": "A key to make create requests idempotent. Retrying with the same key returns the\noriginal job without creating a duplicate, even if the other request parameters\ndiffer. Keys are held for 24 hours from job creation.",
      "format": "uuid",
      "type": "string"
    },
    "asset_upload": {
      "$ref": "#/$defs/ImageGenerationAssetUpload"
    }
  },
  "required": [
    "idempotency_key",
    "prompt"
  ],
  "type": "object",
  "$defs": {
    "ImageGenerationAspectRatio": {
      "default": "square",
      "description": "The aspect ratio of the generated image. Every aspect ratio is supported by every model\nyou can select with `model`, so the choice of model never limits the aspect ratios you\ncan use. The pixel dimensions of the output depend on the model. The job result reports\nthe actual `width` and `height`.",
      "enum": [
        "square",
        "landscape",
        "portrait",
        "landscape_3_2",
        "portrait_2_3",
        "portrait_4_5"
      ],
      "type": "string",
      "x-enum-descriptions": [
        "A square (1:1) image.",
        "A wide (16:9) image, suitable for landscape-oriented content.",
        "A tall (9:16) image, suitable for portrait-oriented content.",
        "A wide (3:2) image, suitable for photos and print.",
        "A tall (2:3) image, suitable for posters and portrait photos.",
        "A tall (4:5) image, suitable for social media feed posts."
      ]
    },
    "ImageGenerationAssetUpload": {
      "description": "Whether to save the generated image as an image asset in the user's Canva account.\nOmitting `asset_upload` (or using `type: none`) returns only a download URL.\n\nSaving the asset (`type: upload`) requires a user access token.",
      "oneOf": [
        {
          "$ref": "#/$defs/NoneImageGenerationAssetUpload"
        },
        {
          "$ref": "#/$defs/UploadImageGenerationAssetUpload"
        }
      ]
    },
    "ImageGenerationModel": {
      "description": "The model to use for image generation. We recommend omitting this parameter: Canva\nthen selects the best available model for the request and falls back to another\nmodel if one is temporarily unavailable. Set it only if you need a specific model's\noutput. If the requested model can't serve the request, the job fails. Canva never\nuses a different model to serve the request.\n\nThe model strengths below are based on Canva's evaluations. Results vary by\nprompt, so test with your own prompts before pinning a model.",
      "enum": [
        "lucid_origin",
        "z_image_turbo"
      ],
      "type": "string",
      "x-enum-descriptions": [
        "Lucid Origin. Pick this for architecture, logos, posters, or sci-fi and fantasy\nscenes.",
        "Z Image Turbo. Pick this if the image includes text, or for food, drink, and\ngeneral-purpose imagery."
      ]
    },
    "NoneImageGenerationAssetUpload": {
      "description": "Don't save the generated image. The result contains only its download URL.",
      "properties": {
        "type": {
          "enum": [
            "none"
          ],
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "UploadImageGenerationAssetUpload": {
      "description": "Save the generated image as an image asset in the user's Canva account. The asset appears\nin the user's Uploads, and the generated image in the result includes the `asset`\nalongside its download `url`.",
      "properties": {
        "type": {
          "enum": [
            "upload"
          ],
          "type": "string"
        },
        "asset_name": {
          "description": "A name for the image asset. Canva doesn't localize this value, so provide a name in\nthe user's language. If omitted, Canva generates a name for the asset.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    }
  }
}