{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/made-app/json-schema/made-app-generation-request-schema.json",
  "title": "GenerationRequest",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/made-app-openapi.json#/components/schemas/GenerationRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "model"
  ],
  "properties": {
    "model": {
      "type": "string",
      "description": "Model id from GET /v1/models, for example `seedance_2_5` or `nano_banana_2`."
    },
    "prompt": {
      "type": "string",
      "description": "What to make. Required by most models; edit models describe the change."
    },
    "request_id": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128,
      "pattern": "^[a-zA-Z0-9_-]+$",
      "description": "Idempotency key. Sending the same request_id with the same body again returns the same job instead of charging twice, so retry with it after a lost response."
    },
    "max_cost_cents": {
      "type": "number",
      "minimum": 0,
      "description": "The approved price in cents (10 cents = 1 credit), usually the customerCostCents from POST /v1/cost. If the price is higher the request is refused with 409 and nothing is charged. If the provider the job was quoted on fails, a backup provider runs it at its own price, which can be higher (see the X-MADE-Backup-Pricing header)."
    },
    "kind": {
      "type": "string",
      "enum": [
        "image",
        "video",
        "audio"
      ],
      "description": "Optional guard: the request is refused if the model is a different kind."
    },
    "count": {
      "type": "integer",
      "minimum": 1,
      "maximum": 4,
      "default": 1,
      "description": "Outputs to make. Each one is priced."
    },
    "aspect_ratio": {
      "type": "string",
      "description": "One of the model's `aspectRatios`, for example `16:9` or `9:16`."
    },
    "duration": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Seconds of video or audio. One of the model's `durations` (or inside its `durationRange`)."
    },
    "resolution": {
      "type": "string",
      "description": "Output tier, using the exact key from the model's catalog entry (for example `480p`, `768P` or `2160p`). An undeclared tier is refused, never re-priced. A tier in the entry's `upscaledResolutions` renders at its `from` tier and is then upscaled; its price is that render plus the upscale, and `/v1/cost` quotes both."
    },
    "quality": {
      "type": "string",
      "description": "One of the model's `qualities`, where it has them."
    },
    "audio": {
      "type": "boolean",
      "description": "Generate sound, on models whose catalog entry has `audioPricing`."
    },
    "image_size": {
      "type": "string",
      "description": "One of the model's `imageSizes`, where it has them."
    },
    "upscale_factor": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "For upscale models: one of the model's `upscaleFactors`."
    },
    "medias": {
      "type": "array",
      "description": "Reference media for image-to-video, edits and reference models. The model's `mediaRoles` lists the roles it takes and `requiredMedia` the ones it needs.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "value",
          "role"
        ],
        "properties": {
          "value": {
            "type": "string",
            "description": "An https URL, an uploaded `media_…` id, a prior `job_…` id, or a saved character's or product's `ref_…` id."
          },
          "role": {
            "type": "string",
            "description": "The role this media plays, for example `start_image` or `reference_images`."
          }
        }
      }
    },
    "characters": {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "items": {
        "type": "string",
        "pattern": "^ref_"
      },
      "description": "Saved characters (`ref_…`) to star, so the same face carries across generations."
    },
    "character": {
      "type": "string",
      "pattern": "^ref_",
      "description": "One saved character; the same as `characters` with one id."
    },
    "products": {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "items": {
        "type": "string",
        "pattern": "^ref_"
      },
      "description": "Saved products (`ref_…` from GET /v1/products) to show: their photos, cover first, go in as references after any characters', and the prompt says to keep each product exactly as it looks (shape, colors, labels)."
    },
    "product": {
      "type": "string",
      "pattern": "^ref_",
      "description": "One saved product; the same as `products` with one id."
    },
    "params": {
      "type": "object",
      "additionalProperties": true,
      "description": "Extra model options from the model's `allowedParams`, for example `seed`."
    }
  }
}