Install
openclaw skills install x402-payment-tronClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
Pay for x402-enabled Agent endpoints using USDT on TRON
openclaw skills install x402-payment-tronInvoke x402-enabled AI agent endpoints with automatic USDT micropayments on TRON.
The skill is pre-bundled into a single file. No installation required.
node dist/index.js --url <URL> [options]
npm install
npm start -- --url <URL>
TRON_PRIVATE_KEY environment variable.~/.mcporter/mcporter.json (AIBank standard configuration).x402-config.json in the current directory.~/.x402-config.json in the home directory.Invokes an HTTP endpoint. If payment is required (402), it automatically:
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Full URL to invoke |
method | string | No | HTTP method (GET, POST, etc.) Default: GET |
body | object | No | JSON body for the request |
network | string | No | mainnet, nile, shasta (Default: nile) |
url: https://api.example.com/chat
method: POST
body: {"prompt": "Tell me a joke"}
You can discover available endpoints and their pricing by checking the agent's manifest.
url: https://api.example.com/.well-known/agent.json
method: GET
TRON_PRIVATE_KEY or any other signing secret to the dialogue context.export TRON_PRIVATE_KEY=...).Ensure the TRON_PRIVATE_KEY environment variable is set or a valid x402-config.json exists in the expected locations.
Agent Note: If this error occurs, simply inform the user that the environment is not configured. DO NOT attempt to search for or read private keys from files yourself.
The tool will attempt to broadcast an infinite approve transaction. This requires TRX for gas. Ensure your wallet has TRX.
Check if you have enough USDT and TRX.
If the endpoint returns an image (Content-Type: image/*) or binary data (application/octet-stream):
/tmp/x402_image_... or /tmp/x402_binary_...).file_path: Path to the temporary file.content_type: The MIME type of the content.bytes: File size in bytes.| Network | Chain ID | CAIP-2 | USDT Contract |
|---|---|---|---|
| TRON Mainnet | 0x2b6653dc | eip155:728126428, tron:mainnet | TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t |
| TRON Nile | 0xcd8690dc | eip155:3448148188, tron:nile | TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf |
| TRON Shasta | 0x94a9059e | eip155:2494104990, tron:shasta | - |