{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/isgenai/json-schema/isgenai-json-prompt-input-schema.json",
  "title": "JsonPromptInput",
  "description": "Send one image URL, text or code field. When several fields are strings, URL takes precedence, then code, then text. kind=code also marks a text-field input as code. JSON body cap: 131,072 bytes (128 KiB). saved_only requires an image URL; text/code require auto. An explicit null mode is treated as omitted/auto.",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/isgenai-openapi.json#/components/schemas/JsonPromptInput",
  "type": "object",
  "x-maxBodyBytes": 131072,
  "anyOf": [
    {
      "required": [
        "url"
      ]
    },
    {
      "required": [
        "text"
      ]
    },
    {
      "required": [
        "code"
      ]
    }
  ],
  "properties": {
    "url": {
      "type": "string",
      "minLength": 1,
      "description": "Direct public HTTP(S) image URL. The fetched resource must have a successful image response and satisfy the same 20 MiB/still-image limits. Private network targets and unsafe requests are rejected; authentication, paywalls and CAPTCHAs are not bypassed."
    },
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 16000,
      "description": "Nonblank input, at most 16,000 UTF-16 code units including surrounding whitespace. Some Unicode characters use two units. Text/code support auto reconstruction only; saved_only returns HTTP 400 image_required."
    },
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 16000,
      "description": "Nonblank input, at most 16,000 UTF-16 code units including surrounding whitespace. Some Unicode characters use two units. Text/code support auto reconstruction only; saved_only returns HTTP 400 image_required."
    },
    "kind": {
      "type": "string",
      "enum": [
        "text",
        "code"
      ],
      "default": "text",
      "description": "Optional text/code hint. A string code field always selects code."
    },
    "expected_sha256": {
      "type": "string",
      "description": "Optional exact SHA-256 fingerprint for the downloaded URL image bytes. A nonempty value that does not match produces HTTP 409 content_changed. Applies only to JSON URL input; not read from multipart fields."
    },
    "mode": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "auto",
        "saved_only",
        null
      ],
      "default": "auto",
      "description": "saved_only reads supported saved image records without a model call; no record returns HTTP 422. auto first reads image records, then may reconstruct a prompt when configured and within service limits. Reconstruction availability is not guaranteed."
    }
  }
}