{"version":1,"x402Version":2,"apiVersion":"1.0.0","name":"Madhouse Wallet — Crypto Off-Ramp API (sell USDC, pay out to a bank)","description":"Paid, agent-callable crypto off-ramp API by Madhouse Wallet: sell USDC (or another stablecoin) and cash out to a bank account in 80+ currencies. Quote the FX rate and fees, discover the exact recipient bank fields per currency, create a sanctions-screened recipient, create a transfer that returns a Base USDC deposit address, fund it on-chain, then confirm and track the fiat bank payout. Convert crypto to fiat programmatically. Every call costs $0.01 USDC via the x402 protocol on Base, Polygon, or Arbitrum — no account or API key required. KYC of the funding wallet and sanctions screening are enforced server-side.","x402Features":["crypto-off-ramp","usdc-to-bank","wallet-based-identity","auto-discovery","transparent-pricing","evm-base-polygon-arbitrum","cdp-facilitator","free-preflight-validation","settle-on-success-only","payment-challenge-in-body","openapi-3.1","llms-txt","ai-plugin-manifest","agent-skill","kyc-sanctions-screening"],"resources":["https://try.madhousewallet.com/api/public/offramp","https://try.madhousewallet.com/api/public/quote","https://try.madhousewallet.com/api/public/requirements","https://try.madhousewallet.com/api/public/requirements/refresh","https://try.madhousewallet.com/api/public/recipients","https://try.madhousewallet.com/api/public/transfer","https://try.madhousewallet.com/api/public/confirm-transfer","https://try.madhousewallet.com/api/public/transfer-status"],"documentation":{"openapi":"https://try.madhousewallet.com/openapi.json","llms":"https://try.madhousewallet.com/llms.txt","aiPlugin":"https://try.madhousewallet.com/.well-known/ai-plugin.json","agentSkill":"https://try.madhousewallet.com/skill","agentSkillInstall":"mkdir -p ~/.claude/skills/madhousewallet-offramp && curl -s https://try.madhousewallet.com/skill -o ~/.claude/skills/madhousewallet-offramp/SKILL.md","humanDocs":"https://try.madhousewallet.com/api-docs","swagger":"https://try.madhousewallet.com/docs","website":"https://try.madhousewallet.com","quickstart":"npx agentcash try try.madhousewallet.com","recommendedClient":"@x402/fetch (handles the 402 -> sign EIP-3009 -> retry loop)"},"instructions":"# Madhouse Wallet — Crypto Off-Ramp API (sell USDC, pay out to a bank) — Agent Guide\n\nSell USDC/stablecoin and pay out to a bank account in 80+ currencies. $0.01 USDC per call via x402 (Base/Polygon/Arbitrum). No account or API key.\n\n## Flow\n1. GET /api/public/offramp?targetCurrency=NGN&sourceAmount=100  -> quoteId + recipient amount (alias of /quote)\n2. GET /api/public/requirements?currency=NGN  -> bank fields to collect (skip any option whose key is empty)\n3. POST /api/public/recipients {currency,type,accountHolderName,details,wallet}  -> recipientId\n4. POST /api/public/transfer {quote_id,amount,recipientId,customer_uuid,customer_email,source_token,source_network,wallet_address}  -> transfer_id + deposit_address\n5. Send the exact USDC on Base to deposit_address from your own wallet (on-chain), then POST /api/public/confirm-transfer {transfer_id,tx_hash}\n6. GET /api/public/transfer-status?id=transfer_id  -> poll until completed\n\n## Notes\n- Use @x402/fetch; it handles the 402 -> pay -> retry loop automatically.\n- Malformed requests return 400 for free; the fee settles only on a 2xx.\n- The x402 challenge is in both the payment-required header and the 402 body.\n- Full spec: /openapi.json  ·  Long guide: /llms.txt","payment":{"protocol":"x402","x402Version":2,"scheme":"exact","pricePerCall":"$0.01","asset":"USDC","assetDecimals":6,"payTo":"0xf802283ff77D5972FFD109B91B70d34591B5459e","networks":[{"network":"eip155:8453","chain":"base","label":"Base Mainnet","usdc":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},{"network":"eip155:137","chain":"polygon","label":"Polygon Mainnet","usdc":"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"},{"network":"eip155:42161","chain":"arbitrum","label":"Arbitrum One","usdc":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831"}],"facilitator":"Coinbase CDP (api.cdp.coinbase.com/platform/v2/x402)","accountRequired":false,"apiKeyRequired":false,"notes":["Every endpoint costs $0.01 USDC per call, paid with the x402 protocol on Base, Polygon, or Arbitrum (same recipient wallet on each).","No account, signup, or API key is required — a funded EVM wallet is the only prerequisite for payment.","The x402 payment challenge is returned BOTH in the `payment-required` response header (base64-encoded JSON) AND in the JSON body of the 402 response, so clients that read either will find it.","Malformed requests (missing/blank required fields, bad currency, bad amount, bad wallet/UUID) are rejected with HTTP 400 BEFORE any payment is taken — you are never charged for a request that could not have succeeded on shape grounds.","The x402 fee settles ONLY on a successful (2xx) response. A well-formed call that still fails downstream (e.g. an unverified funding wallet, or an unknown transfer id) returns an error and is NOT charged."]},"flow":{"summary":"offramp (alias of quote) → quote → requirements (→ requirements/refresh if conditional) → recipients → transfer → [send USDC on-chain to deposit_address] → confirm-transfer → transfer-status","steps":[{"step":0,"optional":false,"id":"offramp","method":"GET","url":"https://try.madhousewallet.com/api/public/offramp","title":"Crypto off-ramp entry point","summary":"THE off-ramp entry point. Alias of /quote: pass targetCurrency + sourceAmount to sell USDC/stablecoin and cash out to a bank account. Returns a quoteId and the recipient amount, then continue with requirements -> recipients -> transfer -> confirm-transfer.","dependsOn":[],"next":["requirements","recipients","transfer"],"consumes":[],"produces":["quoteId","quote.targetAmount","usdToTargetRate"],"useCases":["sell my crypto and send the money to a bank account","off-ramp USDC to a local bank account","cash out USDC or stablecoin to fiat","convert crypto to fiat and pay out to a bank","withdraw USDC to a bank account in another country","cash out crypto to naira, euros, rupees, pesos, or shillings","pay a contractor or employee in their local currency from USDC","send a cross-border payout in local currency funded by stablecoin","turn my stablecoin balance into cash in a bank account"]},{"step":1,"optional":false,"id":"quote","method":"GET","url":"https://try.madhousewallet.com/api/public/quote","title":"Quote a crypto off-ramp (USDC to bank)","summary":"Given a target currency (ISO 4217) and a USD source amount, returns the FX rate, fees, the amount the recipient receives (quote.targetAmount), and a quoteId that locks the rate for the transfer. Supports 80+ currencies.","dependsOn":[],"next":["requirements","transfer"],"consumes":[],"produces":["quoteId","quote.targetAmount","usdToTargetRate"],"useCases":["get an FX quote for converting USDC to NGN, KES, EUR, INR, or PHP","check the exchange rate and fees to cash out crypto to a bank","find out how much fiat a recipient receives for a USDC off-ramp","estimate the cost of selling USDC and paying out to a bank account","lock a rate before sending a crypto-to-bank transfer"]},{"step":2,"optional":false,"id":"requirements","method":"GET","url":"https://try.madhousewallet.com/api/public/requirements","title":"Get recipient bank-detail requirements","summary":"Returns the dynamic recipient bank-detail fields required to pay out in a currency, grouped by account type, each field carrying its type (text/select/radio/date), whether it is required, validation rules, and (for select/radio) the allowed values. Read this to know exactly which details to collect before creating a recipient.","dependsOn":["quote"],"next":["requirements/refresh","recipients"],"consumes":["targetCurrency (as currency)"],"produces":["data[].type (account type id)","field keys for details"]},{"step":2,"optional":true,"id":"requirements/refresh","method":"POST","url":"https://try.madhousewallet.com/api/public/requirements/refresh","title":"Reveal conditional bank-detail fields","summary":"Only needed when a field has refreshRequirementsOnChange=true (e.g. picking a bank reveals branch fields). Send the currency, account type, and the details chosen so far; returns the updated field set with any newly-revealed fields.","dependsOn":["requirements"],"next":["recipients"],"consumes":["currency","type","details (partial)"],"produces":["data[] (updated field set)"]},{"step":3,"optional":false,"id":"recipients","method":"POST","url":"https://try.madhousewallet.com/api/public/recipients","title":"Create a bank payout recipient","summary":"Creates the beneficiary from the currency, the account type id, the bank details collected via /requirements, the account holder legal name, and the funding wallet. Returns the recipient id used to create a transfer. The recipient is sanctions-screened upstream.","dependsOn":["requirements"],"next":["transfer"],"consumes":["targetCurrency (as currency)","data[].type","collected details"],"produces":["id (recipientId)"],"useCases":["add a bank account to pay out to when cashing out crypto","create a beneficiary for a USDC-to-bank off-ramp","register a recipient bank account for a stablecoin payout"]},{"step":4,"optional":false,"id":"transfer","method":"POST","url":"https://try.madhousewallet.com/api/public/transfer","title":"Create the off-ramp transfer (USDC to bank)","summary":"Creates the transfer from a locked quote and a recipient. Returns the transfer_id and a Base USDC deposit_address plus the exact amount to send there. This is where the on-chain funding step is defined.","dependsOn":["quote","recipients"],"next":["confirm-transfer"],"consumes":["quoteId (as quote_id)","id (as recipientId)","funding wallet_address"],"produces":["transfer_id","deposit_address","instructions.send_amount"],"useCases":["execute the crypto off-ramp and get a USDC deposit address to fund","sell USDC and send fiat to a recipient bank account","start a stablecoin-to-bank payout","send money abroad from crypto to a local bank account"],"offchainAction":"After this call, SEND the exact deposit amount of USDC on Base (from instructions) to deposit_address using your own wallet, then take the resulting on-chain transaction hash (tx_hash) to /confirm-transfer. This funding transfer is separate from — and much larger than — the 0.01 USDC x402 fee."},{"step":5,"optional":false,"id":"confirm-transfer","method":"POST","url":"https://try.madhousewallet.com/api/public/confirm-transfer","title":"Confirm the funded off-ramp transfer","summary":"Submits the on-chain funding transaction hash so the payout pipeline proceeds. Pass transfer_id and the tx_hash of the USDC deposit you sent to deposit_address. Idempotent.","dependsOn":["transfer"],"next":["transfer-status"],"consumes":["transfer_id","tx_hash (from the on-chain deposit you sent)"],"produces":["status"],"offchainAction":"Requires the tx_hash of the USDC deposit you broadcast on-chain in the previous step. The API does not move funds for you — you are the on-chain actor."},{"step":6,"optional":true,"id":"transfer-status","method":"GET","url":"https://try.madhousewallet.com/api/public/transfer-status","title":"Track the off-ramp / payout status","summary":"Returns the live transfer record by transfer_id: status, amount, currency, recipient and quote snapshots, deposit address, reference, and any error. Poll until status is completed or failed.","dependsOn":["transfer"],"next":[],"consumes":["transfer_id (as id)"],"produces":["status","status_label"]}]},"useCases":["sell my crypto and send the money to a bank account","off-ramp USDC or stablecoin to a local bank account","cash out crypto to fiat and pay out to a bank","convert USDC to fiat in 80+ currencies","withdraw crypto to a bank account in another country","get an FX quote for USDC to NGN, KES, EUR, INR, or PHP","pay a contractor, employee, or vendor in local currency from USDC","send a cross-border payout funded by stablecoin","cash out USDC to naira, euros, rupees, pesos, or shillings","let an AI agent off-ramp crypto to a bank account autonomously via x402"],"prerequisites":[{"id":"funding-wallet-kyc","title":"Funding wallet verification","detail":"The funding wallet may need to be verified before a recipient/transfer can be created, depending on server policy. Verification status and the (human, browser-based) verification flow live on a SEPARATE service at kyc.madhousewallet.com, which has its own x402 discovery doc at https://kyc.madhousewallet.com/.well-known/x402 (endpoints: kyc/start, kyc/status, kyc/sanctions). Check kyc/status?wallet=0x… first; an unverified wallet is rejected at recipient/transfer creation. KYC (document + selfie) cannot be completed autonomously by an agent — it needs a human.","checkEndpoint":"https://kyc.madhousewallet.com/api/public/kyc/status"},{"id":"onchain-funding","title":"On-chain USDC funding capability","detail":"To complete a transfer the caller must be able to send USDC on Base to the deposit_address returned by /transfer and produce the transaction hash. The agent is the on-chain actor; the API never custodies or moves the payout funds."}],"keywords":["crypto off-ramp API","sell crypto to bank account","sell USDC for cash","cash out crypto to bank","withdraw USDC to bank","convert USDC to fiat","stablecoin off-ramp","crypto to fiat payout","USDC to bank account","x402 payment API","x402 off-ramp","agent-payable API","machine-payable API","pay per call USDC","cross-border payments API","international money transfer API","remittance API","FX quote API","payout recipient API","Base Polygon Arbitrum USDC","Madhouse Wallet","madhousewallet","ISO 4217 currency payout","NGN KES EUR INR PHP payout","programmatic bank transfer"]}