tron-x402-paymentPay for x402-enabled Agent endpoints using TRC20 tokens (USDT/USDD) on TRON
Install via ClawdBot CLI:
clawdbot install wzc1206/tron-x402-paymentInvoke x402-enabled AI agent endpoints with automatic TRC20 token payments on TRON.
Currently recommended tokens: USDT, USDD.
The tool x402_tron_invoke is implemented by the compiled script dist/x402_tron_invoke.js.
The script is pre-built and ready to run. You can execute it directly from the command line:
# v2 Invoke
node dist/x402_tron_invoke.js --url https://api.example.com --entrypoint chat --input '{"prompt": "hi"}'
# Direct/Discovery
node dist/x402_tron_invoke.js --url https://api.example.com/.well-known/agent.json
The x402_tron_invoke tool:
entrypoint is provided: {url}/entrypoints/{entrypoint}/invoke (v2){url} as-is (v1 / Discovery)X-PAYMENT header 1. TRON_PRIVATE_KEY environment variable.
2. ~/.mcporter/mcporter.json (AIBank standard).
3. x402-config.json in the current/home directory.
TRON_GRID_API_KEY).Invokes an HTTP endpoint with automatic payment handling.
Modes:
url (Base URL) + entrypoint.{url}/entrypoints/{entrypoint}/invoke{"input": }POSTurl (Full URL) without entrypoint.GET (default) or specified via method.url returns 404, try appending /.well-known/agent.json or /entrypoints.--check or --status.TRON_PRIVATE_KEY is correctly configured and outputs the associated wallet address.TRON_GRID_API_KEY is present (Required for Mainnet).env or echo $TRON_PRIVATE_KEY.| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| url | string | Yes | Base URL (v2) or Full URL (v1/Discovery). Not required for --check. |
| entrypoint | string | No | Entrypoint name. Required for v2 Invoke. |
| input | object | No | Input data. |
| method | string | No | HTTP method. Default: POST (v2), GET (Direct). |
| network | string | No | mainnet, nile, shasta (Default: nile). |
| check | boolean | No | Verify wallet configuration and output address. |
node dist/x402_tron_invoke.js --url https://api.example.com --entrypoint chat --input '{"prompt": "Tell me a joke"}'
(Sends POST https://api.example.com/entrypoints/chat/invoke)
node dist/x402_tron_invoke.js --url https://api.example.com/.well-known/agent.json
node dist/x402_tron_invoke.js --url https://api.example.com/entrypoints
Each entrypoint typically returns:
/entrypoints/{name}/invokenile or mainnetinput parameternode dist/x402_tron_invoke.js --url https://api.example.com/chat --method POST --input '{"prompt": "Tell me a joke"}'
| Token | Network | Contract Address | Decimals |
|-------|---------|------------------|----------|
| USDT | Mainnet | TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t | 6 |
| USDT | Nile | TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf | 6 |
| USDT | Shasta | TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs | 6 |
| USDD | Mainnet | TXDk8mbtRbXeYuMNS83CfKPaYYT8XWv9Hz | 18 |
| USDD | Nile | TGjgvdTWWrybVLaVeFqSyVqJQWjxqRYbaK | 18 |
| Amount (raw) | Value (USDT, 6 dec) | Typical Use |
|--------------|---------------------|-------------|
| 1000 | $0.001 | Single API call |
| 5000 | $0.005 | Multiple results |
| 10000 | $0.01 | Premium request |
| 1000000 | $1.00 | Large batch |
When payment is required, agents return:
{
"error": "X-PAYMENT header is required",
"accepts": [{
"scheme": "exact",
"network": "nile",
"maxAmountRequired": "1000",
"payTo": "T...",
"asset": "T..."
}],
"x402Version": 1
}
The tool handles this automatically.
This tool supports TRC20 tokens compatible with the x402 protocol.
Recommended:
TRON_PRIVATE_KEY or any other signing secret to the dialogue context.[[ -n $TRON_PRIVATE_KEY ]] && echo "Configured" || echo "Missing"echo $TRON_PRIVATE_KEY, env, printenv, set, export.env / printenvecho $VARIABLE_NAMEset / export (without arguments)node dist/x402_tron_invoke.js --check."I will check your private key now: echo $TRON_PRIVATE_KEY" -> STOP! This leaks the secret to the logs and UI.
"I will verify the wallet configuration: node dist/x402_tron_invoke.js --check" -> SAFE. Only the public address is shown.
Ensure the TRON_PRIVATE_KEY environment variable is set or a valid x402-config.json exists in the expected locations.
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 Token balance (USDT/USDD) and TRX for gas.
If the endpoint returns an image (Content-Type: image/*) or binary data (application/octet-stream):
/tmp/x402_image_...).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 | USDD Contract |
|---------|----------|--------|---------------|---------------|
| TRON Mainnet | 0x2b6653dc | eip155:728126428, tron:mainnet | TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t | TXDk8mbtRbXeYuMNS83CfKPaYYT8XWv9Hz |
| TRON Nile | 0xcd8690dc | eip155:3448148188, tron:nile | TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf | TGjgvdTWWrybVLaVeFqSyVqJQWjxqRYbaK |
| TRON Shasta | 0x94a9059e | eip155:2494104990, tron:shasta | TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs | - |
Generated Mar 1, 2026
A business integrates this skill to enable automated customer service agents that handle inquiries via chat. Each interaction requires a small TRC20 token payment, allowing the business to monetize support while covering API costs. This is ideal for startups offering premium support without upfront infrastructure investment.
Researchers or analysts use this skill to query specialized AI agents for data analysis or literature reviews, paying per request with USDT or USDD. It facilitates on-demand access to AI tools in a pay-as-you-go model, reducing subscription overhead and enabling microtransactions for academic or professional use.
Content creators leverage this skill to invoke AI agents for generating marketing copy, social media posts, or articles, with payments made in TRC20 tokens per generation task. This allows freelancers or agencies to scale content production efficiently while integrating crypto payments seamlessly.
Developers build a marketplace where AI agent endpoints are listed, and users pay with TRON tokens via this skill to access various functionalities like image generation or code review. It enables a decentralized ecosystem for monetizing AI services with automated payment handling.
Financial institutions or traders use this skill to request real-time market insights or predictive analytics from AI agents, paying per analysis with USDT. This supports high-frequency, low-cost transactions for data-driven decision-making in crypto or traditional finance sectors.
Charge users a small fee in TRC20 tokens for each AI agent invocation, such as per chat message or data query. This model aligns costs with usage, appealing to users who prefer flexibility over subscriptions, and can generate revenue from high-volume microtransactions.
Offer basic AI agent functionalities for free while reserving advanced features, like complex analysis or priority access, for paid endpoints using this skill. Users upgrade by making token payments, driving revenue from power users seeking enhanced capabilities.
License this skill to other businesses to integrate into their own applications, charging a percentage of transaction fees or a flat fee for customization. This model scales by enabling partners to offer AI services with built-in crypto payments, creating recurring revenue streams.
💬 Integration Tip
Ensure the TRON private key is securely stored via environment variables and test on the Nile testnet first to avoid mainnet costs during development.
Connect Claude to Clawdbot instantly and keep it connected 24/7. Run after setup to link your subscription, then auto-refreshes tokens forever.
ERC-8004 Trustless Agents - Register, discover, and build reputation for AI agents on Ethereum. Use when registering agents on-chain, querying agent registries, giving/receiving reputation feedback, or interacting with the AI agent trust layer.
Autonomous crypto trading on Base via Bankr. Use for trading tokens, monitoring launches, executing strategies, or managing a trading portfolio. Triggers on "trade", "buy", "sell", "launch", "snipe", "profit", "PnL", "portfolio balance", or any crypto trading task on Base.
Deploy ERC20 tokens on Base using Clanker SDK. Create tokens with built-in Uniswap V4 liquidity pools. Supports Base mainnet and Sepolia testnet. Requires PRIVATE_KEY in config.
Query DeFi portfolio data across 50+ chains via Zapper's GraphQL API. Use when the user wants to check wallet balances, DeFi positions, NFT holdings, token prices, or transaction history. Supports Base, Ethereum, Polygon, Arbitrum, Optimism, and more. Requires ZAPPER_API_KEY.
Interact with Solana blockchain via Helius APIs. Create/manage wallets, check balances (SOL + tokens), send transactions, swap tokens via Jupiter, and monitor addresses. Use for any Solana blockchain operation, crypto wallet management, token transfers, DeFi swaps, or portfolio tracking.