{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/octen-ai/json-schema/octen-ai-image-search-request-schema.json",
  "title": "ImageSearchRequest",
  "description": "Request body for the Image Search API.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/octen-ai-image-search-api-openapi.yml#/components/schemas/ImageSearchRequest",
  "type": "object",
  "required": [
    "inputs"
  ],
  "properties": {
    "inputs": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "description": "Multimodal input array. Currently only a single input is supported: either one text input or one image input.",
      "items": {
        "$ref": "#/$defs/ImageSearchInput"
      }
    },
    "topic": {
      "type": "string",
      "enum": [
        "general",
        "design"
      ],
      "default": "general",
      "description": "Use `general` for general image search, or `design` for design reference."
    },
    "count": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10,
      "default": 5,
      "description": "Number of results to return."
    },
    "include_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Domains to include, matched against each result's `source_page` URL."
    },
    "exclude_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Domains to exclude, matched against each result's `source_page` URL."
    },
    "safesearch": {
      "type": "string",
      "enum": [
        "off",
        "strict"
      ],
      "default": "strict",
      "description": "Controls filtering of explicit/adult content. `off` disables filtering; `strict` drops all adult content."
    },
    "html_snippet": {
      "allOf": [
        {
          "$ref": "#/$defs/HtmlSnippetOptions"
        }
      ],
      "description": "Only effective when `topic=design`; controls whether an `html_snippet` is returned for each result."
    }
  },
  "$defs": {
    "HtmlSnippetOptions": {
      "type": "object",
      "description": "Only effective when `topic=design`; controls whether an `html_snippet` is returned for each result.",
      "properties": {
        "enable": {
          "type": "boolean",
          "default": false,
          "description": "If `true`, returns an `html_snippet` for each image result."
        },
        "max_tokens": {
          "type": "integer",
          "default": 5000,
          "minimum": 100,
          "maximum": 100000,
          "description": "Maximum tokens of `html_snippet` returned per image result."
        }
      }
    },
    "ImageSearchInput": {
      "type": "object",
      "required": [
        "type"
      ],
      "description": "A single multimodal input. Currently each request accepts exactly one input: either one text input or one image input.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text",
            "image"
          ],
          "description": "The input type. A single image must be at most 5MB and one of: JPEG, PNG, WEBP, BMP, TIFF, ICO, DIB, ICNS, SGI."
        },
        "url": {
          "type": "string",
          "description": "Image input as a public URL. For an image input, provide either `url` or `data`, not both."
        },
        "data": {
          "type": "string",
          "description": "When `type` is `text`: the query content, max 500 characters. When `type` is `image`: base64-encoded image data, at most 5MB after encoding."
        }
      }
    }
  }
}