{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xmrtousdc-xyz/json-schema/xmrtousdc-xyz-agent-quote-request-schema.json",
  "title": "AgentQuoteRequest",
  "description": "direction plus exactly one of amount or receiveAmount (both or neither: 400 invalid_request with details.field = amount and details.reason = amount_xor_receiveAmount), or requoteOf alone (with other fields: 400).",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xmrtousdc-xyz-openapi.json#/components/schemas/AgentQuoteRequest",
  "type": "object",
  "properties": {
    "direction": {
      "type": "string",
      "enum": [
        "x2u",
        "u2x"
      ],
      "description": "x2u = XMR->USDC, u2x = USDC->XMR. Buying XMR: u2x."
    },
    "chain": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        }
      ],
      "description": "Optional while Arbitrum One (42161) is the only live chain."
    },
    "amount": {
      "type": "string",
      "pattern": "^[0-9]+(\\.[0-9]*)?$",
      "description": "What the user SENDS: decimal string in send-asset units (XMR for x2u, USDC for u2x)."
    },
    "receiveAmount": {
      "type": "string",
      "pattern": "^[0-9]+(\\.[0-9]*)?$",
      "description": "What the user wants to RECEIVE: decimal string in receive-asset units (USDC for x2u, XMR for u2x). Same precision and positivity rules as amount, against the receive asset's decimals."
    },
    "basis": {
      "type": "string",
      "enum": [
        "estimate",
        "minimum"
      ],
      "default": "estimate",
      "description": "With receiveAmount: \"estimate\" (the default) finds a send amount whose estimated output meets the target. \"minimum\" would target the provider's published minimum (minReceived), but it is refused with 400 invalid_request (details.field basis, details.reason minimum_not_published) while the provider publishes no minimum receive amount, which is always the case on Wagyu v2. With amount instead of receiveAmount: 400 requires_receiveAmount. Echoed as data.target.basis."
    },
    "to": {
      "type": "string",
      "description": "Optional on quote; validated if present (same destination checks as create)."
    },
    "requoteOf": {
      "type": "string",
      "pattern": "^q_[a-f0-9]{32}$",
      "description": "Re-quote an earlier quote's stored inputs (same direction, chain, send amount or target, destination), for example after it expired or once the user is funded. Send it alone (an agent key goes in the x-agent-key header). Returns a new quote plus data.delta. Unknown quoteId: 404 quote_not_found."
    },
    "agentKey": {
      "type": "string",
      "pattern": "^swk_[a-f0-9]{40}$",
      "description": "Optional agent key (POST /agent/key): this quote and the order created from it carry a lower integrator fee (data.agentKey, terms.fees.integratorFee). The x-agent-key header works too."
    }
  },
  "oneOf": [
    {
      "required": [
        "direction",
        "amount"
      ],
      "not": {
        "required": [
          "requoteOf"
        ]
      }
    },
    {
      "required": [
        "direction",
        "receiveAmount"
      ],
      "not": {
        "required": [
          "requoteOf"
        ]
      }
    },
    {
      "required": [
        "requoteOf"
      ],
      "maxProperties": 1
    }
  ]
}