{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bamf-ai/json-schema/bamf-ai-generate-image-request-schema.json",
  "title": "GenerateImageRequest",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bamf-ai-openapi.json#/components/schemas/GenerateImageRequest",
  "type": "object",
  "required": [
    "creator_id",
    "prompt"
  ],
  "properties": {
    "creator_id": {
      "type": "string",
      "format": "uuid"
    },
    "prompt": {
      "type": "string",
      "minLength": 1
    },
    "visual_type": {
      "type": "string",
      "enum": [
        "image_quote",
        "infographic",
        "personal",
        "profile_banner",
        "profile_featured"
      ]
    },
    "profile_package_id": {
      "type": "string",
      "format": "uuid",
      "description": "Required for profile_banner and profile_featured; must be an active package owned by creator_id."
    },
    "profile_asset_kind": {
      "type": "string",
      "enum": [
        "banner",
        "featured_1",
        "featured_2"
      ],
      "description": "profile_banner accepts banner; profile_featured accepts featured_1 or featured_2."
    },
    "size": {
      "type": "string",
      "description": "Caller-selected size for non-profile images. Profile image source sizes are enforced server-side."
    },
    "quality": {
      "type": "string",
      "enum": [
        "low",
        "medium",
        "high",
        "auto"
      ]
    },
    "n": {
      "type": "integer",
      "minimum": 1,
      "maximum": 4,
      "description": "Profile image jobs always enforce n=1."
    },
    "referenceImageUrls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "likenessReferenceImageUrls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "styleReferenceImageUrls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "reference_bindings": {
      "type": "array",
      "maxItems": 10,
      "description": "Resolved official and inspiration references. Official person identity routes to likeness; other official references preserve exact product or brand truth; inspiration can guide style, layout, pose, or lighting only. The validated snapshot is persisted with the generation job.",
      "items": {
        "$ref": "#/$defs/ResolvedMultimodalReferenceV1"
      }
    },
    "post_id": {
      "type": "string",
      "format": "uuid",
      "description": "Optional for non-profile images. Forbidden for profile image jobs."
    },
    "alt_text": {
      "type": "string"
    },
    "metadata": {
      "$ref": "#/$defs/JSONValue"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "visual_type": {
            "const": "profile_banner"
          }
        },
        "required": [
          "visual_type"
        ]
      },
      "then": {
        "required": [
          "profile_package_id",
          "profile_asset_kind"
        ],
        "properties": {
          "profile_asset_kind": {
            "const": "banner"
          },
          "n": {
            "const": 1
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "visual_type": {
            "const": "profile_featured"
          }
        },
        "required": [
          "visual_type"
        ]
      },
      "then": {
        "required": [
          "profile_package_id",
          "profile_asset_kind"
        ],
        "properties": {
          "profile_asset_kind": {
            "enum": [
              "featured_1",
              "featured_2"
            ]
          },
          "n": {
            "const": 1
          }
        }
      }
    }
  ],
  "$defs": {
    "JSONValue": {
      "description": "Any JSON value returned by flexible workflow, analytics, context, or generation payloads."
    },
    "MultimodalReferenceBindingV1": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "bindingId",
        "workspaceId",
        "subjectId",
        "subjectType",
        "assetId",
        "assetVersion",
        "authority",
        "purposes",
        "required",
        "consent",
        "provenance",
        "createdAt"
      ],
      "properties": {
        "schemaVersion": {
          "type": "string",
          "const": "bamf.multimodal-reference-binding/v1"
        },
        "bindingId": {
          "type": "string"
        },
        "workspaceId": {
          "type": "string"
        },
        "subjectId": {
          "type": "string"
        },
        "subjectType": {
          "type": "string",
          "enum": [
            "person",
            "product",
            "logo",
            "typography",
            "palette",
            "icon",
            "brand_rules",
            "creator_voice",
            "brand_voice"
          ]
        },
        "assetId": {
          "type": "string"
        },
        "assetVersion": {
          "type": "string"
        },
        "authority": {
          "type": "string",
          "enum": [
            "official",
            "inspiration"
          ]
        },
        "purposes": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "enum": [
              "identity",
              "exact_product",
              "exact_logo",
              "typography",
              "color",
              "iconography",
              "brand_rules",
              "voice_identity",
              "voice_style",
              "style",
              "layout",
              "pose",
              "lighting",
              "scale"
            ]
          }
        },
        "required": {
          "type": "boolean"
        },
        "consent": {
          "type": "object",
          "required": [
            "status",
            "scopes"
          ],
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "granted",
                "not_required",
                "unknown",
                "revoked",
                "expired"
              ]
            },
            "receiptRef": {
              "type": "string"
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "grantedAt": {
              "type": "string",
              "format": "date-time"
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time"
            },
            "revokedAt": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        "provenance": {
          "type": "object",
          "required": [
            "sourceKind",
            "sourceRef",
            "observedAt"
          ],
          "properties": {
            "sourceKind": {
              "type": "string",
              "enum": [
                "upload",
                "capture",
                "provider_import",
                "generated",
                "migration"
              ]
            },
            "sourceRef": {
              "type": "string"
            },
            "contentHash": {
              "type": "string"
            },
            "observedAt": {
              "type": "string",
              "format": "date-time"
            },
            "actorRef": {
              "type": "string"
            }
          }
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "ResolvedMultimodalReferenceV1": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "binding",
        "asset_url"
      ],
      "properties": {
        "binding": {
          "$ref": "#/$defs/MultimodalReferenceBindingV1"
        },
        "asset_url": {
          "type": "string",
          "format": "uri",
          "description": "HTTP(S) URL for the immutable asset version named by the binding."
        }
      }
    }
  }
}