HTTP 402 Payment Required dispatcher for x402 + MPP. Detects protocol from response headers and routes to the matching protocol playbook: 'WWW-Authenticate: Payment' header → MPP (`protocols/mpp.md`); 'PAYMENT-REQUIRED' header or `x402Version` body field → x402 (`protocols/x402.md`). Returns a ready-to-paste authorization header. MPP covers charge (one-shot) and session (open / voucher / topUp / close) in transaction (TEE-signed EIP-3009) and hash (client-broadcast) modes, with splits, optional initial-voucher prepay, and channel state tracking. x402 covers v1 (`X-PAYMENT` header) and v2 (`PAYMENT-SIGNATURE` header) with TEE or local-key signing. Trigger words (English): '402', 'payment required', 'mpp', 'machine payment', 'pay for access', 'payment-gated', 'WWW-Authenticate: Payment', 'x402', 'x402Version', 'PAYMENT-REQUIRED', 'PAYMENT-SIGNATURE', 'X-PAYMENT', 'open channel', 'voucher', 'session payment', 'close channel', 'topup channel', 'top up channel', 'settle channel', 'settle session', 'refund channel'
Installation
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Detects whether a 402 is MPP or x402 and loads the matching protocol playbook end-to-end.
Read ../okx-agentic-wallet/_shared/preflight.md before any onchainos command. EVM only — CAIP-2 eip155:<chainId> (run onchainos wallet chains for the list).
MPP mid-session ops (close / topup / settle / voucher / refund mentioned with an active channel_id, regardless of fresh 402) → stay here, load protocols/mpp.md, jump to the matching phase. Do NOT search for a separate close-channel / topup-channel / settle-channel tool — they're all onchainos payment mpp-session-* variants.
Step 1: Send the Original Request
Make the HTTP request the user asked for. If status is not 402, return the body directly — no payment, no wallet check, no other tool calls.
Step 2: Detect the Protocol
Priority 1: response.headers['WWW-Authenticate']
starts with "Payment " → MPP → protocols/mpp.md
Priority 2: response.headers['PAYMENT-REQUIRED']
base64-encoded JSON → x402 v2 → protocols/x402.md
Priority 3: response body JSON has "x402Version"
→ x402 v1 → protocols/x402.md
Otherwise → not a supported payment protocol, stop
Both headers present — STOP and ask:
The server offers both MPP and x402 payment protocols. Which would you like to use?
MPP (newer, supports sessions and streaming, recommended)
x402 (simpler, single-shot)
Step 3: Dispatch
Load the matching playbook and follow it from decode → confirm → wallet check → sign → assemble header → replay → suggest next steps: