{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/attestedmemory-net/json-schema/attestedmemory-net-invoke-request-schema.json",
  "title": "InvokeRequest",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hub-attestedmemory-openapi.json#/components/schemas/InvokeRequest",
  "properties": {
    "product_id": {
      "type": "string",
      "maxLength": 80,
      "minLength": 2,
      "title": "Product Id"
    },
    "capability_id": {
      "type": "string",
      "maxLength": 80,
      "minLength": 2,
      "title": "Capability Id"
    },
    "source_hub": {
      "type": "string",
      "maxLength": 256,
      "title": "Source Hub",
      "default": "local"
    },
    "input": {
      "additionalProperties": true,
      "type": "object",
      "title": "Input"
    },
    "max_price_usd": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 1000000.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Price Usd"
    },
    "verify": {
      "anyOf": [
        {
          "$ref": "#/$defs/VerifyBlock"
        },
        {
          "type": "null"
        }
      ]
    },
    "payment_authorization": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Payment Authorization"
    },
    "subcontract": {
      "anyOf": [
        {
          "$ref": "#/$defs/SubcontractBlock"
        },
        {
          "type": "null"
        }
      ]
    },
    "purpose": {
      "type": "string",
      "title": "Purpose",
      "default": ""
    }
  },
  "type": "object",
  "required": [
    "product_id",
    "capability_id"
  ],
  "$defs": {
    "SubcontractBlock": {
      "properties": {
        "allowance_usd": {
          "type": "number",
          "maximum": 1000.0,
          "exclusiveMinimum": 0.0,
          "title": "Allowance Usd"
        },
        "max_depth": {
          "type": "integer",
          "maximum": 3.0,
          "minimum": 1.0,
          "title": "Max Depth",
          "default": 1
        }
      },
      "type": "object",
      "required": [
        "allowance_usd"
      ],
      "title": "SubcontractBlock",
      "description": "A pass-through allowance for the providers of this call (mandates.md §6.2).\n\nThe root buyer sets aside ``allowance_usd`` of its own funding that the provider may\nspend on subcontractors while serving the call, down to ``max_depth`` levels. What they\ndo not spend is released when the call returns."
    },
    "VerifyBlock": {
      "properties": {
        "requested": {
          "type": "boolean",
          "title": "Requested",
          "default": true
        },
        "intent": {
          "type": "string",
          "maxLength": 20000,
          "title": "Intent",
          "default": ""
        },
        "mode": {
          "type": "string",
          "pattern": "^(auto|fast|thinking|council|agent)$",
          "title": "Mode",
          "default": "auto"
        },
        "wait": {
          "type": "boolean",
          "title": "Wait",
          "default": false
        },
        "wait_timeout_s": {
          "type": "number",
          "maximum": 300.0,
          "minimum": 1.0,
          "title": "Wait Timeout S",
          "default": 300
        }
      },
      "type": "object",
      "title": "VerifyBlock",
      "description": "Buyer opt-in for Pay-on-Verified settlement (escrow hold until a Metis verdict).\n\nThe buyer supplies the task `intent` the verdict is judged against; money moves\nonly after Metis scores the delivered output. `wait` holds the HTTP response\nuntil the verdict (bounded by `wait_timeout_s`); default is async — the invoke\nreturns immediately with a pending envelope resolvable at\nGET /ai-market/v2/verification/{nonce}."
    }
  }
}