pay-with-app

Pays HTTP 402 challenges from OKX Agent Payments Protocol on X Layer using EIP-3009 signatures.

1|Updated Sep 4, 2025
One-click install
npx skills add https://github.com/FuzzysTodd/The-Nexus-Protocol-Token-DAO --skill pay-with-app-fuzzystodd
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pay-with-app
Source: https://github.com/FuzzysTodd/The-Nexus-Protocol-Token-DAO/tree/main/skills/pay-with-app
Command: npx skills add https://github.com/FuzzysTodd/The-Nexus-Protocol-Token-DAO --skill pay-with-app-fuzzystodd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires viem, and includes references (resource) components.

What problem does it solve? Merchants using OKX's Agent Payments Protocol (APP) on X Layer return HTTP 402 payment challenges that require a signed EIP-3009 TransferWithAuthorization to unlock the resource. This Skill automates parsing the challenge, funding the wallet with the requested stablecoin, signing the authorization, and retrying the request with a valid X-PAYMENT header. ## Core Features & Use Cases - 402 Challenge Parsing and Validation: Extracts and validates x402 v1 challenges, enforcing the exact scheme, chain 196 network, positive amounts, and strict input sanitization. - Cross-Chain Funding via Uniswap Trading API: Detects insufficient balances and routes or bridges funds into USDT0, USDG, or USDC on X Layer with per-transaction confirmation gates. - EIP-3009 Signing and Settlement: Builds the typed-data signature with byte-exact EIP-712 domain values, assembles the X-PAYMENT payload, and retries the original request for zero-gas settlement. - Use Case: An AI agent hits a 402 paywall on an X Layer API priced in USDT0. The Skill checks the wallet balance, funds it if needed, obtains user confirmation, signs the authorization, and completes the paid request. ## Quick Start Ask the agent to pay the 402 challenge returned by an X Layer merchant URL using this skill with your PRIVATE_KEY environment variable set.

Frequently Asked Questions about pay-with-app

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pay an HTTP 402 challenge on X Layer?▼

Parse the x402 challenge body, confirm the network resolves to chain 196, verify your wallet holds the requested asset, then sign an EIP-3009 TransferWithAuthorization and retry the request with the X-PAYMENT header. OKX's facilitator settles the transfer on-chain with zero gas to the payer.

What tokens can I use for OKX Agent Payments Protocol payments?▼

APP on X Layer supports USDT0, USDG, and USDC as stablecoin settlement assets. USDT0 is the default funding target due to the deepest Uniswap liquidity, while USDC lacks reliable Uniswap v3 routing on X Layer and should be bridged from a liquid chain.

Does this skill support x402 schemes other than exact?▼

No, version 1.0.0 supports only the exact scheme, which OKX markets as Instant Payment. The upto and batch-settlement schemes, plus escrow, session, and batch features, are refused cleanly and reserved for a future version.

Can I bridge funds from other chains to X Layer for payment?▼

Cross-chain quotes into chain 196 currently fail because Across does not list X Layer as a destination. You must bridge externally through a service supporting X Layer, then re-invoke the skill for any same-chain swap and the 402 settlement.

Why was my EIP-3009 signature rejected with another 402?▼

Rejections usually come from an incorrect EIP-712 domain: the name and version must be copied byte-exact from the challenge's extra field, including non-ASCII characters. Also verify validBefore is fresh and the nonce was unused.

What happens if a 402 challenge requests zero amount?▼

A challenge with maxAmountRequired of zero is refused as merchant misconfiguration. HTTP 402 demands a positive payment, and OKX's facilitator will not settle a zero-value TransferWithAuthorization.