{
  "openapi": "3.1.0",
  "info": {
    "title": "CoinVet",
    "version": "1.2.0",
    "description": "Money checks for agents: BTC price, fees, crypto + Lightning address checks, IBAN, BIC, US ZIP. Free tier 100 calls/day/IP; then $0.001/call via x402 (USDC on Base) or L402 (Lightning, 100 sats per 1,000 calls)."
  },
  "servers": [
    {
      "url": "https://coinvet.pages.dev"
    }
  ],
  "paths": {
    "/api/btc-price": {
      "get": {
        "operationId": "btcPrice",
        "summary": "Bitcoin price (USD, EUR, GBP, CAD, CHF, AUD, JPY)",
        "description": "Current Bitcoin price in major fiat currencies from mempool.space, plus sats per currency unit. Indicative, refreshed about every minute.",
        "parameters": [
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "description": "Fiat code (default USD)",
            "schema": {
              "type": "string",
              "description": "Fiat code (default USD)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      },
      "post": {
        "operationId": "btcPricePost",
        "summary": "Bitcoin price (USD, EUR, GBP, CAD, CHF, AUD, JPY) (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "description": "Fiat code (default USD)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      }
    },
    "/api/mempool-fees": {
      "get": {
        "operationId": "mempoolFees",
        "summary": "Bitcoin fee estimates (sat/vB)",
        "description": "Recommended Bitcoin on-chain fee rates in sat/vB (next block, ~30 min, ~1 h, economy, minimum), mempool size, current block height, and the example cost in sats of a typical 140 vB transaction.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      },
      "post": {
        "operationId": "mempoolFeesPost",
        "summary": "Bitcoin fee estimates (sat/vB) (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      }
    },
    "/api/crypto-address-validate": {
      "get": {
        "operationId": "cryptoAddressValidate",
        "summary": "Validate a crypto address (BTC, EVM, SOL, LTC, DOGE, TRX)",
        "description": "Check a cryptocurrency address offline before using it: Bitcoin legacy/P2SH (base58check), segwit/taproot (bech32/bech32m), Ethereum and all EVM chains incl. Base (EIP-55 checksum via keccak-256), Litecoin, Dogecoin, Tron and Solana. Returns valid, chain, network, type, and the correctly checksummed form. Catches typos and copy errors.",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "description": "The address to check",
            "schema": {
              "type": "string",
              "description": "The address to check"
            }
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "description": "Optional hint, e.g. solana",
            "schema": {
              "type": "string",
              "description": "Optional hint, e.g. solana"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      },
      "post": {
        "operationId": "cryptoAddressValidatePost",
        "summary": "Validate a crypto address (BTC, EVM, SOL, LTC, DOGE, TRX) (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "The address to check"
                  },
                  "chain": {
                    "type": "string",
                    "description": "Optional hint, e.g. solana"
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      }
    },
    "/api/lightning-address-check": {
      "get": {
        "operationId": "lightningAddressCheck",
        "summary": "Check a Lightning address / LNURL resolves",
        "description": "Resolve a Lightning address (user@domain) or bech32 LNURL to its LNURL-pay endpoint and return whether it is valid, min/max sendable sats, comment length, Nostr zap support and description. Never requests an invoice or pays. Also recognizes BOLT11 invoices.",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "description": "Lightning address (user@domain) or LNURL",
            "schema": {
              "type": "string",
              "description": "Lightning address (user@domain) or LNURL"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      },
      "post": {
        "operationId": "lightningAddressCheckPost",
        "summary": "Check a Lightning address / LNURL resolves (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Lightning address (user@domain) or LNURL"
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      }
    },
    "/api/iban-validate": {
      "get": {
        "operationId": "ibanValidate",
        "summary": "Validate an IBAN (checksum + country length)",
        "description": "Validate an International Bank Account Number: format, per-country length (80+ countries) and the ISO 7064 mod-97 checksum. Returns country, check digits, BBAN and the formatted IBAN. Format only; does not confirm the account exists.",
        "parameters": [
          {
            "name": "iban",
            "in": "query",
            "required": true,
            "description": "IBAN, spaces allowed",
            "schema": {
              "type": "string",
              "description": "IBAN, spaces allowed"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      },
      "post": {
        "operationId": "ibanValidatePost",
        "summary": "Validate an IBAN (checksum + country length) (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "iban": {
                    "type": "string",
                    "description": "IBAN, spaces allowed"
                  }
                },
                "required": [
                  "iban"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      }
    },
    "/api/bic-validate": {
      "get": {
        "operationId": "bicValidate",
        "summary": "Validate a BIC / SWIFT code format",
        "description": "Validate a BIC/SWIFT code's structure (bank code, ISO country, location, optional branch) and flag test BICs. Format check only, not a directory lookup.",
        "parameters": [
          {
            "name": "bic",
            "in": "query",
            "required": true,
            "description": "BIC/SWIFT code (8 or 11 chars)",
            "schema": {
              "type": "string",
              "description": "BIC/SWIFT code (8 or 11 chars)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      },
      "post": {
        "operationId": "bicValidatePost",
        "summary": "Validate a BIC / SWIFT code format (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bic": {
                    "type": "string",
                    "description": "BIC/SWIFT code (8 or 11 chars)"
                  }
                },
                "required": [
                  "bic"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      }
    },
    "/api/us-zip-lookup": {
      "get": {
        "operationId": "usZipLookup",
        "summary": "US ZIP code to city, state, coordinates and time zone",
        "description": "Look up a US ZIP code: city/place names, state, latitude/longitude and the state's primary IANA time zone. Useful for checkout/address sanity checks and shipping estimates.",
        "parameters": [
          {
            "name": "zip",
            "in": "query",
            "required": true,
            "description": "5-digit US ZIP code",
            "schema": {
              "type": "string",
              "description": "5-digit US ZIP code"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      },
      "post": {
        "operationId": "usZipLookupPost",
        "summary": "US ZIP code to city, state, coordinates and time zone (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "zip": {
                    "type": "string",
                    "description": "5-digit US ZIP code"
                  }
                },
                "required": [
                  "zip"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result JSON (ok:false with error on bad input)"
          },
          "402": {
            "description": "Payment required: x402 `accepts` (USDC on Base) + L402 WWW-Authenticate"
          },
          "429": {
            "description": "Free limit reached"
          }
        }
      }
    },
    "/api/pricing": {
      "get": {
        "operationId": "pricing",
        "summary": "Pricing and limits",
        "responses": {
          "200": {
            "description": "Pricing"
          }
        }
      }
    }
  }
}