{
  "service": "MoneyTools x402 Pay Gateway (non-custodial)",
  "endpoint": "https://api.moneytools.dev/v1/gateway?url=<seller x402 endpoint>&maxPrice=<USD>",
  "altHost": "https://pay.moneytools.dev/v1/gateway",
  "fee": "max(1% of the seller price, $0.001), rounded up to whole credits ($0.001 each); charged only when the seller answers 2xx to the paid request",
  "maxPriceCapUsd": 5,
  "auth": "X-API-Key: mtk_... (prepaid credits; buy at /v1/credits/buy?pack=1000)",
  "how": [
    "1. Call the gateway URL (same method/body you would send the seller) with X-API-Key. We precheck the seller's 402 (valid x402 terms, OFAC-screened payTo, price <= maxPrice).",
    "2. You get the SELLER's 402 back unchanged (PAYMENT-REQUIRED header + body). Your x402 client signs it with YOUR wallet; payTo is the seller, never us.",
    "3. Retry the same gateway URL with your X-PAYMENT / PAYMENT-SIGNATURE header. We check the authorization matches the prechecked terms, then relay your request and payment header to the seller untouched.",
    "4. Seller answers 2xx -> you get its response (+ PAYMENT-RESPONSE) and we deduct the fee from your credits. Otherwise no fee."
  ],
  "works": "Any x402 HTTP client (x402-fetch, x402-axios, x402 python) pointed at the gateway URL. EVM 'exact' (EIP-3009) USDC payments only; Solana and other schemes are refused before relay.",
  "refusals": "precheck block (bad terms or OFAC-listed payTo), price above maxPrice or the cap, non-USDC asset, target not x402 (we do not proxy free content), payment not matching the prechecked terms, duplicate payment, insufficient credits.",
  "limits": {
    "requestBodyBytes": 1048576,
    "responseBytes": 10485760,
    "sellerTimeoutSec": 30
  },
  "custody": "We never receive, hold, forward or sign funds. The agent's signed authorization pays the seller directly via the seller's facilitator. We store only a SHA-256 hash of the payment header, the seller host, amount, network, fee and HTTP status.",
  "caveat": "If the seller times out or errors after receiving a payment header, whether it settled is between you and the seller (check with /v1/verify); we do not charge our fee in that case.",
  "plan": "https://api.moneytools.dev/v1/gateway/plan?url=<seller> (free preview: precheck + fee)",
  "mcpTool": "x402_gateway_plan",
  "terms": "https://moneytools.dev/terms/",
  "spendControls": {
    "free": true,
    "set": "POST https://api.moneytools.dev/v1/gateway/limits with X-API-Key and JSON {\"dailyMaxUsd\":2,\"perCallMaxUsd\":0.05,\"fallback\":true} (GET shows current limits + today's spend; 0 clears a limit)",
    "enforce": "per-call cap lowers maxPrice; daily cap counts every payment we relayed today for this key (UTC), conservatively including seller errors. Over the cap -> 403 spend_limit, nothing relayed, no fee.",
    "idempotency": "send header Idempotency-Key: <your id> on both steps; once a payment with that id was relayed successfully, later attempts get 409 idempotent_replay and are NOT relayed (no double payment from agent retry loops). Identical payment headers are always refused (duplicate_payment).",
    "fallback": "if the seller is down, not x402 or fails precheck, the refusal lists healthy equivalent endpoints (from status.moneytools.dev, ranked by measured reputation). With &fallback=auto (or limits fallback=true) step 1 returns the best alternative's 402 instead (header X-Gateway-Fallback shows which seller; you then sign for THAT seller, price still <= maxPrice). Add &need=<words> to steer the match.",
    "humanApproval": "set approvalOverUsd in limits: payments at or above it are refused (403 approval_required, no fee) until your human approves via https://approve.moneytools.dev (create: POST /v1/approvals, 3 credits or plan); then send header X-Approval: <id>:<agentToken> on both steps. The approval is consumed (single-use) when the paid request is relayed.",
    "ledger": "spend ledger by supplier/day + CSV, free with this key: GET https://ledger.moneytools.dev/v1/ledger?month=YYYY-MM",
    "receipts": "GET https://api.moneytools.dev/v1/receipts with X-API-Key (JSON; ?format=csv; ?days=1-90): every relayed payment with time, seller, amount, network, fee, status"
  },
  "prepaidCredits": {
    "available": true,
    "what": "Pay once, skip per-call payments: buy an API key with a call balance in a single x402 payment (USDC on Base), then send header X-API-Key on any paid /v1 endpoint or MCP tool call.",
    "packs": [
      {
        "credits": 100,
        "priceUsd": "0.1",
        "perCallUsd": 0.001,
        "buy": "https://api.moneytools.dev/v1/credits/buy?pack=100"
      },
      {
        "credits": 1000,
        "priceUsd": "1",
        "perCallUsd": 0.001,
        "buy": "https://api.moneytools.dev/v1/credits/buy?pack=1000"
      }
    ],
    "use": "Header X-API-Key: mtk_... (or Authorization: Bearer mtk_...). 1 credit = 1 successful call on any /v1 endpoint; input errors (400) and upstream failures (5xx) are not deducted.",
    "balance": "https://api.moneytools.dev/v1/credits (GET with X-API-Key, free)",
    "validDays": 365,
    "terms": "Key is shown once and stored by us only as a SHA-256 hash; lost keys cannot be recovered. Credits are non-refundable, non-transferable, expire 365 days after purchase. We record the paying wallet and settlement tx for support. Payments go to the MoneyTools team wallet via the PayAI facilitator."
  },
  "monthlyPlan": {
    "available": true,
    "priceUsd": "1",
    "days": 30,
    "fairUseCapPerDay": 1000,
    "buy": "https://api.moneytools.dev/v1/plan/buy",
    "status": "https://api.moneytools.dev/v1/plan (GET with X-API-Key, free)",
    "covers": "all paid MoneyTools tool calls: api.moneytools.dev /v1 endpoints (precheck, verify, recommend, read, email-check, sol-mint), the main MCP tools, status.moneytools.dev find + reputation, and all 25 tools.moneytools.dev tools",
    "excludes": "Pay Gateway 1% fees (need prepaid credits) and the 0.25% on-chain swap fee",
    "terms": "One x402 payment of 1 USDC (Base) = 30 days from activation. NOT auto-renewing: nothing is charged again; to continue, buy again. Fair-use cap 1000 successful calls per key per UTC day (then HTTP 429 until 00:00 UTC; failed calls do not count). Key shown once, stored only as a SHA-256 hash; non-refundable, non-transferable."
  }
}