{
  "openapi": "3.1.0",
  "info": {
    "title": "Vurto Swap — Public API",
    "version": "1.0.0",
    "description": "Public API for AI agents and integrators to quote, build, sign, and track token swaps via Vurto's meta-aggregator, ranked by net value after gas and fee. Two families: 9 EVM chains (Ethereum, Optimism, BNB Chain, Gnosis, Polygon, Base, Arbitrum One, Avalanche, Unichain) across Velora, KyberSwap, 1inch, CoW Protocol and the direct pools Uniswap, SushiSwap, PancakeSwap, Aerodrome and QuickSwap, plus composto, a two-hop route across two of them, and Solana across Jupiter Router, Raydium, Orca and Meteora. Solana lives under /v1/svm and differs in four places only: chainId is the string \"solana-mainnet\", there is no approve so a build has one transaction instead of a steps[] array, signing uses a Solana key, and a signature is not a receipt (ask GET /v1/svm/tx before calling a swap done). Solana addresses are base58 and CASE-SENSITIVE: lowercasing one gives a different, non-existent account, and nothing downstream will tell you. No API key required, anywhere: pass the wallet that will sign and you get back bytes that are worthless until it signs them. Limits are per IP. The bearerAuth machine credential is optional and only moves your limit from the per-IP cap to the credential's own budget. Agents must sign and send built transactions onchain themselves — this API never holds custody of funds or private keys, and rejects any request payload that looks like one.",
    "contact": {
      "name": "Vurto",
      "url": "https://vurto.fi"
    }
  },
  "servers": [
    {
      "url": "https://swap.vurto.fi/v1",
      "description": "Production"
    },
    {
      "url": "https://swap-dev.vurto.fi/v1",
      "description": "Development"
    }
  ],
  "security": [],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "vswap_<id>_<secret>",
        "description": "Machine credential, optional everywhere except GET /executions. To get one: open https://swap.vurto.fi, connect the EVM wallet, and click the key icon on that wallet's card in the wallet panel; the secret is shown once. Issuance (POST /api/auth/challenge, then POST /api/credentials) is proven by an EIP-191 signature from the wallet over a one-time challenge, never by a password. Those routes compare the Origin header with our own origin as a CSRF defense for browsers; that is not the barrier, the signature is, so a script holding the wallet key can issue too. Issuance is not part of this spec. Scopes: 'read' (quote, tokens, balances, list executions) and 'build' (swap, orders, executions write, ethflow refund). Each credential carries a budget of 240 cost units per rolling 60s window; requests beyond that return 429 budget_exhausted."
      },
      "checkAccess": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "vca_<43 characters>",
        "description": "The Check access of a paying wallet, for listing its Checks (GET /check/credits) and, since 26/11/2026, for opening one by its id (POST /check/analysis, /check/result, /check/status, and the full answer of /check/payment): POST /check/access/challenge, sign the text (typedData on EVM, proofTransaction on Solana), POST /check/access. Valid 24 hours. It goes only in this header: in the URL the call is refused with 400 check_access_not_in_header, because a URL lands in request logs. Secret: it opens and lists this payer's Checks. Reporting a payment needs only the id."
      },
      "checkBuy": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "vcb_<43 characters>",
        "description": "The purchase proof of a paying wallet, for POST /check/charge (since 12/11/2026): POST /check/buy/challenge, sign the text with the wallet that will pay (typedData on EVM, proofTransaction on Solana, never sent), POST /check/buy/proof, which runs the free screening (OFAC and issuer freezes) and gives the proof only to a wallet that passes. Valid 10 minutes, for that wallet only. No sign-in: the purchase needs this signature. Since 26/11/2026 it also opens, for its 10 minutes, the Checks of that payer by their id (POST /check/analysis, /check/result, /check/status)."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code. Match on this, not on `message`."
              },
              "message": {
                "type": "string",
                "description": "Human-readable, English, safe to show a user."
              },
              "details": {
                "description": "Present on some errors (e.g. ambiguous_token, slippage_exceeded, route_changed). Shape depends on `code`."
              }
            }
          }
        }
      },
      "Chain": {
        "type": "object",
        "properties": {
          "chainId": {
            "type": "integer",
            "example": 42161
          },
          "name": {
            "type": "string",
            "example": "Arbitrum One"
          },
          "shortName": {
            "type": "string",
            "example": "Arbitrum"
          },
          "nativeSymbol": {
            "type": "string",
            "example": "ETH"
          },
          "explorer": {
            "type": "string",
            "format": "uri"
          },
          "blockSeconds": {
            "type": "number",
            "description": "Average block time in seconds."
          },
          "icon": {
            "type": "string",
            "description": "Path under swap.vurto.fi, e.g. /icons/networks/arbitrum.png"
          },
          "wrappedNative": {
            "type": "string",
            "description": "Wrapped native token address (WETH, WBNB, etc.)."
          }
        }
      },
      "TokenInfo": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "Checksummed contract address, or 0xEeee…EEeE for the chain's native asset."
          },
          "symbol": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "decimals": {
            "type": "integer"
          },
          "verified": {
            "type": "boolean",
            "description": "True for tokens in the curated seed list; false for on-chain-resolved tokens the caller pasted an address for."
          }
        }
      },
      "RouteLeg": {
        "type": "object",
        "properties": {
          "exchange": {
            "type": "string"
          },
          "pool": {
            "type": "string"
          },
          "tokenIn": {
            "type": "string"
          },
          "tokenOut": {
            "type": "string"
          },
          "shareBps": {
            "type": "integer",
            "description": "Share of the input routed through this leg, in basis points, for split routes."
          }
        }
      },
      "QuoteNotice": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable code; translate client-side, don't display raw."
          },
          "vars": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "NormalizedQuote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Opaque quote id. Pass as `quoteId` to POST /swap or POST /orders."
          },
          "provider": {
            "type": "string",
            "enum": [
              "velora",
              "kyberswap",
              "uniswap",
              "aerodrome",
              "sushi",
              "pancake",
              "quickswap",
              "composto",
              "1inch",
              "cowswap"
            ],
            "description": "Full provider list varies by chain; see GET /chains and provider health."
          },
          "venues": {
            "type": "array",
            "description": "The exchanges the route crosses, in order, present only when there is more than one. A `composto` quote carries two entries; a single-venue route omits the field entirely.",
            "items": {
              "type": "object",
              "properties": {
                "provider": {
                  "type": "string"
                },
                "tokenIn": {
                  "type": "string"
                },
                "tokenOut": {
                  "type": "string"
                }
              }
            }
          },
          "providerLabel": {
            "type": "string"
          },
          "chainId": {
            "type": "integer"
          },
          "tokenIn": {
            "type": "string"
          },
          "tokenOut": {
            "type": "string"
          },
          "amountIn": {
            "type": "string",
            "description": "Raw integer string, in the input token's smallest unit."
          },
          "amountOut": {
            "type": "string",
            "description": "Raw integer string, the provider's expected output."
          },
          "minimumAmountOut": {
            "type": "string",
            "description": "Raw integer string, the worst acceptable output after slippage. This is what the on-chain call enforces."
          },
          "amountOutUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "gasUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "netValueUsd": {
            "type": [
              "number",
              "null"
            ],
            "description": "Output value minus estimated gas minus platform fee. This is the ranking key, not amountOut."
          },
          "priceImpact": {
            "type": [
              "number",
              "null"
            ]
          },
          "platformFeeBps": {
            "type": "integer"
          },
          "platformFeeAmount": {
            "type": "string"
          },
          "confidence": {
            "type": "integer",
            "description": "0-100, lower when the provider's own health has degraded recently."
          },
          "latencyMs": {
            "type": "integer"
          },
          "quotedAt": {
            "type": "integer",
            "description": "Unix ms."
          },
          "expiresAt": {
            "type": "integer",
            "description": "Unix ms. The provider's own quote TTL, informational — POST /swap always re-quotes fresh before building."
          },
          "quoteBlock": {
            "type": [
              "integer",
              "null"
            ]
          },
          "mevProtection": {
            "type": "string",
            "enum": [
              "full",
              "partial",
              "public",
              "unknown"
            ]
          },
          "supportsReceiver": {
            "type": "boolean",
            "description": "Whether this provider can deliver the output to a `receiver` different from the wallet that signs."
          },
          "receiver": {
            "type": "string",
            "description": "Present only when the request set a `receiver` different from the signing wallet."
          },
          "approvalTarget": {
            "type": [
              "string",
              "null"
            ],
            "description": "The spender the approve step of the build will grant the allowance to, so pre-approving this address is safe. It is the same address as `steps[].spender` and `approval.spender` for the same provider. Never absent when an allowance is needed. `null` when there is nothing to approve: native input token, or a CoW order selling the native asset. The Vurto router appears here only when it sits in the call path (a direct pool route where the Vurto fee is charged); on a direct pool route with no fee this is the DEX router itself. If the fee flips between quote and build the build refuses with `approval_target_changed` instead of approving another contract."
          },
          "route": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RouteLeg"
            }
          },
          "badges": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Highlight codes, e.g. best_price, lowest_gas."
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuoteNotice"
            }
          },
          "executionKind": {
            "type": "string",
            "enum": [
              "transaction",
              "order",
              "onchain_order"
            ],
            "description": "Only present on quotes returned from POST /quote. 'transaction': send `steps[].tx`. 'order': sign EIP-712 off-chain, no transaction. 'onchain_order': CoW ETH-flow, a real transaction that only registers the order."
          },
          "estimatedGas": {
            "type": "integer",
            "description": "Gas in UNITS for this route, from our own model, present only when the USD figure also came from it. An integrator ranks in units against the gasPrice it read itself; without this it treats the route as if it cost no gas, which is an advantage by omission."
          }
        }
      },
      "PlanStep": {
        "type": "object",
        "description": "One action the caller must take, in order, to execute the swap. `type: approve|transaction` carry ready-to-send calldata in `tx`. `type: signature` carries EIP-712 `typedData` to sign off-chain, plus `submit` describing how to hand the signature back.",
        "properties": {
          "index": {
            "type": "integer"
          },
          "type": {
            "type": "string",
            "enum": [
              "approve",
              "transaction",
              "signature"
            ]
          },
          "humanSummary": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "spender": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "resetFirst": {
            "type": "boolean",
            "description": "True when this approve step must zero the allowance before the real approve step runs (some tokens, e.g. USDT, reject a non-zero-to-non-zero approve)."
          },
          "tx": {
            "type": "object",
            "properties": {
              "to": {
                "type": "string"
              },
              "data": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            }
          },
          "gasEstimate": {
            "type": "string"
          },
          "scheme": {
            "type": "string",
            "enum": [
              "eip712"
            ]
          },
          "typedData": {
            "type": "object",
            "properties": {
              "domain": {
                "type": "object"
              },
              "types": {
                "type": "object"
              },
              "primaryType": {
                "type": "string"
              },
              "message": {
                "type": "object"
              }
            }
          },
          "submit": {
            "type": "object",
            "description": "Where and how to POST the signature produced from `typedData`.",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "method": {
                "type": "string",
                "enum": [
                  "POST"
                ]
              },
              "bodyTemplate": {
                "type": "object",
                "additionalProperties": true,
                "description": "Known fields already filled in (chainId as a number, quoteId as a string); fill in `signature` and POST as-is."
              }
            }
          }
        }
      },
      "MultiQuoteLeg": {
        "type": "object",
        "description": "One real, quoted tokenIn->tokenOut slice of an N:N basket — the backend's waterfall allocation decided this slice's size, then quoted it through the same provider fan-out POST /quote uses. This is what POST /multi-quote/build will execute, not a rough preview.",
        "properties": {
          "legIndex": {
            "type": "integer",
            "description": "Position in the basket's flattened leg list, 0-based."
          },
          "inputLegIndex": {
            "type": "integer",
            "description": "Index into the request's inputLegs[] this leg draws from."
          },
          "outputLegIndex": {
            "type": "integer",
            "description": "Index into the request's outputLegs[] this leg funds."
          },
          "tokenIn": {
            "type": "string"
          },
          "tokenOut": {
            "type": "string"
          },
          "tokenInDecimals": {
            "type": "integer"
          },
          "tokenOutDecimals": {
            "type": "integer"
          },
          "amountIn": {
            "type": "string",
            "description": "Raw integer string: this leg's share of the input token after allocation, not the full inputLegs[] amount."
          },
          "receiver": {
            "type": "string"
          },
          "quote": {
            "$ref": "#/components/schemas/NormalizedQuote"
          },
          "netAmountOutEstimate": {
            "type": "string",
            "description": "Display estimate only: quote.amountOut minus VurtoSwapRouter's 0.03% multi-leg fee. Not the enforced floor — quote.minimumAmountOut is what the on-chain call requires."
          }
        }
      },
      "MultiBuildLeg": {
        "type": "object",
        "properties": {
          "legIndex": {
            "type": "integer"
          },
          "provider": {
            "type": "string",
            "enum": [
              "velora",
              "kyberswap",
              "uniswap",
              "aerodrome",
              "sushi",
              "pancake",
              "quickswap",
              "1inch"
            ],
            "description": "CoW never appears here: an off-chain signature or a separately-settled ETH-flow order can't be one leg of a single atomic transaction."
          },
          "tokenIn": {
            "type": "string"
          },
          "tokenOut": {
            "type": "string"
          },
          "amountIn": {
            "type": "string"
          },
          "minAmountOut": {
            "type": "string",
            "description": "Raw minimum this leg's on-chain call enforces, before VurtoSwapRouter's own fee is deducted from what actually reaches the wallet."
          },
          "receiver": {
            "type": "string"
          },
          "netAmountOutEstimate": {
            "type": "string"
          },
          "routeSwitch": {
            "$ref": "#/components/schemas/RouteSwitch"
          }
        }
      },
      "SwapPlan": {
        "type": "object",
        "properties": {
          "buildId": {
            "type": "string",
            "format": "uuid",
            "description": "Identity of this specific build. Use in POST /swap/{buildId}/refresh."
          },
          "buildHash": {
            "type": "string",
            "description": "sha256 canonical hash of chainId + wallet + destination + calldata + value. Recompute and compare before signing if you don't trust the transport."
          },
          "wallet": {
            "type": "string"
          },
          "chainId": {
            "type": "integer"
          },
          "validUntil": {
            "type": "integer",
            "description": "Unix ms. The build expires 10 minutes after creation; call refresh after this."
          },
          "quote": {
            "$ref": "#/components/schemas/NormalizedQuote"
          },
          "simulation": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "passed",
                  "approval_required",
                  "incomplete"
                ]
              },
              "gasEstimate": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "outputCheck": {
                "type": "string",
                "enum": [
                  "passed",
                  "skipped"
                ]
              },
              "outputDelta": {
                "type": "string"
              }
            }
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanStep"
            }
          },
          "slippageBps": {
            "type": "integer",
            "description": "Only present on refresh responses: how many bps the output dropped versus the original build. 0 when the price didn't get worse."
          },
          "refresh": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "method": {
                "type": "string",
                "enum": [
                  "POST"
                ]
              },
              "body": {
                "type": "object",
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "The same signing wallet the plan was built for. The handler requires it: a refresh without it is rejected, and omitting it because the spec did not list it was the exact gap this field closes."
                  },
                  "slippageBps": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "wallet",
                  "slippageBps"
                ]
              }
            }
          },
          "routeSwitch": {
            "$ref": "#/components/schemas/RouteSwitch"
          }
        }
      },
      "RouteSwitch": {
        "type": "object",
        "description": "Present only when the route that was built is NOT the route that was chosen. The build falls back to the next credible route when the chosen provider refuses with a request limit, because that refusal is about who is calling, not about the pair or the wallet, and no amount of waiting fixes it. Any other failure still aborts. Switching the route is acceptable, switching it silently is not: a client that shows the route MUST surface this before asking for a signature.",
        "properties": {
          "from": {
            "type": "string",
            "description": "Provider the caller chose."
          },
          "to": {
            "type": "string",
            "description": "Provider that actually built the transaction."
          },
          "reason": {
            "type": "string",
            "description": "Error code that knocked the chosen route out, today always provider_rate_limited."
          }
        },
        "required": [
          "from",
          "to",
          "reason"
        ]
      },
      "Check": {
        "type": "object",
        "description": "One Check. Whoever holds its id sees it.",
        "properties": {
          "id": {
            "type": "string",
            "description": "CHK-<uuid>"
          },
          "status": {
            "type": "string",
            "enum": [
              "awaiting_payment",
              "paid",
              "running",
              "used"
            ],
            "description": "awaiting_payment: charge built, not paid. paid: an unused credit. running: an analysis holds it. used: the result is stored."
          },
          "payer": {
            "type": "string"
          },
          "family": {
            "type": "string",
            "enum": [
              "evm",
              "svm"
            ]
          },
          "chainId": {
            "type": "string",
            "description": "The network that paid."
          },
          "amount": {
            "type": "string",
            "description": "Dollars: CHECK_PRECO_MAXIMO_USD divided by 6, down to the cent, times the networks paid, never above the maximum."
          },
          "amountRaw": {
            "type": "string"
          },
          "token": {
            "type": "string",
            "description": "The network USDC."
          },
          "tokenSymbol": {
            "type": "string"
          },
          "tokenDecimals": {
            "type": "integer"
          },
          "feeWallet": {
            "type": "string"
          },
          "txHash": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "usedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "target": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "family": {
                "type": "string"
              },
              "wallet": {
                "type": "string"
              },
              "wallets": {
                "type": "object",
                "properties": {
                  "evm": {
                    "type": "string"
                  },
                  "svm": {
                    "type": "string"
                  }
                }
              },
              "networks": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "description": "The wallets the credit analysed (or is bound to), and the networks read."
          },
          "seal": {
            "type": "string",
            "enum": [
              "red",
              "yellow",
              "green",
              "grey"
            ],
            "description": "The worst network. red: risk found (sanction, issuer freeze or a blocking Merkle score). yellow: medium risk. grey: a paid reading did not come back. green: no risk, Merkle no_data included."
          },
          "result": {
            "type": "object",
            "description": "Only on the full reads (analysis and result), of the worst network: verdict, risk, seal, tools [{tool, result clear|flagged|unavailable, score, severity, summary, category, factors, sourceOfFunds, destinationOfFunds, analyzedAt, fromHistory}] and details."
          },
          "screening": {
            "type": "object",
            "description": "The full reading of the worst network: the free screening plus scorechain and merkleScience."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ms": {
                  "type": "integer"
                },
                "text": {
                  "type": "string"
                }
              }
            },
            "description": "The real steps of the reading, with milliseconds since it started."
          },
          "networks": {
            "type": "array",
            "description": "Only on the full reads: each network read, {chainId, seal, result, screening}.",
            "items": {
              "type": "object",
              "properties": {
                "chainId": {
                  "type": "string"
                },
                "seal": {
                  "type": "string"
                },
                "result": {
                  "type": "object"
                },
                "screening": {
                  "type": "object"
                }
              }
            }
          },
          "paidNetworks": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "The networks this credit paid for and reads (null on a credit bought before the price by networks: every network of the wallet's family)."
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only while awaiting payment: the end of the charge's 30 minutes."
          }
        }
      }
    }
  },
  "paths": {
    "/balances": {
      "get": {
        "operationId": "getBalances",
        "summary": "Wallet balances for every curated token on a chain, plus native",
        "description": "One multicall per chain, batched in slices so a bad token can't zero out the whole response. Only non-zero balances are included. Rate-limited per IP (40/min).",
        "security": [],
        "parameters": [
          {
            "name": "chainId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "wallet",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "chainId": {
                      "type": "integer"
                    },
                    "balances": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Keyed by lowercase token address, or the literal 'native'. Raw integer strings."
                    },
                    "usd": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "number"
                      },
                      "description": "Same keys as balances, best-effort — a missing key means price lookup failed, not that the balance is zero."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chains": {
      "get": {
        "operationId": "listChains",
        "summary": "Supported chains",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Chain"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ethflow/refund": {
      "post": {
        "operationId": "refundEthFlow",
        "summary": "Build a refund transaction for an expired, unfulfilled CoW ETH-flow order",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "chainId",
                  "txHash"
                ],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "EVM address that created the ETH-flow order and will sign the refund."
                  },
                  "chainId": {
                    "type": "integer"
                  },
                  "txHash": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{64}$",
                    "description": "The original ETH-flow transaction hash."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK, a transaction ready to send",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_tx_hash | not_ethflow_order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "refund_not_yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/executions": {
      "post": {
        "operationId": "recordExecution",
        "summary": "Record a sent transaction into swap history",
        "description": "For the swap's `type: transaction` step only — never submit an approve transaction here. CoW orders record themselves via POST /orders. Confirms the transaction actually exists on-chain (via rpc.vurto.fi) and its calldata hash matches a build for the declared wallet before writing anything. Plain and N:N builds are both supported.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "txHash",
                  "quoteId"
                ],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "EVM address that sent the transaction."
                  },
                  "txHash": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{64}$"
                  },
                  "quoteId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "submitted",
                        "confirmed",
                        "failed"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_tx_hash | quote_id_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "build_expired | tx_owned_by_another_wallet | tx_not_found_yet | transaction_build_mismatch | build_not_simulated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listExecutions",
        "summary": "List this wallet's swap history",
        "description": "Returns what we stored about this wallet's swaps (route, receiver, gain), which is more than the chain shows, so it needs proof that the wallet is yours: a machine credential issued to that wallet. Without one, 401 authentication_required; with another wallet's credential, 403 wallet_not_owned. Writing the wallet in the query is not proof.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "wallet",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK, newest first, capped at 50",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "authentication_required: no credential, so nothing proves the wallet is yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "wallet_not_owned: the credential belongs to another wallet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/executions/{id}": {
      "get": {
        "operationId": "refreshExecutionStatus",
        "summary": "Re-check a recorded execution's on-chain status",
        "description": "Polls the receipt again, and for a CoW ETH-flow transaction also checks the orderbook — a confirmed ETH-flow transaction only means the order was registered, the solver executes it later (or never).",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "wallet",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "submitted",
                        "confirmed",
                        "failed"
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "swap_not_found — wrong wallet or unknown id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness check",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/multi-quote": {
      "post": {
        "operationId": "multiQuote",
        "summary": "Quote an N:N basket: N input tokens funding M output tokens in one atomic transaction",
        "description": "Not decomposable into separate POST /quote calls — the backend's waterfall allocation (which input finances which output) is the thing being computed, then each resulting slice is quoted through the same provider fan-out POST /quote uses. inputLegs[] is what you sell (tokenIn + amount|amountRaw, each). outputLegs[] is what you want back as outputPercent, an integer percent of the TOTAL basket value (not a fixed amount) — every outputLegs[].outputPercent in the request must sum to exactly 100. Up to 10 combined input+output legs; the waterfall never produces more than inputLegs.length + outputLegs.length - 1 real on-chain legs. CoW is never a candidate leg (an EIP-712 signature or a separately-settled ETH-flow order can't be one leg of one atomic transaction). Pass the signing wallet to receive a buildable basket quoteId; without it the response is indicative and has no handoff.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "inputLegs",
                  "outputLegs"
                ],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "Optional EVM signing address. Makes the basket quote executable and adds quoteId to the response."
                  },
                  "chainId": {
                    "type": "integer",
                    "description": "The multi-swap router must be deployed on this chain or the request fails with 503 multi_swap_not_supported_on_chain."
                  },
                  "inputLegs": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "tokenIn"
                      ],
                      "properties": {
                        "tokenIn": {
                          "type": "string",
                          "description": "Address or symbol."
                        },
                        "amount": {
                          "type": "string",
                          "description": "Human decimal amount. Use this OR amountRaw, not both."
                        },
                        "amountRaw": {
                          "type": "string",
                          "description": "Raw integer string in tokenIn's smallest unit."
                        }
                      }
                    }
                  },
                  "outputLegs": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "tokenOut",
                        "outputPercent"
                      ],
                      "properties": {
                        "tokenOut": {
                          "type": "string",
                          "description": "Address or symbol."
                        },
                        "outputPercent": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100,
                          "description": "Integer percent of the TOTAL basket value this leg receives. Every outputLegs[].outputPercent must sum to exactly 100."
                        },
                        "receiver": {
                          "type": "string",
                          "description": "Optional: deliver this leg's output to a different address than the signing wallet."
                        }
                      }
                    }
                  },
                  "slippageBps": {
                    "type": "integer",
                    "minimum": 5,
                    "maximum": 500,
                    "description": "Applied to every leg. Default 50."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "quoteId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Present only when the request included wallet. Pass it to POST /multi-quote/build."
                    },
                    "chainId": {
                      "type": "integer"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "pivot": {
                      "type": "string",
                      "description": "USDC address on this chain — the internal reference asset the waterfall allocation prices every input/output against. Not part of execution."
                    },
                    "legs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MultiQuoteLeg"
                      },
                      "description": "Every leg the allocation produced and successfully quoted — this is what POST /multi-quote/build executes."
                    },
                    "failures": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "legIndex": {
                            "type": "integer"
                          },
                          "code": {
                            "type": "string"
                          }
                        }
                      },
                      "description": "A partial basket is possible and reported here, never silently dropped."
                    },
                    "indicative": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "integer",
                      "description": "Unix ms for the shortest-lived leg quote."
                    },
                    "refreshedAt": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_chain_id | invalid_input_legs | invalid_output_legs | too_many_legs | invalid_output_percent | token_required | invalid_amount | amount_required | zero_value_input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ambiguous_token — details.candidates has every match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "no_routes — no leg found a composable route; details.failures lists why | pivot_pricing_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "multi_swap_not_supported_on_chain | multi_swap_pivot_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/multi-quote/build": {
      "post": {
        "operationId": "multiQuoteBuild",
        "summary": "Build one atomic transaction executing every leg of an N:N basket",
        "description": "No credential is required; wallet is mandatory and declares the EVM address that will sign. Pass quoteId from POST /multi-quote to build that stored basket, or omit quoteId and send chainId/inputLegs/outputLegs to quote and build in one call. steps[] contains one approve step per DISTINCT input token that still needs allowance, followed by ONE transaction step executing every leg atomically. The approve target is the VurtoSwapRouter address (steps[].spender / the response's router), NOT each leg's underlying provider. Never record approve steps through POST /executions. If simulation.status is approval_required, send the approve step(s) first and call this endpoint again. The final transaction is recordable through POST /executions using the quoteId returned by this build.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet"
                ],
                "anyOf": [
                  {
                    "required": [
                      "quoteId"
                    ]
                  },
                  {
                    "required": [
                      "chainId",
                      "inputLegs",
                      "outputLegs"
                    ]
                  }
                ],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "EVM address that will sign the resulting transaction."
                  },
                  "quoteId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional handoff from POST /multi-quote. When present, the intent fields are not required."
                  },
                  "chainId": {
                    "type": "integer"
                  },
                  "inputLegs": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "tokenIn"
                      ],
                      "properties": {
                        "tokenIn": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "amountRaw": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "outputLegs": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "tokenOut",
                        "outputPercent"
                      ],
                      "properties": {
                        "tokenOut": {
                          "type": "string"
                        },
                        "outputPercent": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100
                        },
                        "receiver": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "slippageBps": {
                    "type": "integer",
                    "minimum": 5,
                    "maximum": 500,
                    "description": "Applied to every leg. Default 50."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "buildId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "buildHash": {
                      "type": "string"
                    },
                    "quoteId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "nextQuoteId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Present when the build refreshed the basket and produced a successor handoff."
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "chainId": {
                      "type": "integer"
                    },
                    "router": {
                      "type": "string",
                      "description": "VurtoSwapRouter address for this chain. Every approve step's spender."
                    },
                    "validUntil": {
                      "type": "integer",
                      "description": "Unix ms, 10 minutes out. No refresh endpoint for N:N — rebuild by calling this endpoint again with the same intent."
                    },
                    "legs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MultiBuildLeg"
                      }
                    },
                    "simulation": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "passed",
                            "approval_required",
                            "incomplete"
                          ]
                        },
                        "gasEstimate": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        },
                        "perLeg": {
                          "description": "Present when simulation ran per-leg detail."
                        }
                      }
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PlanStep"
                      }
                    },
                    "refreshedAt": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_chain_id | invalid_input_legs | invalid_output_legs | too_many_legs | invalid_output_percent | token_required | invalid_amount | amount_required | zero_value_input | no_legs | invalid_receiver",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_required — credential lacks the 'build' scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ambiguous_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "budget_exhausted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "no_routes | leg_not_composable | pivot_pricing_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "multi_swap_not_supported_on_chain | multi_swap_pivot_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders": {
      "post": {
        "operationId": "submitOrder",
        "summary": "Submit a signed CoW order",
        "description": "Only for plans where `steps[].type === 'signature'`. Sign `steps[].typedData` with the wallet's private key (EIP-712), then POST the fields from `steps[].submit.bodyTemplate` with `signature` filled in. The server re-derives the order from the buildId's stored quote server-side — the body you send is proof of signature, not the source of truth for what gets submitted, so a compromised transport can't smuggle a different order past your signature.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "chainId",
                  "quoteId",
                  "signature"
                ],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "EVM address that signed the order."
                  },
                  "chainId": {
                    "type": "integer"
                  },
                  "quoteId": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string"
                  },
                  "order": {
                    "type": "object",
                    "description": "Optional: echo back the signed message for the server to double-check it matches what it built. Mismatches reject with 409 instead of submitting."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "History id when persistence succeeded. The accepted CoW uid remains authoritative if this is null."
                    },
                    "uid": {
                      "type": "string",
                      "description": "CoW order UID, 56 bytes hex. Cite this in support, there's no transaction hash."
                    },
                    "buildHash": {
                      "type": "string"
                    },
                    "correlationId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_cow_order | quote_id_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "build_expired | build_chain_mismatch | order does not match build",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/quote": {
      "post": {
        "operationId": "quote",
        "summary": "Get ranked routes for a swap, without building anything",
        "description": "tokenIn/tokenOut accept a contract address or a symbol (case-insensitive). A symbol matching more than one token on that chain returns 409 ambiguous_token with every candidate — never guesses. Pass wallet to persist a buildable handoff; without wallet the quotes are indicative and can only be shown. A machine credential is optional and affects rate limiting, not whether a quote is executable.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "tokenIn",
                  "tokenOut"
                ],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "Optional EVM signing address. Makes quotes[].id buildable through POST /swap."
                  },
                  "chainId": {
                    "type": "integer"
                  },
                  "tokenIn": {
                    "type": "string",
                    "description": "Address or symbol."
                  },
                  "tokenOut": {
                    "type": "string",
                    "description": "Address or symbol."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Human decimal amount, e.g. \"1.5\". Use this OR amountRaw, not both."
                  },
                  "amountRaw": {
                    "type": "string",
                    "description": "Raw integer string in the input token's smallest unit."
                  },
                  "slippageBps": {
                    "type": "integer",
                    "description": "Defaults to a sane per-pair value server-side when omitted."
                  },
                  "receiver": {
                    "type": "string",
                    "description": "Optional address to deliver the output to, if different from the signing wallet. Only providers with `supportsReceiver: true` are returned when this is set — see NormalizedQuote. Building with it requires the paying wallet's signed authorization (POST /destination/challenge, then /destination/authorize) or an `invoiceId` whose recipient is this address; otherwise the build fails with 403 destination_not_authorized."
                  },
                  "invoiceId": {
                    "type": "string",
                    "description": "Optional: the open invoice this swap pays (INV-XXXX-XXXX). Its recipient, on the same chain, is accepted as `receiver` without a destination signature."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "resolved": {
                      "type": "object",
                      "properties": {
                        "tokenIn": {
                          "$ref": "#/components/schemas/TokenInfo"
                        },
                        "tokenOut": {
                          "$ref": "#/components/schemas/TokenInfo"
                        },
                        "amountRaw": {
                          "type": "string"
                        }
                      }
                    },
                    "quotes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NormalizedQuote"
                      },
                      "description": "Ranked best first by netValueUsd."
                    },
                    "bestQuoteId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "failures": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "provider": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "indicative": {
                      "type": "boolean"
                    },
                    "refreshedAt": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_chain_id | token_required | invalid_amount | amount_required | same_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "unknown_symbol",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ambiguous_token — details.candidates has every match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "no_routes — no provider returned a safe route",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/report": {
      "post": {
        "operationId": "submitReport",
        "summary": "Report a problem, with optional structured context",
        "description": "Anonymous calls are accepted by design — whoever is stuck before authenticating is exactly who most needs this. Rate-limited 5 per 5 minutes per IP. The request body goes through the same secret filter as every other endpoint: a message or context field that looks like a private key or seed phrase is rejected before anything is written.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message"
                ],
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 2000
                  },
                  "source": {
                    "type": "string",
                    "description": "Free text; use \"agent\" for anything not from the web UI."
                  },
                  "chainId": {
                    "type": "integer"
                  },
                  "context": {
                    "type": "object",
                    "description": "Arbitrary diagnostic JSON, e.g. the last quote/build/error you saw. Truncated at 8000 chars, stored as-is, never interpreted."
                  },
                  "appVersion": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "received": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "report_too_short | secret_in_payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/svm/balances": {
      "get": {
        "operationId": "svmBalances",
        "summary": "Wallet balances on Solana",
        "parameters": [
          {
            "name": "chainId",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "solana-mainnet"
              ],
              "description": "Solana names its network, it does not number it."
            }
          },
          {
            "name": "wallet",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "base58 address."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SOL plus every token account with a non-zero balance."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "invalid_address | invalid_chain_id"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rpc_failed"
          }
        }
      }
    },
    "/svm/chains": {
      "get": {
        "operationId": "svmChains",
        "summary": "Solana networks supported",
        "responses": {
          "200": {
            "description": "The Solana networks this API serves."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "invalid_chain_id"
          }
        }
      }
    },
    "/svm/execute": {
      "post": {
        "operationId": "svmExecute",
        "summary": "Broadcast a signed Solana transaction",
        "description": "How you call this depends on whether the build returned an executionRef. Absent: we assembled the route, so send only signedTransaction and we broadcast it. Present: the route came from the meta-aggregator, an RFQ leg can involve a market maker with last-look rights, and it refuses a transaction altered after quoting, so it has to go back through it to land. Broadcasting that one yourself raises no error, it simply never confirms. Either way this is a relay, not custody: the transaction arrives already signed, so all this can do is deliver it or not.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "signedTransaction"
                ],
                "properties": {
                  "signedTransaction": {
                    "type": "string",
                    "description": "base64 of the fully signed transaction."
                  },
                  "executionRef": {
                    "type": "string",
                    "description": "Only when the build carried one."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{signature, status}. status \"pending\" means the network accepted the send, which is not the same as having put it in a block."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "invalid_execution — the signed transaction is missing or malformed"
          },
          "409": {
            "description": "transaction_expired: the transaction outlived its blockhash, about a minute, An earlier attempt may still have landed: check the signature with GET /svm/tx, passing lastValidBlockHeight, before building another."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "execution_failed — the network or the aggregator refused it"
          }
        }
      }
    },
    "/svm/multi-quote": {
      "post": {
        "operationId": "svmMultiQuote",
        "summary": "Quote an N:N basket on Solana",
        "description": "Same inputLegs/outputLegs shape as POST /multi-quote, with the leg tokens named the Solana way. outputLegs[].outputPercent must sum to 100.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "inputLegs",
                  "outputLegs"
                ],
                "properties": {
                  "chainId": {
                    "type": "string",
                    "enum": [
                      "solana-mainnet"
                    ],
                    "description": "Solana names its network, it does not number it."
                  },
                  "wallet": {
                    "type": "string",
                    "description": "base58 address."
                  },
                  "slippageBps": {
                    "type": "integer",
                    "description": "Optional."
                  },
                  "inputLegs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tokenIn": {
                          "type": "string",
                          "description": "Mint address, or the symbol of a VERIFIED token. Symbols resolve only against the verified list on purpose: on Solana anyone can mint a token carrying another one's symbol, name and icon, and the mint is the only real identity. CASE-SENSITIVE."
                        },
                        "amount": {
                          "type": "string",
                          "description": "Human decimal."
                        },
                        "amountIn": {
                          "type": "string",
                          "description": "Raw integer string."
                        }
                      }
                    }
                  },
                  "outputLegs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tokenOut": {
                          "type": "string",
                          "description": "Mint address, or the symbol of a VERIFIED token. Symbols resolve only against the verified list on purpose: on Solana anyone can mint a token carrying another one's symbol, name and icon, and the mint is the only real identity. CASE-SENSITIVE."
                        },
                        "outputPercent": {
                          "type": "integer",
                          "description": "Integer percent of total basket value. Must sum to 100."
                        },
                        "receiver": {
                          "type": "string",
                          "description": "Optional per-leg destination."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-leg quotes for the basket."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "invalid_basket | invalid_percent — every outputPercent must be > 0 and sum to 100"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "token_not_found"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "no_routes"
          }
        }
      }
    },
    "/svm/multi-swap": {
      "post": {
        "operationId": "svmMultiSwap",
        "summary": "Build an N:N basket into size-safe Solana batches",
        "description": "No router contract of ours is involved, unlike EVM. The server compiles real versioned messages and adds legs until the next one would exceed 1232 bytes or 64 accounts. executionPlan reports the exact batches and signatures. Each batch is atomic, but multiple batches have partial-execution risk. Resume with the same correlationId, an incremented buildAttempt and only pendingLegIndexes; never repeat confirmed legs.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "inputLegs",
                  "outputLegs"
                ],
                "properties": {
                  "chainId": {
                    "type": "string",
                    "enum": [
                      "solana-mainnet"
                    ],
                    "description": "Solana names its network, it does not number it."
                  },
                  "wallet": {
                    "type": "string",
                    "description": "base58 address."
                  },
                  "slippageBps": {
                    "type": "integer",
                    "description": "Optional."
                  },
                  "correlationId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional on the first build; required unchanged when resuming pending legs."
                  },
                  "buildAttempt": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "description": "Monotonic attempt number within correlationId."
                  },
                  "pendingLegIndexes": {
                    "type": "array",
                    "description": "Expanded global leg indexes to rebuild. Omit for the first build. Confirmed legs must never be included.",
                    "items": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "inputLegs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tokenIn": {
                          "type": "string",
                          "description": "Mint address, or the symbol of a VERIFIED token. Symbols resolve only against the verified list on purpose: on Solana anyone can mint a token carrying another one's symbol, name and icon, and the mint is the only real identity. CASE-SENSITIVE."
                        },
                        "amount": {
                          "type": "string",
                          "description": "Human decimal."
                        },
                        "amountIn": {
                          "type": "string",
                          "description": "Raw integer string."
                        }
                      }
                    }
                  },
                  "outputLegs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tokenOut": {
                          "type": "string",
                          "description": "Mint address, or the symbol of a VERIFIED token. Symbols resolve only against the verified list on purpose: on Solana anyone can mint a token carrying another one's symbol, name and icon, and the mint is the only real identity. CASE-SENSITIVE."
                        },
                        "outputPercent": {
                          "type": "integer",
                          "description": "Integer percent of total basket value. Must sum to 100."
                        },
                        "receiver": {
                          "type": "string",
                          "description": "Optional per-leg destination."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A build with correlationId, executionPlan and lotes[]. Each lote has one unsigned transaction, exact legIndexes, serialized bytes, account count, Token-2022 presence and compute consumed."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "invalid_basket | invalid_percent"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "simulation_failed"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "no_routes | rpc_failed"
          }
        }
      }
    },
    "/svm/prices": {
      "get": {
        "operationId": "svmPrices",
        "summary": "USD price for several mints at once",
        "parameters": [
          {
            "name": "mints",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated mints, up to 80."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A map of mint to USD price. A mint whose price could not be established is absent rather than zero: zero is a price, and a wrong price is worse than no price."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited"
          }
        }
      }
    },
    "/evm/prices": {
      "get": {
        "operationId": "evmPrices",
        "summary": "USD price for EVM tokens, independent of any wallet balance",
        "parameters": [
          {
            "name": "chainId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "EVM chain id."
            }
          },
          {
            "name": "tokens",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated token addresses (0x), up to 20. The native coin is 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A map of lowercase token address to USD price. A token whose price could not be established is absent rather than zero: zero is a price, and a wrong price is worse than no price."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "unsupported_chain"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited"
          }
        }
      }
    },
    "/svm/quote": {
      "post": {
        "operationId": "svmQuote",
        "summary": "Ranked Solana routes, without building anything",
        "description": "Two request shapes, both accepted. Short (agents): tokenIn/tokenOut as symbol or mint plus a human \"amount\". Explicit (when you already hold mints and decimals): add tokenInDecimals, tokenOutDecimals and a raw \"amountIn\", which skips token resolution entirely. Ranked by output after our fee. orca and meteora price by reading pool state on-chain rather than asking an API, which is why they win on pairs where aggregators route around thin liquidity.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "tokenIn",
                  "tokenOut"
                ],
                "properties": {
                  "chainId": {
                    "type": "string",
                    "enum": [
                      "solana-mainnet"
                    ],
                    "description": "Solana names its network, it does not number it."
                  },
                  "tokenIn": {
                    "type": "string",
                    "description": "Mint address, or the symbol of a VERIFIED token. Symbols resolve only against the verified list on purpose: on Solana anyone can mint a token carrying another one's symbol, name and icon, and the mint is the only real identity. CASE-SENSITIVE."
                  },
                  "tokenOut": {
                    "type": "string",
                    "description": "Mint address, or the symbol of a VERIFIED token. Symbols resolve only against the verified list on purpose: on Solana anyone can mint a token carrying another one's symbol, name and icon, and the mint is the only real identity. CASE-SENSITIVE."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Human decimal, e.g. \"50\". Use this OR amountIn."
                  },
                  "amountIn": {
                    "type": "string",
                    "description": "Raw integer string in tokenIn smallest unit."
                  },
                  "tokenInDecimals": {
                    "type": "integer",
                    "description": "Optional. Resolved server-side when omitted."
                  },
                  "tokenOutDecimals": {
                    "type": "integer",
                    "description": "Optional. Resolved server-side when omitted."
                  },
                  "slippageBps": {
                    "type": "integer",
                    "description": "Optional, a sane default applies."
                  },
                  "receiver": {
                    "type": "string",
                    "description": "Optional: deliver the output to this address instead of the signing wallet."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{quotes[], failures[], refreshedAt, providersQueried, indicative}. gainUserUsd is the proven advantage over the runner-up that stays with the user, null when there was nothing to prove; platformFeeBps states the fee that applies."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "invalid_chain_id | invalid_token | invalid_amount | same_token"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "token_not_found — no verified token with that symbol"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "ambiguous_token — details.candidates has every match"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "no_routes — no provider returned a safe route"
          }
        }
      }
    },
    "/svm/swap": {
      "post": {
        "operationId": "svmSwap",
        "summary": "Build one unsigned Solana transaction",
        "description": "There is no approve on Solana and therefore no steps[] array: the response carries a single base64 v0 transaction. simulation.status is \"passed\" only after the build was run against the network and the output was proven to reach the destination account, so anything else is a refusal to proceed, not a warning. Omit \"provider\" and the best route is chosen here, which costs one fan-out before the build; pass one from a prior quote and that wait disappears.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "tokenIn",
                  "tokenOut",
                  "wallet"
                ],
                "properties": {
                  "chainId": {
                    "type": "string",
                    "enum": [
                      "solana-mainnet"
                    ],
                    "description": "Solana names its network, it does not number it."
                  },
                  "tokenIn": {
                    "type": "string",
                    "description": "Mint address, or the symbol of a VERIFIED token. Symbols resolve only against the verified list on purpose: on Solana anyone can mint a token carrying another one's symbol, name and icon, and the mint is the only real identity. CASE-SENSITIVE."
                  },
                  "tokenOut": {
                    "type": "string",
                    "description": "Mint address, or the symbol of a VERIFIED token. Symbols resolve only against the verified list on purpose: on Solana anyone can mint a token carrying another one's symbol, name and icon, and the mint is the only real identity. CASE-SENSITIVE."
                  },
                  "wallet": {
                    "type": "string",
                    "description": "The signing wallet, base58. CASE-SENSITIVE."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Human decimal. Use this OR amountIn."
                  },
                  "amountIn": {
                    "type": "string",
                    "description": "Raw integer string."
                  },
                  "tokenInDecimals": {
                    "type": "integer",
                    "description": "Optional."
                  },
                  "tokenOutDecimals": {
                    "type": "integer",
                    "description": "Optional."
                  },
                  "slippageBps": {
                    "type": "integer",
                    "description": "Optional."
                  },
                  "provider": {
                    "type": "string",
                    "description": "Optional: jupiter_router, raydium, orca or meteora. Omitted means \"pick the best\". jupiter_meta is no longer compared: it charges its own fee, cannot deliver to a receiver other than the signer, and each Jupiter call queues behind a shared rate budget."
                  },
                  "receiver": {
                    "type": "string",
                    "description": "Optional: deliver the output to this address instead of the signing wallet. Only providers that can honour it are considered."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{build: {quote, transaction, buildId, lastValidBlockHeight, simulation, executionRef?}}. executionRef present or absent decides how you send it, see POST /svm/execute."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "invalid_chain_id | invalid_wallet | invalid_provider | invalid_amount"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "token_not_found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "ambiguous_token | slippage_exceeded: the Jupiter Router route was too large for one transaction and the simpler route that fits pays less than slippageBps allows; quote again"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "simulation_failed | output_check_failed — the route did not prove the output reaches the destination, nothing was signed"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "no_routes | rpc_failed | transaction_too_large: the route does not fit in 1232 bytes even after asking for simpler routes"
          }
        }
      }
    },
    "/svm/token": {
      "get": {
        "operationId": "svmToken",
        "summary": "Resolve one mint, with its risk flags",
        "description": "Returns {token, risks[]}. risks[] is the point of this endpoint: symbolCollision names the verified mint a lookalike is imitating, mintAuthorityOpen means more can be printed, freezeAuthorityOpen means your holding can be frozen. None of these is a verdict on its own, WLFI legitimately carries two of them.",
        "parameters": [
          {
            "name": "chainId",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "solana-mainnet"
              ],
              "description": "Solana names its network, it does not number it."
            }
          },
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The mint, base58."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Token plus risk flags."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "invalid_address"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "token_not_found"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "token_invalid — the provider returned a token we cannot trust"
          }
        }
      }
    },
    "/svm/tokens": {
      "get": {
        "operationId": "svmTokens",
        "summary": "Verified Solana token list",
        "parameters": [
          {
            "name": "chainId",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "solana-mainnet"
              ],
              "description": "Solana names its network, it does not number it."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Curated verified tokens, with mint, symbol, name and decimals."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "invalid_chain_id"
          }
        }
      }
    },
    "/svm/tx": {
      "get": {
        "operationId": "svmTxStatus",
        "summary": "Did the transaction land",
        "description": "Call this before telling anyone the swap worked. A wallet returns a signature at send time, not at confirmation, and those two moments separate exactly when the network is busy. \"expired\" means the network is past this transaction lastValidBlockHeight and it can no longer enter any block: nothing was spent and nothing was swapped.",
        "parameters": [
          {
            "name": "signature",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The transaction signature, base58."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{status: confirmed|pending|failed|expired, slot, reason?}"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "invalid_signature"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rpc_failed"
          }
        }
      }
    },
    "/svm/warm": {
      "post": {
        "operationId": "svmWarm",
        "summary": "Warm a Solana pair before you quote it",
        "description": "Say \"I am going to ask about this pair\" before you know the amount. Returns immediately and reads pool state in the background. Two of the four Solana venues, orca and meteora, are not APIs: their price is computed from pool state read live from the chain, and a cold quote will not wait for it, so it answers with two venues instead of four. The seconds you spend deciding how much are the seconds the read needs. amountIn may be \"0\": the amount does not change which pools are read. Optional, and it never slows the caller down.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "tokenIn",
                  "tokenOut"
                ],
                "properties": {
                  "chainId": {
                    "type": "string",
                    "enum": [
                      "solana-mainnet"
                    ],
                    "description": "Solana names its network, it does not number it."
                  },
                  "tokenIn": {
                    "type": "string",
                    "description": "Mint address, or the symbol of a VERIFIED token. Symbols resolve only against the verified list on purpose: on Solana anyone can mint a token carrying another one's symbol, name and icon, and the mint is the only real identity. CASE-SENSITIVE."
                  },
                  "tokenOut": {
                    "type": "string",
                    "description": "Mint address, or the symbol of a VERIFIED token. Symbols resolve only against the verified list on purpose: on Solana anyone can mint a token carrying another one's symbol, name and icon, and the mint is the only real identity. CASE-SENSITIVE."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Human decimal, e.g. \"50\". Use this OR amountIn."
                  },
                  "amountIn": {
                    "type": "string",
                    "description": "Raw integer string in tokenIn smallest unit."
                  },
                  "tokenInDecimals": {
                    "type": "integer",
                    "description": "Optional. Resolved server-side when omitted."
                  },
                  "tokenOutDecimals": {
                    "type": "integer",
                    "description": "Optional. Resolved server-side when omitted."
                  },
                  "slippageBps": {
                    "type": "integer",
                    "description": "Optional, a sane default applies."
                  },
                  "receiver": {
                    "type": "string",
                    "description": "Optional: deliver the output to this address instead of the signing wallet."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted. The reading happens after the response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "warming": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/swap": {
      "post": {
        "operationId": "swap",
        "summary": "Build a signable/sendable plan for a swap",
        "description": "No credential is required; wallet is mandatory and declares the EVM address that will sign. Two modes: pass `quoteId` from a prior POST /quote to build exactly that route; omit it and pass the intent fields (chainId, tokenIn, tokenOut, amount|amountRaw) to quote and build the best route in one round trip. When it picks the route itself, a route with GAIN comes first; if the first round has none, it re-quotes up to 3 rounds total (1.5 s apart) before falling back to the best route without gain, the same rule as Invoice. When the first round has no gain this costs up to two extra quote rounds plus 3 s of pauses, about 7-8 s more measured on Base on 02/10/2026; with gain in the first round it costs nothing. Always re-quotes fresh before building — if the market moved, `quote.amountOut` reflects the fresh price, not the one from POST /quote.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet"
                ],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "EVM address that will sign the plan."
                  },
                  "quoteId": {
                    "type": "string"
                  },
                  "chainId": {
                    "type": "integer"
                  },
                  "tokenIn": {
                    "type": "string"
                  },
                  "tokenOut": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "string"
                  },
                  "amountRaw": {
                    "type": "string"
                  },
                  "slippageBps": {
                    "type": "integer"
                  },
                  "maxSlippageBps": {
                    "type": "integer",
                    "description": "Optional ceiling, 0-10000, for every future POST /swap/{buildId}/refresh of this build. Once set it never loosens: a refresh asking for a laxer value is clamped back down to this."
                  },
                  "receiver": {
                    "type": "string",
                    "description": "Optional address to deliver the output to, if different from the signing wallet. Ignored when `quoteId` is set — the receiver from that quote is used. Only honored by providers with `supportsReceiver: true`."
                  },
                  "calldataSemSimulacao": {
                    "type": "boolean",
                    "description": "Opt-in: return the swap calldata even when the final simulation has not run, for DIRECT-POOL routes only. For an integrator that simulates on its own before listing the route, which is how aggregator adapters work. The default stays off and the general rule holds: a simulation that did not pass comes with no transaction. In a direct route the calldata is built by us from the pool we read, so what is missing is the proof of effect, not the provenance; relaying an aggregator calldata unsimulated stays refused. simulation.status is returned untouched, so the response never lies about what was checked."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SwapPlan"
                }
              }
            }
          },
          "400": {
            "description": "invalid_slippage_bps | invalid_chain_id | token_required | same_token | amount_required | invalid_amount",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "scope_required — credential lacks the 'build' scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "quote_expired | route_changed | insufficient_balance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "budget_exhausted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "no_routes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/swap/{buildId}/refresh": {
      "post": {
        "operationId": "refreshSwap",
        "summary": "Rebuild an existing plan with fresh pricing, without losing slippage protection",
        "description": "Use the `refresh` object from a prior SwapPlan response (or GET/derive `buildId` from `buildId` field) instead of calling POST /swap again with the same quoteId — this endpoint enforces two things POST /swap alone doesn't: the slippage ceiling never loosens across refreshes (`effectiveSlippageCap`), and if the underlying route's final destination address changed (not just repriced — a genuinely different router), it fails closed with 409 route_changed instead of silently swapping you into a different route. When the original provider disappears from the fan-out entirely, the 409 response embeds the current best route ready to use in `error.details.alternative`, so you don't need a third round trip.",
        "security": [],
        "parameters": [
          {
            "name": "buildId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet"
                ],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "Same EVM address used to build the original plan."
                  },
                  "slippageBps": {
                    "type": "integer",
                    "description": "0-10000. Clamped down to the original build's maxSlippageBps when one was set; never loosened."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK, a new SwapPlan with a new buildId",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SwapPlan"
                }
              }
            }
          },
          "400": {
            "description": "invalid_slippage_bps",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "missing or invalid credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "build_not_found — wrong wallet, or the 10-minute build window expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "route_changed (details.alternative may carry a ready plan) | slippage_exceeded (details has originalAmountOut, freshAmountOut, slippageBps, maxSlippageBps) | quote_expired — the underlying quote handoff (2 min) expired; call POST /swap fresh instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/token": {
      "get": {
        "operationId": "lookupToken",
        "summary": "Resolve an arbitrary token address on-chain",
        "description": "Reads symbol(), name(), decimals() live via RPC for a contract address not in the curated list, and caches the result 24h. Rate-limited per IP (30/min) — this triggers real RPC calls.",
        "security": [],
        "parameters": [
          {
            "name": "chainId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "item": {
                      "$ref": "#/components/schemas/TokenInfo"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unsupported_chain | invalid_token_address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tokens": {
      "get": {
        "operationId": "listTokens",
        "summary": "Curated token list for a chain",
        "description": "Cacheable for 15 minutes. Use this to resolve a symbol to an address client-side, or just pass the symbol straight to POST /quote and let the server resolve it (recommended — it also catches ambiguous symbols like USDC vs USDC.e).",
        "security": [],
        "parameters": [
          {
            "name": "chainId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "chainId": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TokenInfo"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "unsupported_chain",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/warm": {
      "post": {
        "operationId": "warm",
        "summary": "Warm an EVM pair before you quote it",
        "description": "Same idea as the Solana warm-up, with a smaller payoff: on EVM every venue is an API, so there is no pool state to pre-read and this only primes our own caches (token metadata, gas, provider health). Returns immediately. Optional.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "tokenIn",
                  "tokenOut"
                ],
                "properties": {
                  "chainId": {
                    "type": "integer"
                  },
                  "tokenIn": {
                    "type": "string",
                    "description": "Address or symbol."
                  },
                  "tokenOut": {
                    "type": "string",
                    "description": "Address or symbol."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Human decimal amount, e.g. \"1.5\". Use this OR amountRaw, not both."
                  },
                  "amountRaw": {
                    "type": "string",
                    "description": "Raw integer string in the input token's smallest unit."
                  },
                  "slippageBps": {
                    "type": "integer",
                    "description": "Defaults to a sane per-pair value server-side when omitted."
                  },
                  "receiver": {
                    "type": "string",
                    "description": "Optional address to deliver the output to, if different from the signing wallet. Only providers with `supportsReceiver: true` are returned when this is set — see NormalizedQuote. Building with it requires the paying wallet's signed authorization (POST /destination/challenge, then /destination/authorize) or an `invoiceId` whose recipient is this address; otherwise the build fails with 403 destination_not_authorized."
                  },
                  "invoiceId": {
                    "type": "string",
                    "description": "Optional: the open invoice this swap pays (INV-XXXX-XXXX). Its recipient, on the same chain, is accepted as `receiver` without a destination signature."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted. The reading happens after the response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "warming": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/invoices": {
      "post": {
        "operationId": "createInvoice",
        "summary": "Create an invoice (payment request)",
        "description": "No signature or API key needed. Only verified dollar stablecoins on the network allowlist are accepted for new invoices, even without paid analysis. A new invoice without payerChecks carries no fee; with payerChecks, one analysis fee for both wallets is deducted from the amount through the split (see payerChecks). Previously created invoices keep their original terms. Tokens are resolved by address or symbol: a cloned token with its own pool would let the creator sell a fake at any price. The payer can pay with any token on that network (see /invoices/{id}/pay). Rate-limited 10 per minute and 200 per day per IP. On Solana the free screening of the receiving wallet must pass before the invoice is created: 403 receiver_blocked, 503 screening_unavailable.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "recipient",
                  "token",
                  "amount"
                ],
                "properties": {
                  "chainId": {
                    "oneOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "solana-mainnet"
                        ]
                      }
                    ]
                  },
                  "recipient": {
                    "type": "string",
                    "description": "Who receives: a wallet (base58 and case-sensitive on Solana) or a Vurto user as \"@handle\". With \"@handle\" the Vurto Profile picks one of that user's wallets on this network (random among the ones marked for regular or, with confidential, private transfers; the rotation moves only after a confirmed payment). recipient_unavailable (400) answers the same for a handle that does not exist and one with no wallet here. With confidential true (since 28/11/2026) the recipient must be a Vurto user: a \"@handle\", or an address of an active Vurto profile; any other address is 400 recipient_not_vurto_user, and 503 recipient_check_unavailable when the Vurto Profile cannot be asked. Nothing is created in either case."
                  },
                  "token": {
                    "type": "string",
                    "description": "Address/mint or symbol of a verified dollar stablecoin accepted on this network. Other tokens return stablecoin_required, even without paid analysis."
                  },
                  "amount": {
                    "type": "string",
                    "description": "Human decimal, e.g. \"100\"."
                  },
                  "memo": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "checks": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "scorechain",
                        "merkle-science",
                        "crystal"
                      ]
                    },
                    "description": "Closed for new invoices since 07/11/2026: a paid check (scorechain, merkle-science) is refused with 400 paid_check_moved on every network. The analysis of the paying wallet goes in payerChecks; the payer buys the analysis of the receiving wallet with /invoices/{id}/analysis-payment/transfer. Invoices created before keep their analysis charge. Any other value: 400 invalid_check."
                  },
                  "payerChecks": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "scorechain",
                        "merkle-science",
                        "crystal"
                      ]
                    },
                    "description": "Solana and EVM networks with invoiceSplit=true in /v1/chains. Stablecoin invoices only: USDC, USDT (including USDT0), PYUSD, USDG and USD1, by verified address on each network; availability differs by network. The PAID analysis, chosen by the receiver: it runs on the payer wallet and on the receiving wallet. ONE analysis fee covers both wallets, the same whichever tools: since 16/11/2026 two consultations at a fixed price (https://docs.vurto.fi/fees), deducted from the amount through the split. The invoice comes back with payerChecks and split {rule: flat, fee, receiverAmount, feeWallet} (brackets on an invoice of 10/11 to 16/11/2026): the payer sends the amount, the receiver gets split.receiverAmount, and nothing is paid first. Below the minimum: 400 amount_below_analysis_minimum (details.minimum). It runs when the payer calls /invoices/{id}/pay, after the free screening and the payer wallet proof. 503 analysis_tool_unavailable when the tool is not answering: nothing is created. crystal (Crystal Risk Check, since 17/11/2026) only for a SIGNED wallet (its session; 401 kyc_wallet_signature_required otherwise) with an approved KYC (403 kyc_required otherwise); it adds its own price per consultation, raising the fee and the minimum, and covers Ethereum, Optimism, BNB Chain, Polygon, Base, Arbitrum One, Avalanche and Solana."
                  },
                  "confidentialChecks": {
                    "type": "array",
                    "maxItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "merkle-science",
                        "crystal"
                      ]
                    },
                    "description": "Since 28/11/2026 the private contract runs ONE paid analysis on both wallets, besides the free screening that always runs: the creator sends confidentialChecks as [\"merkle-science\"] or [\"crystal\"]. Both together and scorechain are 400 invalid_private_checks. Crystal needs the approved KYC of whoever configures (the signed creator wallet, or a POST /v1/kyc/proof in X-Wallet-Proof): without it 403 kyc_required (401 kyc_wallet_signature_required with no proven wallet). Absent or [] is Crystal when the creator has that KYC on an EVM network, else Merkle Science. The payer does not choose and needs no KYC for Crystal to run. The fee is two consultations of that analysis (payer and receiver), US$ 0.80 today, read from the price variables; the minimum is that fee plus one withdrawal analysis (US$ 0.40), so the note pays its own withdrawal, rounded up to the whole dollar: US$ 2 today. An invoice created before 28/11/2026 keeps the analyses and the price it was quoted with. The entry refuses a wallet from the risk score CORTE_DE_RISCO_DO_COFRE on (50). The private contract asks the KYC of the payer only above the no-KYC limit per paying wallet in 24 hours (the system variable PRIVADO_SEM_KYC_ATE_USD, whose value the refusal carries in details.limit.limitUsd) (403 kyc_required with details.limit { limitUsd, usedUsd, remainingUsd }); whoever receives always verifies to withdraw."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invoice": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string",
                          "description": "INV-XXXX-XXXX, what people copy."
                        },
                        "family": {
                          "type": "string",
                          "enum": [
                            "evm",
                            "svm"
                          ]
                        },
                        "chainId": {
                          "oneOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "recipient": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "tokenSymbol": {
                          "type": "string"
                        },
                        "tokenDecimals": {
                          "type": "integer"
                        },
                        "amount": {
                          "type": "string",
                          "description": "Requested amount, raw units."
                        },
                        "memo": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "paid"
                          ]
                        },
                        "paidTx": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "received": {
                          "type": "string",
                          "description": "Raw amount measured on-chain reaching the recipient, over confirmed payments."
                        },
                        "url": {
                          "type": "string",
                          "description": "Share this: https://swap.vurto.fi/i/<id>. Link previews show the QR."
                        },
                        "qr": {
                          "type": "string",
                          "description": "PNG of the QR for url."
                        },
                        "payments": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "recipientHandle": {
                          "type": "string",
                          "description": "Present on an invoice created for \"@handle\": the handle, which the screen shows instead of the address."
                        },
                        "analysisOf": {
                          "type": "string",
                          "enum": [
                            "payer"
                          ],
                          "description": "Present on a Vurto Dead Alive donation (since 11/11/2026): its fee pays the paid analysis of the paying wallet only; the receiving wallet gets the free screening. Absent on every other invoice, where a fee by brackets pays the analysis of both wallets."
                        },
                        "receiverAnalysisFee": {
                          "description": "The receiving wallet analysis the payer can buy (invoice_analysis_pay with checks), since 16/11/2026: one consultation at the fixed price, in dollars, or that the amount is below the minimum. Absent where it cannot be bought (paid, private, split.rule flat or brackets, a token that is not a dollar stablecoin).",
                          "oneOf": [
                            {
                              "type": "object",
                              "required": [
                                "available",
                                "amount",
                                "minimum"
                              ],
                              "properties": {
                                "available": {
                                  "type": "boolean",
                                  "enum": [
                                    true
                                  ]
                                },
                                "amount": {
                                  "type": "string",
                                  "description": "Dollars, two decimals, e.g. \"1.00\"."
                                },
                                "minimum": {
                                  "type": "string"
                                }
                              }
                            },
                            {
                              "type": "object",
                              "required": [
                                "available",
                                "minimum"
                              ],
                              "properties": {
                                "available": {
                                  "type": "boolean",
                                  "enum": [
                                    false
                                  ]
                                },
                                "minimum": {
                                  "type": "string",
                                  "description": "The smallest amount that takes the analysis, in the token."
                                }
                              }
                            }
                          ]
                        }
                      }
                    },
                    "next": {
                      "type": "object",
                      "description": "Only when the invoice has an analysis charge for its creator: the call that pays it. Share the link after that; until then /pay answers 409 analysis_unpaid.",
                      "properties": {
                        "tool": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "method": {
                          "type": "string"
                        },
                        "body": {
                          "type": "object",
                          "properties": {
                            "payer": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "token_not_listed, invalid_amount, invalid_recipient, unsupported_chain, recipient_is_fee_wallet, recipient_not_a_wallet, stablecoin_required, split_not_available_on_chain, paid_check_moved, analysis_checks_conflict (paid checks with payerChecks), private_invoice_checks (payerChecks on a private invoice), invalid_private_checks (a bad confidentialChecks, or one on a non-private invoice), amount_below_analysis_minimum (with payerChecks or confidential, below details.minimum), recipient_not_vurto_user (confidential true to an address that is not of an active Vurto profile)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ambiguous_token: the symbol matches more than one token; use the address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "screening_unavailable, analysis_tool_unavailable (details.check says which; nothing is created)"
          }
        },
        "parameters": [
          {
            "name": "X-Wallet-Proof",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only with \"crystal\": the walletProof of POST /kyc/proof for the wallet that asks for it (the receiver on POST /invoices, the payer on POST /payouts). Without it, 401 kyc_wallet_signature_required."
          }
        ]
      }
    },
    "/invoices/{id}": {
      "get": {
        "operationId": "getInvoice",
        "summary": "Read an invoice",
        "description": "Pending payments are re-checked on-chain on every read; a payment pending for over an hour becomes tx_not_found.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "INV-XXXX-XXXX, or the 8-character id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invoice": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string",
                          "description": "INV-XXXX-XXXX, what people copy."
                        },
                        "family": {
                          "type": "string",
                          "enum": [
                            "evm",
                            "svm"
                          ]
                        },
                        "chainId": {
                          "oneOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "recipient": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "tokenSymbol": {
                          "type": "string"
                        },
                        "tokenDecimals": {
                          "type": "integer"
                        },
                        "amount": {
                          "type": "string",
                          "description": "Requested amount, raw units."
                        },
                        "memo": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "paid"
                          ]
                        },
                        "paidTx": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "received": {
                          "type": "string",
                          "description": "Raw amount measured on-chain reaching the recipient, over confirmed payments."
                        },
                        "url": {
                          "type": "string",
                          "description": "Share this: https://swap.vurto.fi/i/<id>. Link previews show the QR."
                        },
                        "qr": {
                          "type": "string",
                          "description": "PNG of the QR for url."
                        },
                        "payments": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "recipientHandle": {
                          "type": "string",
                          "description": "Present on an invoice created for \"@handle\": the handle, which the screen shows instead of the address."
                        },
                        "analysisOf": {
                          "type": "string",
                          "enum": [
                            "payer"
                          ],
                          "description": "Present on a Vurto Dead Alive donation (since 11/11/2026): its fee pays the paid analysis of the paying wallet only; the receiving wallet gets the free screening. Absent on every other invoice, where a fee by brackets pays the analysis of both wallets."
                        },
                        "receiverAnalysisFee": {
                          "description": "The receiving wallet analysis the payer can buy (invoice_analysis_pay with checks), since 16/11/2026: one consultation at the fixed price, in dollars, or that the amount is below the minimum. Absent where it cannot be bought (paid, private, split.rule flat or brackets, a token that is not a dollar stablecoin).",
                          "oneOf": [
                            {
                              "type": "object",
                              "required": [
                                "available",
                                "amount",
                                "minimum"
                              ],
                              "properties": {
                                "available": {
                                  "type": "boolean",
                                  "enum": [
                                    true
                                  ]
                                },
                                "amount": {
                                  "type": "string",
                                  "description": "Dollars, two decimals, e.g. \"1.00\"."
                                },
                                "minimum": {
                                  "type": "string"
                                }
                              }
                            },
                            {
                              "type": "object",
                              "required": [
                                "available",
                                "minimum"
                              ],
                              "properties": {
                                "available": {
                                  "type": "boolean",
                                  "enum": [
                                    false
                                  ]
                                },
                                "minimum": {
                                  "type": "string",
                                  "description": "The smallest amount that takes the analysis, in the token."
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "invoice_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/{id}/pay": {
      "post": {
        "operationId": "buildInvoicePayment",
        "summary": "Build the plan to pay an invoice",
        "description": "method \"transfer\" when tokenIn is the invoice token: a direct transfer built from the stored invoice, as a one-step plan (EVM steps[] with a transaction step; Solana a transaction without executionRef, broadcast via /svm/execute). method \"swap\" otherwise: amountIn is computed so the guaranteed minimum output covers the requested amount, through the route with GAIN when there is one, delivered to the recipient; plan is a /swap plan (EVM) or a /svm/swap build (Solana). Sign it like any plan, then POST the hash to /invoices/{id}/payments. Invoices with payerChecks: the creator pays the analysis first (409 analysis_unpaid), and it runs here on the payer wallet, after the free screening of both wallets; the payer proves the wallet first, with payerProof from /invoices/{id}/payer-challenge (a text that names this invoice and never the receiving wallet) or with /destination/challenge and /destination/authorize for this invoice's receiver, else 401 payer_signature_required; up to 2 payer wallets run here, and after that the plan comes out with warning, and the analysis runs on the report of a confirmed payment of the whole amount, with the result going to the creator; a transaction that reaches the receiver settles the invoice; 403 payer_blocked when it rejects the payer; 503 analysis_tool_unavailable while the tool can still read this wallet and is not answering. The plan delivers the whole amount to the receiver. An invoice created before 07/11/2026 can still carry split, and keeps it, and 403 analysis_offer_suspended applies only to those: then method \"transfer\" is ONE payment transaction (Solana: two TransferChecked; EVM: exact approve followed by VurtoInvoiceSplit.pay): split.receiverAmount to the receiver and split.fee to the Vurto fee wallet, and the response carries split. With another token on Solana, method \"swap\": plan is one Jupiter Router transaction including both explicit split transfers, with split metadata and no next step. Unsupported atomic routes fail before signing. On EVM, method \"swap_then_transfer\": plan is a swap into the payer's OWN wallet, and next tells you to call /pay again in the invoice token to get the split. An open, unpaid receiver analysis (/analysis-payment/transfer) does not hold this plan: anyone can open one naming a wallet, so pay and report it BEFORE calling this if you want its verdict to count. A paid one that went stale answers 409 receiver_analysis_unpaid, and a rejected receiver gets 403 receiver_blocked. While an unpaid analysis of the receiver is open for this payer, the answer carries warning and receiverAnalysis, and the plan pays without its verdict. Sign the transaction as returned: it is tied to this invoice and payer, so another invoice to the same recipient cannot claim it (tx_for_another_payment); a hand-built transfer is not, and the first report the network confirms wins. Proving the wallet with a named challenge (chargeId = the invoice id, chargeTxHash = the hash) and reporting again clears tx_for_another_payment for your own transaction.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "INV-XXXX-XXXX, or the 8-character id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payer"
                ],
                "properties": {
                  "payer": {
                    "type": "string",
                    "description": "Wallet that signs and pays."
                  },
                  "tokenIn": {
                    "type": "string",
                    "description": "Address/mint or symbol the payer pays with; default is the invoice token."
                  },
                  "slippageBps": {
                    "type": "integer",
                    "description": "Default 50."
                  },
                  "payerProof": {
                    "type": "object",
                    "deprecated": true,
                    "description": "Not needed since 01/12/2026: the payer signs no message, the paid analysis runs on the declared payer and the network ties it. Old clients may still send the payer proof of THIS invoice, from POST /invoices/{id}/payer-challenge: nonce plus signature (EVM EIP-191 hex; Solana ed25519 base58, raw or in a Ledger envelope) or transaction (Solana: the proofTransaction signed, never sent). Checked and consumed by this request only: it opens no other invoice, writes no destination authorization, and cannot be used twice (401 payer_proof_invalid with details.reason expired, changed, signature or malformed).",
                    "required": [
                      "nonce"
                    ],
                    "properties": {
                      "nonce": {
                        "type": "string"
                      },
                      "signature": {
                        "type": "string"
                      },
                      "transaction": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invoice": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string",
                          "description": "INV-XXXX-XXXX, what people copy."
                        },
                        "family": {
                          "type": "string",
                          "enum": [
                            "evm",
                            "svm"
                          ]
                        },
                        "chainId": {
                          "oneOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "recipient": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "tokenSymbol": {
                          "type": "string"
                        },
                        "tokenDecimals": {
                          "type": "integer"
                        },
                        "amount": {
                          "type": "string",
                          "description": "Requested amount, raw units."
                        },
                        "memo": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "paid"
                          ]
                        },
                        "paidTx": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "received": {
                          "type": "string",
                          "description": "Raw amount measured on-chain reaching the recipient, over confirmed payments."
                        },
                        "url": {
                          "type": "string",
                          "description": "Share this: https://swap.vurto.fi/i/<id>. Link previews show the QR."
                        },
                        "qr": {
                          "type": "string",
                          "description": "PNG of the QR for url."
                        },
                        "payments": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "method": {
                      "type": "string",
                      "enum": [
                        "transfer",
                        "swap"
                      ]
                    },
                    "requiredAmount": {
                      "type": "string"
                    },
                    "amountIn": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "gainUserUsd": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "plan": {
                      "type": "object"
                    },
                    "report": {
                      "type": "object",
                      "description": "Where to POST the hash afterwards."
                    },
                    "warning": {
                      "type": "string",
                      "description": "Present while an unpaid analysis of the receiver is open for this payer: the plan pays without its verdict."
                    },
                    "receiverAnalysis": {
                      "type": "object",
                      "description": "The open charge, without the receiving wallet. Comes with warning."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "native_sol_only: an invoice in SOL can only be paid in SOL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "payer_proof_invalid: an old client sent a payerProof that does not check out (details.reason). Since 01/12/2026 no payer proof is needed: send none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "invoice_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "invoice_already_paid, or price_moved (the minimum fell below the request between quote and build; call again), receiver_analysis_unpaid (a paid analysis of the receiver went stale, details.reason stale), recipient_is_fee_wallet, analysis_unpaid, analysis_not_in_split (receiverChecks with a tool, on any invoice, from a client built for the fee inside the payment: pay the analysis apart first)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "no_route",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "payer_blocked, receiver_blocked, analysis_offer_suspended, payer_above_threshold, receiver_above_threshold"
          },
          "429": {
            "description": "analysis_attempts_exceeded, rate_limited"
          },
          "503": {
            "description": "screening_unavailable, analysis_tool_unavailable (the analysis the creator paid for is waiting for the tool; details.check says which, nothing is built)"
          }
        }
      }
    },
    "/invoices/{id}/payer-challenge": {
      "post": {
        "operationId": "invoicePayerChallenge",
        "summary": "Deprecated: the text that proved the paying wallet for this invoice",
        "deprecated": true,
        "security": [],
        "description": "Not needed since 01/12/2026 (the payer signs no message; POST /invoices/{id}/pay runs the analysis on the declared payer). Kept for old clients: the text the payer signed to prove the paying wallet for ONE invoice, in one of 14 languages (lang: en, pt, es, ar, hi, id, vi, tr, tl, ko, ur, uk, ru, zh; regional codes such as pt-BR fold in; anything else is English). It names the invoice, the network, the paying wallet, the site (site: alive or swap, from the environment) and the deadline (10 minutes), and says the result of the analysis is visible to whoever created the invoice; never the receiving wallet. Sign message (EIP-191 on EVM, ed25519 on Solana), or on Solana with a Ledger the proofTransaction (a memo of the same text whose blockhash is its SHA-256, so it never lands), and send it as payerProof to POST /invoices/{id}/pay. 404 invoice_not_found, 409 invoice_already_paid, 409 private_invoice_vault_only for a private one.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "INV-XXXX-XXXX, or the 8-character id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payer"
                ],
                "properties": {
                  "payer": {
                    "type": "string",
                    "description": "Wallet that will sign and pay."
                  },
                  "lang": {
                    "type": "string",
                    "description": "Language of the text; default en."
                  },
                  "site": {
                    "type": "string",
                    "enum": [
                      "alive",
                      "swap"
                    ],
                    "description": "Which page the text names: alive (the Dead Alive donation page) or swap (default). The host comes from the environment, never from the Origin."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nonce": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "integer"
                    },
                    "lang": {
                      "type": "string"
                    },
                    "invoiceId": {
                      "type": "string"
                    },
                    "proofTransaction": {
                      "type": "string",
                      "description": "Solana only."
                    },
                    "rentLamports": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Solana only: lamports the payment leaves in rent for the token accounts it opens (receiver and fee wallet), so the page can check SOL before opening the wallet; null when it could not read."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/invoices/{id}/payments": {
      "post": {
        "operationId": "reportInvoicePayment",
        "summary": "Report the payment transaction",
        "description": "The server reads the transaction on-chain and measures what reached the recipient in the invoice token. The payer must be the signer and the transaction newer than the invoice, and is screened again here (403 payer_blocked: it does not count as paid, and once the network confirms the transaction the refusal is kept in the 10-year analysis record). With a paid analysis on the invoice and no prior proof of the payer wallet, the confirmed transaction is the proof: until then 409 payment_pending and nothing is recorded. Only a confirmed payment reserves a hash: a hash pays each recipient once (tx_already_used for a second invoice of the same recipient and token); different recipients in one transaction are a batch payout.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "INV-XXXX-XXXX, or the 8-character id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payer",
                  "txHash"
                ],
                "properties": {
                  "payer": {
                    "type": "string"
                  },
                  "txHash": {
                    "type": "string",
                    "description": "EVM hash or Solana signature."
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "transfer",
                      "swap"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Recorded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invoice": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string",
                          "description": "INV-XXXX-XXXX, what people copy."
                        },
                        "family": {
                          "type": "string",
                          "enum": [
                            "evm",
                            "svm"
                          ]
                        },
                        "chainId": {
                          "oneOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "recipient": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "tokenSymbol": {
                          "type": "string"
                        },
                        "tokenDecimals": {
                          "type": "integer"
                        },
                        "amount": {
                          "type": "string",
                          "description": "Requested amount, raw units."
                        },
                        "memo": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "paid"
                          ]
                        },
                        "paidTx": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "received": {
                          "type": "string",
                          "description": "Raw amount measured on-chain reaching the recipient, over confirmed payments."
                        },
                        "url": {
                          "type": "string",
                          "description": "Share this: https://swap.vurto.fi/i/<id>. Link previews show the QR."
                        },
                        "qr": {
                          "type": "string",
                          "description": "PNG of the QR for url."
                        },
                        "payments": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "200": {
            "description": "Already recorded, re-checked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invoice": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string",
                          "description": "INV-XXXX-XXXX, what people copy."
                        },
                        "family": {
                          "type": "string",
                          "enum": [
                            "evm",
                            "svm"
                          ]
                        },
                        "chainId": {
                          "oneOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "recipient": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "tokenSymbol": {
                          "type": "string"
                        },
                        "tokenDecimals": {
                          "type": "integer"
                        },
                        "amount": {
                          "type": "string",
                          "description": "Requested amount, raw units."
                        },
                        "memo": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "paid"
                          ]
                        },
                        "paidTx": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "received": {
                          "type": "string",
                          "description": "Raw amount measured on-chain reaching the recipient, over confirmed payments."
                        },
                        "url": {
                          "type": "string",
                          "description": "Share this: https://swap.vurto.fi/i/<id>. Link previews show the QR."
                        },
                        "qr": {
                          "type": "string",
                          "description": "PNG of the QR for url."
                        },
                        "payments": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_tx_hash",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "invoice_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "tx_already_used, recipient_is_fee_wallet, payment_pending",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "payer_blocked: the money already left and the refusal is recorded"
          },
          "429": {
            "description": "too_many_pending: send the hash again once it is mined"
          }
        }
      }
    },
    "/invoices/{id}/analysis-payment/transfer": {
      "post": {
        "operationId": "buildInvoiceAnalysisPayment",
        "summary": "Build the paid-analysis payment (the charge of the invoice creator, or with checks the payer buying the receiver analysis)",
        "description": "Two charges share this route, chosen by the body. Do not use it on an invoice whose split.rule is flat or brackets (since 10/11/2026): its fee is inside the payment and already pays the analysis of both wallets, and the call answers 409 analysis_included_in_fee. Without checks: the charge of the invoice creator (an older invoice with payerChecks, or with paid checks on EVM) whose analysis is awaiting_payment. Returns ONE unsigned USDC transfer of analysis.amount (the price written when that invoice was created: 0.10, 0.40 or 0.50) to the Vurto fee wallet, built by the server and carrying the mark of this charge (sign it exactly as returned: a transfer you build yourself is refused with analysis_payment_rejected, reason charge_not_tied, after the money has left), plus a plan in the shape of /invoices/{id}/pay. payer must be the invoice creator (403 not_invoice_creator before anything is built). The free screening runs first on the receiving wallet and the creator: 403 screening_blocked when one is rejected, 503 screening_unavailable when it cannot be read. Errors: 400 no_paid_check, 409 analysis_already_paid, 409 invoice_already_paid. With checks (Solana, and EVM networks with a split contract): this is how the PAYER buys the paid analysis of the RECEIVING wallet with their own money. Body {payer, checks}: checks is merkle-science, scorechain or both; [] gives up an unpaid one ({cancelled: true}). Since 16/11/2026 the charge is one consultation at the fixed price (https://docs.vurto.fi/fees), the same with one tool or two and whatever the amount, in the network USDC; invoice.receiverAnalysisFee says it before building ({available: true, amount} in dollars, or {available: false, minimum}). Below the minimum: 400 amount_below_analysis_minimum (details.minimum); an invoice in a token that is not a dollar stablecoin: 400 stablecoin_required. Adding a tool to an analysis already paid and fresh is a new purchase at the same fee. A tool that already ran on that wallet for this payer up to 30 days ago, with no movement measured on the wallet since (on EVM: the same nonce, native balance and balance of every dollar stablecoin of the network, and no contract code; on Solana: no new confirmed signature and the same SOL and associated dollar stablecoin accounts; a read that fails, or any other token or NFT, is not seen, and then the provider is called), comes from the history instead of the provider; each paid tool of the report carries receiverAnalysis.result.tools[].analyzedAt, the day it ran. A new purchase needs no wallet proof, the payment proves it; giving it up and changing the tools do (401 payer_signature_required). The free screening of both wallets must pass (403 screening_blocked with details.side). Returns the USDC transfer to the Vurto fee wallet, a plan, and receiverAnalysis {status, checks, amount, amountRaw, token, to}. An unpaid one does not hold /pay, so pay and report it before /pay if you want its verdict to count. A paid one goes stale when the receiving wallet moves, and then /pay answers 409 receiver_analysis_unpaid until it is redone or given up. Another token, on Solana only: POST /svm/swap from the payer with receiver = receiverAnalysis.to and invoiceId.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "INV-XXXX-XXXX, or the 8-character id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Wallet-Proof",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only with \"crystal\" in checks: the walletProof of POST /kyc/proof for the PAYER. The destination authorization does not prove the wallet for Crystal; without the proof, 401 kyc_wallet_signature_required."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payer"
                ],
                "properties": {
                  "payer": {
                    "type": "string",
                    "description": "Without checks: the invoice creator wallet (the signed-in wallet when it was created, otherwise the receiving wallet). With checks: the wallet that will pay the invoice."
                  },
                  "checks": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "scorechain",
                        "merkle-science",
                        "crystal"
                      ]
                    },
                    "description": "The paid analyses of the RECEIVING wallet the payer buys, on Solana and EVM networks with a split contract. [] gives up an unpaid one. Leave it out for the charge of the invoice creator: anyone else gets 403 not_invoice_creator. crystal (Crystal Risk Check, since 17/11/2026) only for a SIGNED wallet (its session; 401 kyc_wallet_signature_required otherwise) with an approved KYC (403 kyc_required otherwise); it adds its own price per consultation, raising the fee and the minimum, and covers Ethereum, Optimism, BNB Chain, Polygon, Base, Arbitrum One, Avalanche and Solana."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Unsigned transfer and plan"
          },
          "400": {
            "description": "invalid_check: only checks [] gives up, and leaving it out is refused on a new-model invoice; no_paid_check; check_not_available_on_chain"
          },
          "401": {
            "description": "payer_signature_required: giving up, changing the tools or reusing a stored analysis"
          },
          "403": {
            "description": "not_invoice_creator, screening_blocked with details.side"
          },
          "409": {
            "description": "analysis_already_paid, invoice_already_paid, analysis_unpaid (the charge of the creator is open, so nothing else is sold on this invoice)"
          },
          "503": {
            "description": "screening_unavailable, analysis_tool_unavailable (details.check says which; nothing is charged)"
          }
        }
      }
    },
    "/invoices/{id}/analysis-payment": {
      "post": {
        "operationId": "reportInvoiceAnalysisPayment",
        "summary": "Report the paid-analysis payment",
        "description": "The server reads the transaction on-chain: a direct USDC transfer (the USDC of the invoice network) from the invoice creator to the Vurto fee wallet, of at least analysis.amount, newer than the invoice. A hash pays one analysis only and never one already used as an invoice payment (409 tx_already_used). 403 screening_blocked: the free screening rejects the receiving wallet or the creator, and nothing is registered. 409 analysis_payment_pending: not mined yet, send again. 400 analysis_payment_rejected with details.reason (wrong_token, wrong_destination, amount_too_low, sender_not_creator, not_a_transfer, tx_reverted, tx_before_invoice). The payer who bought the analysis of the receiving wallet sends payer too (Solana and EVM); the creator needs only txHash. The transaction must be signed by that payer, deliver the full amount to the fee wallet and give USDC to nobody else (reason usdc_to_other_wallet: the split payment of an invoice never pays it; sender_not_payer). Once paid, the receiver analysis runs right away and receiverAnalysis.result comes back: the verdict and what each paid tool read, never the receiving wallet.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "INV-XXXX-XXXX, or the 8-character id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "txHash"
                ],
                "properties": {
                  "txHash": {
                    "type": "string",
                    "description": "EVM hash or Solana signature."
                  },
                  "payer": {
                    "type": "string",
                    "description": "The paying wallet that bought the receiver analysis. Not needed for the charge of the invoice creator."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Analysis paid; returns {invoice} with analysis.status paid"
          },
          "200": {
            "description": "Already registered with this hash"
          },
          "400": {
            "description": "invalid_tx_hash, no_paid_check, analysis_payment_rejected with details.reason and details.feeWallet"
          },
          "409": {
            "description": "analysis_payment_pending (send the same hash again, do not pay again), analysis_already_paid, analysis_charge_changed, analysis_charge_replaced (build the charge again and sign the new value: an open line from when the analysis went inside the payment, or a charge opened at the old price per tool whose reported transaction was not mined before this deploy, rewritten by the price of now; a hash on it mined before the deploy pays the recorded value, and one confirmed without the block time answers analysis_payment_pending), tx_already_used, analysis_payer_required (the charge of the creator is paid, and this hash is not it: if it is the payer buying the other analysis, send payer)"
          },
          "503": {
            "description": "screening_unavailable"
          },
          "403": {
            "description": "screening_blocked: the free screening rejects the receiving wallet or the creator, and nothing is registered."
          }
        }
      },
      "get": {
        "operationId": "receiverAnalysisState",
        "summary": "State of a payer's receiver analysis",
        "description": "Only whether this wallet's charge is open or paid (the charge it bought, or the one of the invoice creator when it is the creator), without the hash or the result. Ask this before signing a saved plan again: building the charge again rewrites it.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{status}: none, awaiting_payment or paid"
          },
          "400": {
            "description": "invalid_payer"
          },
          "404": {
            "description": "invoice_not_found"
          },
          "429": {
            "description": "rate_limited: 60 a minute"
          }
        }
      }
    },
    "/destination/challenge": {
      "post": {
        "summary": "Get the text the paying wallet signs to authorize another destination",
        "description": "Destination lock. Any build whose `receiver` differs from the signing wallet (swap, double, N:N, on EVM and Solana) is refused with 403 destination_not_authorized unless the paying wallet signed this text. Returns a one-time code, valid 30 minutes, bound to wallet, receiver and chain. On Solana it also returns `proofTransaction`, a memo transaction that can never land, for wallets (Ledger) that cannot sign messages. Paying an invoice does not need this: pass `invoiceId` on the quote and the invoice recipient is the destination.",
        "operationId": "destinationChallenge",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "receiver",
                  "chainId"
                ],
                "properties": {
                  "wallet": {
                    "type": "string",
                    "description": "The wallet that pays and signs."
                  },
                  "receiver": {
                    "type": "string",
                    "description": "The full destination address. Solana base58 is case-sensitive."
                  },
                  "chainId": {
                    "oneOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "solana-mainnet"
                        ]
                      }
                    ]
                  },
                  "chargeId": {
                    "type": "string",
                    "description": "Only to claim a payment refused with charge_not_tied: the loteId or invoice id of that charge. Goes with chargeTxHash; the text you sign names both, and an authorization without them does not claim anything."
                  },
                  "chargeTxHash": {
                    "type": "string",
                    "description": "Only with chargeId: the hash of the payment you are claiming."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Text to sign",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nonce": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string",
                      "description": "Sign exactly this text: EIP-191 personal_sign on EVM, ed25519 signMessage on Solana. It names the full receiver, the chain and the expiry."
                    },
                    "expiresAt": {
                      "type": "integer"
                    },
                    "proofTransaction": {
                      "type": "string",
                      "description": "Solana only: base64 unsigned memo transaction with the same text, for wallets that cannot sign messages."
                    },
                    "typedData": {
                      "type": "object",
                      "description": "EVM only: the same authorization as EIP-712 typed data ({domain, types, primaryType, message}), which @vurto/sign-tx and prepare_signing sign as a `signature` step."
                    },
                    "buildId": {
                      "type": "string",
                      "description": "For prepare_signing: it points the next step to destination_authorize."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_wallet, invalid_receiver, destination_is_wallet or unsupported_chain"
          },
          "429": {
            "description": "rate_limited"
          }
        }
      }
    },
    "/destination/authorize": {
      "post": {
        "summary": "Authorize a destination with the paying wallet's signature",
        "description": "Verifies the signature over the exact challenge text and stores a short authorization (until the challenge expiry) for wallet + receiver + chain. There is no header, flag or parameter that replaces the signature. Each code works once. Smart-contract wallets (EIP-1271, e.g. Safe) are verified by calling isValidSignature on the wallet contract on that chain.",
        "operationId": "destinationAuthorize",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "receiver",
                  "chainId",
                  "nonce",
                  "message"
                ],
                "properties": {
                  "wallet": {
                    "type": "string"
                  },
                  "receiver": {
                    "type": "string"
                  },
                  "chainId": {
                    "oneOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "solana-mainnet"
                        ]
                      }
                    ]
                  },
                  "nonce": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string",
                    "description": "The challenge text, unchanged."
                  },
                  "signature": {
                    "type": "string",
                    "description": "EVM: 0x hex signature, EIP-191 over `message` or EIP-712 over `typedData`. Solana: base58 ed25519 signature over `message`, raw or inside a Solana off-chain message envelope (legacy, v0, v1) as a Ledger signs it. Send this OR transaction."
                  },
                  "transaction": {
                    "type": "string",
                    "description": "Solana only: the signed proofTransaction, base64. It is verified, never broadcast."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "authorized": {
                      "type": "boolean"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "destination": {
                      "type": "string"
                    },
                    "chainId": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "signature_invalid, signature_wallet_mismatch, authorization_invalid, authorization_expired, authorization_replayed, authorization_destination_mismatch or authorization_network_mismatch"
          }
        }
      }
    },
    "/screening/{wallet}": {
      "get": {
        "summary": "Check a wallet before paying it",
        "description": "Vurto Payments screening: OFAC SDN list on EVM and Solana; on Solana also the issuer freeze of USDC, EURC, USDT, PYUSD, USDG and USD1, the issuer freeze index and a money trail up to three hops back. Paying an invoice runs this on both wallets and refuses with 403 payer_blocked or 403 receiver_blocked. The Scorechain and Merkle Science checks are paid and run only inside an invoice whose analysis was paid: ?checks= with either answers 400 paid_check_requires_invoice.",
        "operationId": "checkWallet",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "EVM 0x address or Solana base58 (case-sensitive)."
          },
          {
            "name": "chainId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The network that will pay, to read the wallet on it. Solana addresses are read without it."
          }
        ],
        "responses": {
          "200": {
            "description": "Screening result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "passed",
                        "blocked",
                        "unavailable"
                      ]
                    },
                    "family": {
                      "type": "string",
                      "enum": [
                        "evm",
                        "svm"
                      ]
                    },
                    "network": {
                      "type": "object",
                      "description": "The wallet read on that network. Comes with chainId, and always for a Solana address.",
                      "properties": {
                        "chainId": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "verified",
                            "no_activity",
                            "contract",
                            "not_a_wallet",
                            "invalid",
                            "unread"
                          ]
                        },
                        "warning": {
                          "type": "string"
                        }
                      }
                    },
                    "toolsDown": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "merkle-science",
                          "scorechain",
                          "crystal"
                        ]
                      },
                      "description": "Paid tools not answering right now: they are not sold until the mark expires."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_wallet"
          }
        }
      }
    },
    "/payouts": {
      "post": {
        "operationId": "createPayout",
        "summary": "Batch payout with exact amounts",
        "description": "Pay up to 50 wallets on Solana or on an EVM network with the IBBs contract, each its exact amount, in the payer's own token. The paying wallet and every receiving wallet are screened first; a blocked payer refuses with 403 payer_blocked, and one blocked recipient refuses the whole batch with 403 receiver_blocked and details.index, before anything is created. Each recipient becomes a regular invoice. Without checks: sign `transactions` (Solana) or `evm.steps` (EVM) in order, then POST /payouts/payments. With checks, a stablecoin is required and the answer is one of two: `charge`, to pay and report on POST /payouts/charge; or `confirmado`, when every destination already had a fresh analysis paid by this proven wallet. Before anything is created the payer's balance of the batch token is read on-chain: the total, plus on EVM the 0.1% fee rounded up. Short of it, 409 payer_balance_short with details { token, symbol, decimals, needed, have, short } in token units: swap to your own wallet first (POST /swap or /svm/swap, no receiver) and build the batch again. With checks it is read too (the send of the approved spends the same token). payerBalance in the response says whether it was read.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "token",
                  "payer",
                  "recipients"
                ],
                "properties": {
                  "chainId": {
                    "oneOf": [
                      {
                        "type": "string",
                        "enum": [
                          "solana-mainnet"
                        ]
                      },
                      {
                        "type": "integer"
                      }
                    ],
                    "description": "\"solana-mainnet\", or an EVM chain id with batch support in GET /chains."
                  },
                  "token": {
                    "type": "string",
                    "description": "Mint or contract address, or symbol, of a verified token."
                  },
                  "payer": {
                    "type": "string"
                  },
                  "recipients": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "description": "At most 50, on EVM and on Solana.",
                    "items": {
                      "type": "object",
                      "required": [
                        "wallet",
                        "amount"
                      ],
                      "properties": {
                        "wallet": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string",
                          "description": "Human amount, e.g. \"120.5\"."
                        },
                        "memo": {
                          "type": "string",
                          "maxLength": 80
                        }
                      }
                    }
                  },
                  "checks": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "scorechain",
                        "merkle-science",
                        "crystal"
                      ]
                    },
                    "description": "Paid analysis of every destination. Since 16/11/2026 the charge total is one consultation at the fixed price per destination (https://docs.vurto.fi/fees), the same with one tool or two, every destination from the minimum on, the reused ones included (their analysis comes from the history, the fee stays); a destination below the minimum goes without the paid analysis, out of the charge, listed in withoutAnalysis. Needs a known stablecoin (400 stablecoin_required) on a network the tool covers (400 check_not_available_on_chain). crystal (Crystal Risk Check, since 17/11/2026) only for a SIGNED wallet (its session; 401 kyc_wallet_signature_required otherwise) with an approved KYC (403 kyc_required otherwise); it adds its own price per consultation, raising the fee and the minimum, and covers Ethereum, Optimism, BNB Chain, Polygon, Base, Arbitrum One, Avalanche and Solana."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Invoices created, and what to sign next",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invoices": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "transactions": {
                      "type": "array",
                      "description": "Solana without checks.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transaction": {
                            "type": "string",
                            "description": "Unsigned v0 transaction, base64."
                          },
                          "lastValidBlockHeight": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "invoiceIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "buildId": {
                            "type": "string",
                            "description": "For prepare_signing: it points the next step to payout_report_payment."
                          }
                        }
                      }
                    },
                    "evm": {
                      "type": "object",
                      "description": "EVM without checks: { loteId, invoiceIds, split, batchRef, deadline, base, fee, steps }. One pay transaction, after the approve if allowance is short.",
                      "properties": {
                        "buildId": {
                          "type": "string",
                          "description": "For prepare_signing: it points the next step to payout_report_payment."
                        }
                      }
                    },
                    "charge": {
                      "type": "object",
                      "description": "The unsigned charge. Solana: `transaction` (base64) and `lastValidBlockHeight`, about a minute of life. EVM: `transaction` {to, data, value, chainId} with the mark after the transfer arguments, and `step`, ready for prepare_signing. Sign it exactly as returned.",
                      "properties": {
                        "buildId": {
                          "type": "string"
                        },
                        "step": {
                          "type": "object",
                          "description": "EVM only."
                        },
                        "transaction": {},
                        "loteId": {
                          "type": "string"
                        },
                        "total": {
                          "type": "string",
                          "description": "Raw units of `token`."
                        },
                        "token": {
                          "type": "string"
                        },
                        "tokenDecimals": {
                          "type": "integer"
                        },
                        "feeWallet": {
                          "type": "string",
                          "description": "The `receiver` of a swap that pays this charge with another token."
                        },
                        "recipients": {
                          "type": "integer",
                          "description": "How many destinations are charged."
                        }
                      }
                    },
                    "reused": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Wallets that ran this analysis for this payer in the last 30 days: a hint, read with no network call; whether it comes from the history is decided when the charge is paid, by the movement measured then. They still pay their share of the fee."
                    },
                    "confirmado": {
                      "type": "object",
                      "description": "Nothing to charge: the send is already here, in the shape POST /payouts/charge returns.",
                      "properties": {
                        "approved": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          },
                          "description": "Invoices that passed, each with its `scan`."
                        },
                        "rejected": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          },
                          "description": "Each receives nothing: their money never left."
                        },
                        "alreadyPaid": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Wallets of this batch already paid, out of the send. inFlight, in the same shape, lists those with a payment reported in the last 10 minutes and still unconfirmed, also out of the send."
                        },
                        "transactions": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          },
                          "description": "Solana: the transfers of the approved."
                        },
                        "evm": {
                          "type": "object",
                          "description": "EVM: the approve and pay steps of the approved, with buildId, chainId and invoiceIds. If `deadline` passed, post this route again."
                        },
                        "loteId": {
                          "type": "string"
                        }
                      }
                    },
                    "withoutAnalysis": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "With checks: destinations below the analysis minimum. They go with the free screening only and stay out of the charge."
                    },
                    "payerBalance": {
                      "type": "object",
                      "description": "The payer's balance read before building. checked false: the RPC did not answer and the batch was built without that read; make sure the wallet holds needed before signing.",
                      "properties": {
                        "checked": {
                          "type": "boolean"
                        },
                        "needed": {
                          "type": "string",
                          "description": "Token units the send spends: the total, plus the 0.1% fee on EVM."
                        },
                        "have": {
                          "type": "string",
                          "description": "Token units read in the paying wallet (absent when checked is false)."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "batch_not_available_on_chain, empty_batch, too_many_recipients, batch_duplicate_recipient, batch_self_payment (details.index), invalid_amount, token_not_listed, stablecoin_required, check_not_available_on_chain, recipient_is_fee_wallet with details.index"
          },
          "403": {
            "description": "payer_blocked (details.wallet), or receiver_blocked with details.index and details.wallet"
          },
          "409": {
            "description": "payer_balance_short: the paying wallet holds less of the batch token than needed (details.token, symbol, decimals, needed, have, short, in token units). Nothing was created: swap to your own wallet first, then build again."
          },
          "429": {
            "description": "rate_limited: 6 a minute, 100 a day"
          },
          "503": {
            "description": "screening_unavailable, analysis_tool_unavailable (with checks: nothing is charged)"
          }
        },
        "parameters": [
          {
            "name": "X-Wallet-Proof",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only with \"crystal\": the walletProof of POST /kyc/proof for the wallet that asks for it (the receiver on POST /invoices, the payer on POST /payouts). Without it, 401 kyc_wallet_signature_required."
          }
        ]
      }
    },
    "/payouts/payments": {
      "post": {
        "operationId": "reportPayoutPayment",
        "summary": "Report one batch transaction",
        "description": "The signature of one batch transaction, with the invoiceIds it pays. Each invoice is verified on-chain like any invoice payment; call again if some are still pending.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "txHash",
                  "payer",
                  "invoiceIds"
                ],
                "properties": {
                  "txHash": {
                    "type": "string"
                  },
                  "payer": {
                    "type": "string"
                  },
                  "invoiceIds": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The invoices, each with its status, and refused [{id, code}] for the destinations this hash cannot pay (tx_already_used): the others still count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invoices": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/payouts/charge": {
      "post": {
        "operationId": "chargePayoutAnalysis",
        "summary": "Pay the batch analysis, get the approved transfers",
        "description": "After POST /payouts with checks returns a charge, sign and send that one transfer exactly as returned (it carries the mark of this charge), then post its hash or signature here with the loteId. The server verifies it on-chain, runs the paid analysis on every recipient, drops the rejected (sanctioned, frozen, or above your risk level) and returns the send for the approved only. Sign it in order, then POST /payouts/payments with the hash of the SEND; the charge hash goes only here. Repeating the same hash is safe and returns the same result, without the wallets already paid. Paying again is not.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "loteId",
                  "payer"
                ],
                "properties": {
                  "loteId": {
                    "type": "string"
                  },
                  "txHash": {
                    "type": "string",
                    "description": "Required unless every destination was below the analysis minimum and there was no charge."
                  },
                  "payer": {
                    "type": "string"
                  },
                  "chainId": {
                    "type": "string",
                    "description": "Optional. Without it the family comes from the payer's format (0x is EVM)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The send of the approved, and the rejected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "approved": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Invoices that passed, each with its `scan`."
                    },
                    "rejected": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Each receives nothing: their money never left."
                    },
                    "alreadyPaid": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Wallets of this batch already paid, out of the send. inFlight, in the same shape, lists those with a payment reported in the last 10 minutes and still unconfirmed, also out of the send."
                    },
                    "transactions": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Solana: the transfers of the approved."
                    },
                    "evm": {
                      "type": "object",
                      "description": "EVM: the approve and pay steps of the approved, with buildId, chainId and invoiceIds. If `deadline` passed, post this route again."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_batch, invalid_tx_hash, analysis_payment_rejected with details.reason and details.feeWallet. Reason charge_not_tied: not the transaction we built. Do not pay again: prove the wallet (POST /destination/challenge with wallet = payer, receiver = details.feeWallet, chargeId = the loteId and chargeTxHash = that hash, then /destination/authorize) and post the same hash."
          },
          "404": {
            "description": "batch_charge_not_found"
          },
          "409": {
            "description": "analysis_payment_pending (send the same hash again in a few seconds, do not pay again), batch_charge_already_paid, tx_already_used, batch_charge_empty"
          },
          "429": {
            "description": "rate_limited: 12 a minute"
          }
        }
      }
    },
    "/payouts/charge/transaction": {
      "post": {
        "operationId": "rebuildPayoutCharge",
        "summary": "The same batch charge again, fresh",
        "description": "A Solana transaction expires in about a minute. This returns the same charge, unsigned and with a fresh blockhash, without creating another batch. Only returns a transaction to sign; nothing changes on the server. If the answer also has reportedTxHash, a hash was already reported for this charge: post that hash to /payouts/charge instead of signing, or you may pay twice. With reportedTxHash comes reportedAt; a hash the network does not know stops being returned 15 minutes after it was reported.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "loteId",
                  "payer"
                ],
                "properties": {
                  "loteId": {
                    "type": "string"
                  },
                  "payer": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The charge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "charge": {
                      "type": "object",
                      "description": "The unsigned charge. Solana: `transaction` (base64) and `lastValidBlockHeight`, about a minute of life. EVM: `transaction` {to, data, value, chainId} with the mark after the transfer arguments, and `step`, ready for prepare_signing. Sign it exactly as returned.",
                      "properties": {
                        "buildId": {
                          "type": "string"
                        },
                        "step": {
                          "type": "object",
                          "description": "EVM only."
                        },
                        "transaction": {},
                        "loteId": {
                          "type": "string"
                        },
                        "total": {
                          "type": "string",
                          "description": "Raw units of `token`."
                        },
                        "token": {
                          "type": "string"
                        },
                        "tokenDecimals": {
                          "type": "integer"
                        },
                        "feeWallet": {
                          "type": "string",
                          "description": "The `receiver` of a swap that pays this charge with another token."
                        },
                        "recipients": {
                          "type": "integer",
                          "description": "How many destinations are charged."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_batch"
          },
          "404": {
            "description": "batch_charge_not_found"
          },
          "409": {
            "description": "batch_charge_already_paid, batch_charge_empty, batch_charge_stale"
          },
          "429": {
            "description": "rate_limited: 12 a minute"
          }
        }
      }
    },
    "/payouts/reuse": {
      "post": {
        "operationId": "previewPayoutReuse",
        "summary": "Which recipients come from the history, and what the analysis charge will be",
        "description": "Preview of the paid-analysis sales control: given the payer, the recipient wallets and the checks, returns the wallets that ran this analysis for this payer in the last 30 days: a hint, read with no network call; whether it comes from the history is decided when the charge is paid, by the movement measured then. Since 11/11/2026 every one still pays its share of the fee. Read-only and decided on the backend; without a proven payer session it returns an empty list and never leaks which wallets were analyzed. With the amounts (amounts, one per recipient, or recipients as {wallet, amount} lines) and a dollar stablecoin token it also returns fee {amount, charged, belowMinimum, minimum}: the analysis charge in dollars that POST /payouts would build (one consultation per destination, the reused ones included), how many destinations it covers, the indexes of the lines below the minimum, and the minimum.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "payer",
                  "recipients",
                  "checks"
                ],
                "properties": {
                  "chainId": {
                    "type": "string"
                  },
                  "payer": {
                    "type": "string"
                  },
                  "recipients": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "amounts": {
                    "type": "array",
                    "description": "Optional: the human amount of each recipient, in the same order, for fee.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "checks": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "token": {
                    "type": "string",
                    "description": "The batch token address. Required on EVM, where the wallet's freshness includes its balance of this token; without it the list comes back empty. On Solana needed only for fee."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The wallets that come from the history, and the fee",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "paid": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Wallets that ran this analysis for this payer in the last 30 days: a hint, read with no network call; whether it comes from the history is decided when the charge is paid, by the movement measured then. They still pay their share of the fee. Empty without the payer session."
                    },
                    "fee": {
                      "type": "object",
                      "description": "With the amounts and a dollar stablecoin token: the analysis charge POST /payouts would build.",
                      "properties": {
                        "amount": {
                          "type": "string",
                          "description": "Dollars."
                        },
                        "charged": {
                          "type": "integer"
                        },
                        "belowMinimum": {
                          "type": "array",
                          "items": {
                            "type": "integer"
                          }
                        },
                        "minimum": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/check": {
      "get": {
        "operationId": "checkInfo",
        "summary": "The Check: the paid tools on sale, their prices, the networks and fee wallets",
        "security": [],
        "description": "The paid Check of any wallet (EVM or Solana). Since 18/11/2026 (owner: one mark per paid tool, the person chooses which) the price is the SUM of the paid tools chosen, each at its own system variable: toolOffer lists each tool on sale with per (wallet or network), price and maximum: scorechain per wallet (SCORECHAIN_PRECO_POR_CONSULTA_USD; an EVM wallet and a Solana one are two), merkle-science per network (ANALISE_PRECO_POR_CONSULTA_USD, at most CHECK_PRECO_MAXIMO_USD, six networks) and crystal per network (CRYSTAL_PRECO_POR_CONSULTA_USD, at most the same six networks; kycRequired). A Check costs, for each tool chosen, price times its units capped at its maximum, summed: the same function the charge uses. A tool switched off or without a price is not listed. The free OFAC and issuer freeze screening always runs (freeScreening). defaultTools is what a charge without tools buys (the pair, for older clients); price is the pair a purchase without tools buys, for older clients (maximum and amount the six EVM networks, perNetwork and perWallet). checkNetworks are the seven to choose (the six EVM networks Merkle Science covers and Solana); networks are where it is paid (the nine EVM networks and Solana, each with its USDC). An open charge is good for chargeValidSeconds (1800). Public: nothing here is about anyone. On Solana crystal may answer without a score (toolOffer noScoreNetworks; the result tool then comes with noScoreCondition: true): some Solana wallets may show riskscore: null because they lack the elements Crystal needs to assess them, which is not an error but a condition (since 25/11/2026). The credit is spent and the seal is never green.",
        "responses": {
          "200": {
            "description": "Price and networks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "price": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string",
                          "description": "= maximum, for older clients"
                        },
                        "maximum": {
                          "type": "string"
                        },
                        "perNetwork": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "perWallet": {
                          "type": "string",
                          "description": "Scorechain's share per wallet in the pair."
                        }
                      }
                    },
                    "tools": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "networks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "chainId": {
                            "type": "string"
                          },
                          "family": {
                            "type": "string"
                          },
                          "token": {
                            "type": "string"
                          },
                          "tokenSymbol": {
                            "type": "string"
                          },
                          "feeWallet": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "creditLimit": {
                      "type": "integer"
                    },
                    "checkNetworks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "chainId": {
                            "type": "string"
                          },
                          "family": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "chargeValidSeconds": {
                      "type": "integer"
                    },
                    "toolOffer": {
                      "type": "array",
                      "description": "The paid tools on sale, each a choice of its own.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tool": {
                            "type": "string",
                            "enum": [
                              "scorechain",
                              "merkle-science",
                              "crystal"
                            ]
                          },
                          "per": {
                            "type": "string",
                            "enum": [
                              "wallet",
                              "network"
                            ]
                          },
                          "price": {
                            "type": "string",
                            "description": "Dollars per wallet or per network."
                          },
                          "maximum": {
                            "type": "string",
                            "description": "The most this tool charges in one Check."
                          },
                          "kycRequired": {
                            "type": "boolean",
                            "description": "Only for a payer whose identity check (KYC) is approved (crystal)."
                          }
                        }
                      }
                    },
                    "defaultTools": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "What POST /check/charge buys without tools (the pair, older clients)."
                    },
                    "freeScreening": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The free screening that always runs: ofac and issuer-freeze."
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "check_unavailable: the price variable is not valid, nothing is on sale",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/check/buy/challenge": {
      "post": {
        "operationId": "checkBuyChallenge",
        "summary": "The text a paying wallet signs before buying a Check",
        "security": [],
        "description": "Before POST /check/charge (owner, 12/11/2026: only a wallet that passes the free screening buys). A challenge of its own, scope buy: the text says the wallet pays for a Vurto Check and is screened (OFAC and issuer freezes) before buying, for the next 10 minutes, the site and until when to sign (10 minutes), and that it moves no funds and authorizes no destination. wallet is the wallet that will pay; chainId is any network where a Check is paid: on EVM the domain of typedData (primaryType CheckBuy), on Solana it gives proofTransaction (never sent, a Ledger signs it). buildId check-buy-<nonce> for prepare_signing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "chainId"
                ],
                "properties": {
                  "wallet": {
                    "type": "string"
                  },
                  "chainId": {
                    "type": [
                      "string",
                      "integer"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The challenge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nonce": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "integer"
                    },
                    "buildId": {
                      "type": "string"
                    },
                    "typedData": {
                      "type": "object"
                    },
                    "proofTransaction": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/check/buy/proof": {
      "post": {
        "operationId": "checkBuyProof",
        "summary": "Get the purchase proof of a paying wallet (runs the free screening)",
        "security": [],
        "description": "Send the signature of POST /check/buy/challenge with the nonce and the message unchanged. The challenge is consumed here, once. Then the free screening of the paying wallet runs: a blocked wallet is 403 payer_blocked (the screen says only: this wallet cannot buy a Check) and gets no proof. A wallet that passes gets buyProof (vcb_..., valid 10 minutes, only its hash is kept), to send as Authorization: Bearer on POST /check/charge, which builds charges only for that wallet. An access challenge, a destination challenge or the challenge of another wallet is refused with 401 check_buy_challenge_invalid: the two Check proofs never stand in for each other. It reads no KYC: POST /check/buy/kyc does, only when Crystal is wanted.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "nonce",
                  "message"
                ],
                "properties": {
                  "wallet": {
                    "type": "string"
                  },
                  "nonce": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string",
                    "description": "EVM EIP-191 or EIP-712 signature; Solana ed25519 in base58."
                  },
                  "transaction": {
                    "type": "string",
                    "description": "Solana with a Ledger: the signed proof transaction (base64), never sent."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The purchase proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "buyProof": {
                      "type": "string"
                    },
                    "payer": {
                      "type": "string"
                    },
                    "screening": {
                      "type": "string",
                      "enum": [
                        "passed"
                      ]
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "check_buy_challenge_invalid, signature_invalid, authorization_replayed or authorization_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "payer_blocked: the free screening blocks the paying wallet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kyc/proof/challenge": {
      "post": {
        "operationId": "kycProofChallenge",
        "summary": "The text a wallet signs to prove it, for the analyses that require KYC (Crystal)",
        "security": [],
        "description": "Crystal runs only for a wallet whose identity check (KYC) is approved, and only when the caller proves it holds that wallet (owner, 17/11/2026: the API, the MCP and the CLI need the KYC for Crystal too). A browser proves it with its session; a client without one signs this challenge of its own, scope kyc: the text says the wallet is yours so Vurto may use its KYC for the analyses that require it, the site and until when to sign (10 minutes), and that it moves no funds, approves no payment and authorizes no destination. wallet is the wallet to prove (the receiver of an invoice, the payer of a batch); chainId is any network where a Check is paid: on EVM the domain of typedData (primaryType WalletKyc, domain Vurto Payments), on Solana it gives proofTransaction (never sent). buildId kyc-proof-<nonce> for prepare_signing. The KYC itself is done once by the person on the site.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "chainId"
                ],
                "properties": {
                  "wallet": {
                    "type": "string"
                  },
                  "chainId": {
                    "type": [
                      "string",
                      "integer"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The challenge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nonce": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "integer"
                    },
                    "buildId": {
                      "type": "string"
                    },
                    "typedData": {
                      "type": "object"
                    },
                    "proofTransaction": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/kyc/proof": {
      "post": {
        "operationId": "kycProof",
        "summary": "Get the KYC proof of a wallet (walletProof)",
        "security": [],
        "description": "Send the signature of POST /kyc/proof/challenge with the nonce and the message unchanged. The challenge is consumed here, once, and the answer is walletProof (vkp_..., valid 30 minutes, only its hash is kept). Send it as the header X-Wallet-Proof on POST /invoices (the receiver) or POST /payouts (the payer) when payerChecks or checks name \"crystal\". It proves possession only: without an approved KYC on that wallet the call still answers 403 kyc_required; without the proof, 401 kyc_wallet_signature_required. A challenge of another kind or of another wallet is refused with 401 kyc_proof_challenge_invalid. It opens nothing else: no destination, no Check, no payment.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "nonce",
                  "message"
                ],
                "properties": {
                  "wallet": {
                    "type": "string"
                  },
                  "nonce": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string",
                    "description": "EVM EIP-191 or EIP-712 signature; Solana ed25519 in base58."
                  },
                  "transaction": {
                    "type": "string",
                    "description": "Solana with a Ledger: the signed proof transaction (base64), never sent."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The KYC proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "walletProof": {
                      "type": "string"
                    },
                    "wallet": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/check/charge": {
      "post": {
        "operationId": "checkCharge",
        "summary": "Build the payment of one Check",
        "security": [
          {
            "checkBuy": []
          }
        ],
        "description": "No sign-in, one proof: payer is the wallet that will sign the transfer, and it must have proven itself first with the purchase proof in Authorization: Bearer vcb_... (POST /check/buy/challenge, sign, POST /check/buy/proof, which runs the free screening). Without it, or with the proof of another wallet, 401 check_buy_proof_required and nothing is built. Builds the USDC transfer of the price of the networks and paid tools chosen (tools from GET /check toolOffer: the sum of each tool at its own price, each never above its maximum) from payer to the analysis fee wallet on chainId, with the mark of THIS Check (16 bytes after the transfer arguments on EVM, a memo on Solana). The server measures the sender on-chain, so only the payer wallet can pay it: building a charge for someone else's wallet gives nothing to whoever built it. The Check id (CHK-<uuid v4>, 122 random bits, returned only to whoever built the charge) is the capability of the Check: whoever holds it reports the payment, analyses and reads the result, with no other proof. Keep it private. Each call makes a NEW Check, good for 30 minutes (expiresAt): a transaction mined after that is credited by the price of now on the networks it covers; checkId of one still awaiting payment rebuilds its transfer (409 check_already_paid for a paid one). Sign it exactly as returned; a transfer built by hand is analysis_payment_rejected reason charge_not_tied: do not pay again, prove the wallet with /destination/challenge (chargeId = check.id, chargeTxHash = that hash) and report the same hash. A paid tool down or without credit at the provider is 503 analysis_tool_unavailable and nothing is built. 409 check_credit_limit past the unused credits a payer may hold; 403 payer_blocked when the free screening blocks the payer. The charge keeps the price it was born with. Paying with another token: a swap built by /quote + /swap (EVM) or /svm/swap with receiver = check.feeWallet, tokenOut = check.token and checkId = check.id, the minimum between the price and 10% above; report its hash with /check/payment. tools: the paid tools to buy, at least one, each once (scorechain, merkle-science, crystal); the Check reads and shows only those, plus the free screening. Empty, repeated or unknown: 400 invalid_check. A tool switched off or without a price is left out and listed in skippedChecks; with none left, 503 check_unavailable. crystal only for a payer whose KYC is approved (403 kyc_required). Without tools, the pair scorechain and merkle-science. Since 18/11/2026 [\"crystal\"] means Crystal alone.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "payer",
                  "networks"
                ],
                "properties": {
                  "chainId": {
                    "type": [
                      "string",
                      "integer"
                    ],
                    "description": "The network that pays, the one chosen in the Swap header: any of GET /check networks (1, 10, 56, 100, 130, 137, 8453, 42161, 43114, solana-mainnet)."
                  },
                  "payer": {
                    "type": "string",
                    "description": "The wallet that signs and pays (0x on EVM, base58 on Solana). Data, not identity."
                  },
                  "checkId": {
                    "type": "string",
                    "description": "Optional: a Check still awaiting payment, to rebuild its transfer (the Solana one expires in about a minute)."
                  },
                  "networks": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The networks to analyse, from GET /check checkNetworks. The credit reads only these. 400 check_networks_required when empty or outside the seven."
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "scorechain",
                        "merkle-science",
                        "crystal"
                      ]
                    },
                    "minItems": 1,
                    "uniqueItems": true,
                    "description": "The paid tools to buy (owner, 18/11/2026: one mark per paid tool). Left out: scorechain and merkle-science."
                  },
                  "creditId": {
                    "type": "string",
                    "description": "Optional: a given-back credit of this payer to take off the price (pay only the difference). Only with its tools included and exactly its networks; spent when this charge is paid. check_credit_unavailable (409), check_credit_not_covered (400), check_credit_covers_all (409)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The open Check and its transaction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "$ref": "#/components/schemas/Check"
                    },
                    "family": {
                      "type": "string"
                    },
                    "chainId": {
                      "type": [
                        "string",
                        "integer"
                      ]
                    },
                    "transaction": {
                      "description": "EVM {to, data, value}; Solana a base64 v0 transaction."
                    },
                    "plan": {
                      "type": "object",
                      "description": "buildId check-<id>, steps (EVM) or transaction (Solana), for prepare_signing."
                    },
                    "report": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "analysis_tool_unavailable or check_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "check_credit_limit, check_already_paid (checkId of a paid Check) or check_charge_expired (checkId past its 30 minutes)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "check_buy_proof_required: no purchase proof of this payer, or an expired one",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/check/payment": {
      "post": {
        "operationId": "checkReportPayment",
        "summary": "Report the Check payment",
        "security": [
          {},
          {
            "checkBuy": []
          },
          {
            "checkAccess": []
          }
        ],
        "description": "By the Check id. Measures the transaction on-chain (signed by the payer the charge names, the network USDC reaching the fee wallet, at least the price, after the charge, the mark) and reserves the hash for this Check only. 201: the credit exists (status paid). 409 analysis_payment_pending until mined; 400 analysis_payment_rejected with details.reason (sender_not_payer when another wallet signed it); 409 tx_already_used when the hash paid something else. Repeating the same hash returns the Check. A second valid transaction for a charge already paid (two tabs signed the same charge, mined within 10 minutes of the block of the first, never past the charge's deadline) becomes a second credit: 201 with extraCredit true and paidCheckId; reporting it again returns the same credit. A first payment mined after the charge's 30 minutes is credited by the price of now on the networks it covers, rounded down (lateCharge true; 409 check_charge_expired only when it covers none), and the ceiling of unused credits (409 check_credit_limit) and the payer's screening (403 payer_blocked) are checked again here; nothing is reserved on those refusals, so the same hash reported later still counts. Whoever holds the id reports, and the extra credit of a second transaction goes to whoever reports it with the id: the id is the credit, keep it private. The payment is recorded by the id alone; without the payer's proof (vcb_ or vca_ in Authorization) the answer is only { check: { id, status } } (since 26/11/2026).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "checkId",
                  "txHash"
                ],
                "properties": {
                  "checkId": {
                    "type": "string",
                    "description": "The Check id from /check/charge."
                  },
                  "txHash": {
                    "type": "string",
                    "description": "EVM hash or Solana signature."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Paid: one unused credit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "$ref": "#/components/schemas/Check"
                    },
                    "extraCredit": {
                      "type": "boolean"
                    },
                    "paidCheckId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "200": {
            "description": "Already recorded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "$ref": "#/components/schemas/Check"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "check_not_found: no Check has this id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/check/analysis": {
      "post": {
        "operationId": "checkAnalyze",
        "summary": "Spend a credit on one wallet",
        "security": [
          {
            "checkBuy": []
          },
          {
            "checkAccess": []
          }
        ],
        "description": "By the Check id and the payer's proof. Spends ONE paid credit on the networks it paid: evmWallet on the EVM networks paid, solanaWallet on Solana if it was paid (400 check_wallet_missing without a wallet for a family paid, 400 check_family_not_paid with one for a family not paid; wallet alone, its family read from the address, for a credit of one family). Scorechain and the free screening read each wallet once; Merkle Science (through Didit) once per network, at most 3 calls per network and the networks paid plus 2 lookups in all (a Didit that answers without a reading counts): past that, the networks not read are stored unread (grey) and the credit ends. The seal of the Check is the worst network; result and screening are those of the worst network, and networks holds each one. The credit is taken in one database update, so two calls at once run one analysis (409 check_running). The target is bound at the first provider call (409 check_credit_locked for others). The same credit and wallets again answers what is stored; others are 409 check_credit_used. Within 30 days and with the wallet unmoved on a network, that network comes from this payer's history. 503 check_unreadable keeps the credit. The credit is per tool: a paid tool that cannot read now (crystal with the payer's KYC no longer approved, a tool switched off) is not spent; the answer carries pendingTools [{tool, reason}] and pendingCheckId, a credit of its own for those tools bound to the same wallets. With none able to read, 409 check_tools_pending (details.pending) and nothing is spent. Crystal without a score for the wallet on a network (noScoreCondition: no score, no sanction, no risk category; today Solana) gives its part back: the answer carries returnedCredit { checkId, tools [crystal], networks, reason crystal_no_score }, a FREE paid credit (no wallet bound, use it on another wallet; the same wallet answers the same), at most 1 return per purchase, then it is spent as before; only the analysis answer names checkId, a later read says it came back, not which. Since 26/11/2026 (owner) the id alone does not open a Check: send the proof of the wallet that paid in Authorization, its purchase proof (vcb_, 10 minutes) or its Check access (vca_, 24 hours); without it 401 check_payer_proof_required, with another wallet's the same 404 check_not_found as an unknown id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "checkId"
                ],
                "properties": {
                  "checkId": {
                    "type": "string"
                  },
                  "evmWallet": {
                    "type": "string"
                  },
                  "solanaWallet": {
                    "type": "string"
                  },
                  "wallet": {
                    "type": "string",
                    "description": "Instead of the two, for a credit of one family."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stored result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "$ref": "#/components/schemas/Check"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "check_running, check_credit_used, check_credit_locked or check_unpaid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "check_unreadable or analysis_tool_unavailable: the credit is not spent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "check_payer_proof_required: no proof of the wallet that paid (vcb_ or vca_ in Authorization), or one expired or of another scope. Since 26/11/2026 the Check id alone does not open a Check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "check_not_found: no Check with this id for this proof (the id does not exist, the proof is of another wallet, or a purchase proof older than the Check). The same answer in every case.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/check/result": {
      "get": {
        "operationId": "checkResult",
        "summary": "Read one stored Check",
        "description": "Refused with 400 check_id_not_in_url before anything is read: CLI 0.3.8 put the id in the query, and a URL is kept in request logs. Use POST.",
        "parameters": [],
        "responses": {
          "400": {
            "description": "check_id_not_in_url",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "deprecated": true,
        "security": []
      },
      "post": {
        "operationId": "checkResultById",
        "summary": "Read one stored Check by its id",
        "security": [
          {
            "checkBuy": []
          },
          {
            "checkAccess": []
          }
        ],
        "description": "The Check as stored, with result, screening, networks and events. By the id in the body (never in the URL, which lands in request logs) and the payer's proof. Never calls a paid provider. An unknown id is 404 check_not_found. Since 26/11/2026 (owner) the id alone does not open a Check: send the proof of the wallet that paid in Authorization, its purchase proof (vcb_, 10 minutes) or its Check access (vca_, 24 hours); without it 401 check_payer_proof_required, with another wallet's the same 404 check_not_found as an unknown id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "checkId"
                ],
                "properties": {
                  "checkId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Check",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "$ref": "#/components/schemas/Check"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "check_not_found: no Check with this id for this proof (the id does not exist, the proof is of another wallet, or a purchase proof older than the Check). The same answer in every case.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "check_payer_proof_required: no proof of the wallet that paid (vcb_ or vca_ in Authorization), or one expired or of another scope. Since 26/11/2026 the Check id alone does not open a Check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/check/status": {
      "post": {
        "operationId": "checkStatus",
        "summary": "The short view of several Checks by their ids",
        "security": [
          {
            "checkBuy": []
          },
          {
            "checkAccess": []
          }
        ],
        "description": "Up to 50 Check ids at once, with the payer's proof: the short view of each one of that payer that exists; unknown ids and other payers' ids are left out. No result here: read it with POST /check/result. Listing by wallet is /check/credits, with the payer's Check access. 401 check_payer_proof_required without a proof (since 26/11/2026).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "checkIds"
                ],
                "properties": {
                  "checkIds": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Checks found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Check"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "too_many_checks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "check_payer_proof_required: no proof of the wallet that paid (vcb_ or vca_ in Authorization), or one expired or of another scope. Since 26/11/2026 the Check id alone does not open a Check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/check/credits": {
      "get": {
        "operationId": "checkCredits",
        "summary": "This payer's Checks",
        "security": [
          {
            "checkAccess": []
          }
        ],
        "description": "The one Check read by wallet, so the one that needs the payer's Check access: unused credits (paid), readings in flight or interrupted (running: call /check/analysis again with its target to resume) and analyses already run (used, with target and seal), newest first, 50 a page with nextCursor (null on the last page). For finding a Check id you lost.",
        "parameters": [
          {
            "name": "payer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The paying wallet (0x on EVM, base58 on Solana)."
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "nextCursor of the previous page: opaque, never the Check id."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Check"
                      }
                    },
                    "price": {
                      "type": "object"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/check/access": {
      "post": {
        "operationId": "checkAccess",
        "summary": "Get the Check access of a paying wallet",
        "security": [],
        "description": "Only for GET /check/credits (listing a payer's Checks by wallet). The proof every other /check call takes, valid 24 hours, in the Authorization header. Ask POST /check/access/challenge, sign its text (or typedData; proofTransaction on Solana, never sent) with the paying wallet and send it here with the nonce and the message unchanged. The challenge is consumed here, once, so the access goes only to whoever held that signature; only its hash is kept, at most 5 live per payer (the oldest go first). Any other challenge (/destination/challenge, /check/buy/challenge, the claim of another charge) is refused with 401 check_access_challenge_invalid, and no destination authorization is written.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "nonce",
                  "message"
                ],
                "properties": {
                  "wallet": {
                    "type": "string"
                  },
                  "nonce": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string",
                    "description": "EVM EIP-191 or EIP-712 signature; Solana ed25519 in base58."
                  },
                  "transaction": {
                    "type": "string",
                    "description": "Solana with a Ledger: the signed proof transaction (base64), never sent."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access": {
                      "type": "string"
                    },
                    "payer": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "check_access_challenge_invalid, signature_invalid, authorization_replayed or authorization_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/check/access/challenge": {
      "post": {
        "operationId": "checkAccessChallenge",
        "summary": "The text a paying wallet signs for its Check access",
        "security": [],
        "description": "Only for GET /check/credits (listing a payer's Checks by wallet). A challenge of its own: the text says what the signature grants (read and use the paid Checks of this wallet for 24 hours), the site and until when to sign (10 minutes), and that it moves no funds and authorizes no destination. chainId is any Check network: on EVM the domain of typedData, on Solana it gives proofTransaction.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet",
                  "chainId"
                ],
                "properties": {
                  "wallet": {
                    "type": "string"
                  },
                  "chainId": {
                    "type": [
                      "string",
                      "integer"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The challenge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nonce": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "integer"
                    },
                    "buildId": {
                      "type": "string"
                    },
                    "typedData": {
                      "type": "object"
                    },
                    "proofTransaction": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/check/wallet": {
      "post": {
        "operationId": "checkWallet",
        "summary": "Is the wallet to analyse real",
        "security": [],
        "description": "Public data of the network, no proof: the family comes from the address; an EVM address is read on the six EVM networks of the Check (code, nonce, native balance; the answer is kept 60 s), a Solana one by its account or, without one, its last signature. state: used (any trace), unused (valid and no trace), not_a_wallet (a Solana token or program), invalid (neither family), unread (it could not be read now: a network did not answer, or the daily cap, with reason daily_limit and nothing read). 30 per minute and 200 a day per IP, and a daily total; past the daily caps the answer is unread, never an error, so the flow goes on.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wallet"
                ],
                "properties": {
                  "wallet": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The reading",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wallet": {
                      "type": "string"
                    },
                    "family": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "used",
                        "unused",
                        "not_a_wallet",
                        "invalid",
                        "unread"
                      ]
                    },
                    "networks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "chainId": {
                            "type": "string"
                          },
                          "used": {
                            "type": "boolean"
                          },
                          "state": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/check/buy/kyc": {
      "post": {
        "operationId": "checkBuyKyc",
        "summary": "Whether the paying wallet may buy Crystal",
        "security": [
          {
            "checkBuy": []
          }
        ],
        "description": "With the purchase proof (Authorization: Bearer vcb_..., from /check/buy/proof): whether the wallet that proof proved has the approved KYC Crystal needs, by the same gate the charge runs. Ask it only when Crystal is wanted (the purchase proof reads no KYC). Without Crystal on sale, kycApproved false and nothing is read. 401 check_buy_proof_required without a valid proof; 503 kyc_unavailable when the KYC cannot be read now.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "payer": {
                      "type": "string"
                    },
                    "kycApproved": {
                      "type": "boolean"
                    },
                    "crystalOnSale": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
