# PowerSun — TRON Energy Marketplace for AI Agents > PowerSun is the first marketplace where AI agents can buy and sell TRON network resources (Energy and Bandwidth). ## What is TRON Energy? TRON transactions require Energy to execute. Without Energy, TRX is burned as fees. Renting Energy from PowerSun saves 50-80% compared to burning TRX. ## How It Works ### For Buyers (AI agents that send TRON transactions): 1. **Estimate cost**: POST /api/v2/agent/estimate — calculate how much energy you need 2. **Buy energy**: POST /api/v2/agent/buy-energy — purchase energy for your target address 3. **Check order**: GET /api/v2/agent/order/{orderId} — track delegation status ### Payment Methods: - **API Key + TRX balance**: Register TRON wallet → deposit TRX → buy from balance - **TRX pay-per-use (402)**: No registration. POST buy-energy (no key) → 402 response → send TRX on TRON → poll status - **USDC on Base (x402)**: No registration. POST buy-energy (no key) → 402 response with x402 option → sign EIP-3009 transferWithAuthorization → resend with X-PAYMENT header → instant settlement ### x402 Payment Flow (USDC on Base): 1. POST /api/v2/agent/buy-energy (no API key) → receive 402 with x402 block 2. The x402 block contains: scheme "exact", network "eip155:8453", USDC amount, payTo address 3. Sign a EIP-3009 transferWithAuthorization for the USDC amount 4. Resend POST /buy-energy with X-PAYMENT header (base64 payload) + X-PAYMENT-INTENT-ID header 5. Server verifies and settles via Coinbase facilitator → returns 200 + order ### MCP Integration: Connect via Model Context Protocol at POST /mcp for tool-based interaction. ## Endpoints - POST /api/v2/agent/register — Start registration - POST /api/v2/agent/verify — Verify signature - POST /api/v2/agent/estimate — Estimate cost - POST /api/v2/agent/buy-energy — Purchase energy (API key, TRX 402, or x402 USDC) - GET /api/v2/agent/balance — Check balance - GET /api/v2/agent/order/{orderId} — Order status - GET /api/v2/agent/payment-status/{intentId} — 402 payment status - POST /api/v2/agent/broadcast — Broadcast transaction - POST /mcp — MCP tool endpoint ## Pricing - Energy: from 50 SUN per unit per day - Typical TRC20 transfer: 65,000 energy (~3 TRX for 1 hour) - Savings: 50-80% compared to TRX burn ## Supported Payment Networks - TRON (tron:mainnet) — TRX native transfer - Base (eip155:8453) — USDC via x402 protocol ## Links - OpenAPI spec: /openapi.json - Agent descriptor: /.well-known/agents.json