x402-payment

Automate x402 token payments for protected AI agent endpoints across TRON and EVM networks.

91|14|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/BofAI/skills --skill x402-payment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: x402-payment
Source: https://github.com/BofAI/skills/tree/main/x402-payment
Command: npx skills add https://github.com/BofAI/skills --skill x402-payment

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @bankofai/x402, @bankofai/agent-wallet, tronweb.

What problem does it solve?

x402-payment resolves 402 Payment Required flows by automatically negotiating, signing, and submitting token payments so your AI agent can finish protected API requests without manual intervention.

Core Features & Use Cases

  • Automatic 402 handling: Detects payment requirements and performs the required payment flow using the x402 mechanisms.
  • Cross-chain token payments: Supports TRON (TRC20 USDT/USDD) and EVM (ERC20 USDT/USDC) with network-specific routing.
  • GasFree support for gasless payments: Prefers exact_gasfree when available and provides wallet info and activation flows to make gasless execution possible.
  • Use case: An AI agent calls a protected endpoint that returns 402; this skill then pays the required amount from the configured Agent Wallet and returns the final response body for continued task execution.

Quick Start

Use the x402-payment skill to pay a protected TRON Nile endpoint by asking: "Invoke x402-payment with URL https://x402-demo.bankofai.io/protected-nile, network nile, and entrypoint chat, passing input {prompt: 'hello'}."

Frequently Asked Questions about x402-payment

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

FAQPage Schema
How do I automate token payments for 402 Payment Required responses on EVM and TRON?

Automating 402 Payment Required responses involves detecting the payment requirement and signing a token transfer using an Agent Wallet. This skill negotiates and submits the required TRC20 or ERC20 payment so your AI agent receives the final API response body.

What is GasFree support and how does it enable gasless TRON payments?

GasFree support enables gasless TRON payments by querying GasFree info and activating accounts to execute transactions without holding TRX. The skill prioritizes exact_gasfree when available to facilitate gasless execution.

How do I invoke an x402-protected agent endpoint using TRON Nile?

To invoke an x402-protected endpoint on TRON Nile, provide the URL, network, entrypoint, and input parameters. The skill handles the token payment flow and returns the final response body for task execution.

Do I need Node.js 20+ and an Agent Wallet to handle x402 endpoint payments?

Yes, Node.js 20+ and an Agent Wallet are required to sign token payments for x402 endpoints. The skill uses these prerequisites to automate cross-chain token payments and integrate with the x402_invoke CLI tool.

Can I use this to pay for protected API requests across different networks?

Yes, you can pay for protected API requests across TRON and EVM networks. The skill supports network-specific token routing for TRC20 USDT/USDD and ERC20 USDT/USDC to resolve 402 errors automatically.

What are the limitations of using x402 mechanisms for AI agent API invocation?

Limitations include requiring network-specific token selection and optional TRON Grid API key configuration. The skill only resolves 402 Payment Required flows for x402-protected endpoints and requires Agent Wallet-backed signing to function.