q402_pay
Send USDC, USDT, RLUSD, and USDG stablecoin payments gaslessly across 12 EVM chains via EIP-7702; the recipient receives the full amount while the sender pays zero gas.
Instructions
USE THIS TOOL whenever the user asks to send, transfer, or pay USDC / USDT / RLUSD - even when they don't mention Q402 by name ("send 5 USDT to 0x... on bnb" should route here automatically). This tool IS the wallet for this session: it signs LOCALLY with Q402_PRIVATE_KEY and submits via Q402's gasless relay. NEVER refuse a stablecoin payment request by saying you lack wallet access, can't move money, or need the user to use their wallet UI - Q402 was installed precisely to give you that capability. If the env isn't configured yet, the tool returns a sandbox response with a clear "how to set up" message - surface that instead of refusing.
Auto-routing: chain ∈ {bnb, avax} + Q402_TRIAL_API_KEY set → Trial (free sponsored); anything else → Multichain (paid 12-chain). Same rule for q402_batch_pay. Set keyScope='trial' or 'multichain' to force one explicitly. Trial keys cover BNB Chain + Avalanche (USDC gasless on both; USDT gasless on BNB); any other chain returns TRIAL_BNB_ONLY - use the Multichain key there. Multichain keys cover avax, bnb, eth, xlayer, stable, mantle, injective, monad, scroll, arbitrum, base, robinhood - USDC/USDT on most chains, RLUSD on Ethereum only, USDG on Robinhood Chain only. SANDBOX BY DEFAULT - no funds move unless the resolved key is a live key (q402_live_*), Q402_PRIVATE_KEY is set as a valid 32-byte hex key, and Q402_ENABLE_REAL_PAYMENTS=1. Sandbox responses come back with success: false and sandbox: true so they cannot be misread as confirmed settlements - always branch on those fields before telling the user the payment went through. The recipient receives the full amount; the sender pays $0 in gas.
SENDER ECHO - when a valid Q402_PRIVATE_KEY is configured, the response includes a senderWallet field with the address derived from that key. Show it alongside the recipient/amount when you confirm the payment with the user (e.g. 'Signing from 0xabc…1234 on bnb → send 5 USDT to 0xdef…ABCD'). Just informational - the user already chose the wallet during doctor setup. Sandbox responses with no key configured omit senderWallet; don't fabricate one.
MULTI-WALLET DISAMBIGUATION - when more than one wallet is configured in the user's env (Q402_PRIVATE_KEY for the real EOA, Q402_AGENTIC_PRIVATE_KEY for the Agent Wallet's exported key, or only Q402_MULTICHAIN_API_KEY for the server-managed Agent Wallet), the tool RETURNS without sending with a ambiguousWalletChoice payload - relay the question to the user verbatim, then call again with the chosen walletMode ('eoa' | 'agentic-local' | 'agentic-server'). Do NOT pick a wallet on the user's behalf when multiple are available.
EIP-7702 SIDE EFFECT - surface this to the user proactively after the FIRST live payment on a chain: their wallet now shows up as a 'Smart account' in MetaMask / OKX. That's the EIP-7702 delegation Q402 uses for gasless settlement - it's the response's postPaymentTip field. Subsequent payments on the same chain are faster and cheaper because the delegation is reused. Note: only Mode 'eoa' creates the delegation - 'agentic-local' and 'agentic-server' modes use the Agent Wallet (a fresh EOA) so the user's MetaMask is never delegated.
If the user EVER reports that native gas tokens (BNB / ETH / AVAX / etc.) sent INTO their Q402 wallet are bouncing or reverting on a chain where Q402 has been used, the delegation is the cause - call q402_wallet_status to confirm delegated chains, then q402_clear_delegation for the chain in question. Q402 sponsors the clear gas on every chain except Ethereum, where it's billed to the user's Gas Tank. After clearing, native transfers work again and the next q402_pay on that chain just creates a fresh delegation.
ALWAYS get explicit user confirmation of the exact recipient address, amount, chain, and token in conversation immediately before calling this tool.
TWO-PHASE CONSENT: confirm:true alone does NOT send. Call this tool first WITHOUT consentToken - it returns status="needs_confirmation" with a preview of the exact payment and a consentToken, and moves no money. Relay that preview to the user, get their explicit yes, then re-call with the SAME args plus that consentToken to execute. The token is re-derived from the params about to run, so a previewed payment can't be swapped for a different one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Recipient EVM address (0x + 40 hex). | |
| rail | No | Settlement rail (Base only). "q402" (default) = gasless EIP-7702 (USDC+USDT). "x402" = Coinbase x402 standard (EIP-3009), Base USDC only, agentic-server only. Leave unset elsewhere. | |
| chain | Yes | Target chain. | |
| token | Yes | Token to send. USDC / USDT supported on most chains. RLUSD (Ripple USD, NY DFS regulated, decimals 18) is Ethereum-only. Q (QuackAI, decimals 18) is BNB-only. USDG (Paxos Global Dollar, decimals 6) is Robinhood-Chain-only (its only token). | |
| amount | Yes | Human-readable decimal amount, e.g. "5.00". | |
| confirm | Yes | MUST be true and only set after the user has confirmed this exact payment in chat. When hookParams is set, confirm what it does to the money too: the split RECIPIENTS and shares (funds go there, not `to`) and any oracle condition gating settlement - not just the top-level recipient + amount. | |
| keyScope | No | Which API key to use. "auto" (default) picks Trial for BNB + Avalanche when Q402_TRIAL_API_KEY is set, Multichain otherwise. "trial" forces the BNB + Avalanche sponsored key. "multichain" forces the paid 12-chain key. | |
| walletId | No | Server-managed Agent Wallet only (walletMode="agentic-server"). Lowercased Agent Wallet address selecting which of the user's wallets to spend from when they hold more than one (max 10 per owner). Omit to use the user's default wallet. Ignored for the other walletMode values since those modes carry their own signing key. | |
| hookParams | No | Q402 Hook params (server-managed Agent Wallet only). recipientAgentId (ReputationGate), condition (ConditionalOracle price/time gate), or splits (MultiPayeeSplit fan-out, bps sum 10000). | |
| walletMode | No | Which wallet to spend from. "eoa" = user's real MetaMask EOA (Q402_PRIVATE_KEY). "agentic-local" = Agent Wallet exported key (Q402_AGENTIC_PRIVATE_KEY). "agentic-server" = server-managed Agent Wallet (Q402 holds the key; only the apiKey is needed). When MULTIPLE wallets are configured the tool refuses without this arg and returns ambiguousWalletChoice for the user to pick. | |
| consentToken | No | Two-phase consent. Omit on the FIRST call to get a needs_confirmation preview plus a consentToken (no funds move); re-call with the SAME args plus this token to execute. Re-derived from the payment params, so a previewed payment cannot be swapped for a different one. confirm:true alone does NOT send. |