# AwesomeFee for AI agents: TRON resources via x402 > TRON energy and transaction sending for AI agents, paid per call in USDC on Base via x402 v2: no account, no API key, no TRX and no gas for the payer. What is sold: TRON energy delegated to any address for 1000 blocks (a USDT TRC-20 transfer needs about 65 000 energy, about 131 000 to an address that never held USDT; with it the transfer burns no TRX), sending a signed transaction with its energy included, prepaid passes for a TRON full node, for sending through our Proxy and for address events. How to pay: x402 v2, scheme `exact`, USDC on Base (`eip155:8453`), an EIP-3009 authorization signed by the payer's wallet. Prices: agent price in USDC at the live TRX/USD rate. Quotes, transaction estimates and address analysis are free. ## Canonical calls 1. Price and payment terms, GET only (free): `GET https://api.awesomefee.com/x402/v1/quote?product=energy&amount=65000&address=` → `price_usdc`, `accepts[0]` (`scheme` exact, `network` eip155:8453, `asset` USDC, `amount` in USDC atomic units, `payTo`, `maxTimeoutSeconds`), `resource.url`, and `pay` (method, url, body to repeat). With `address` the quote is `payable` until `valid_until`. 2. Buy energy: `POST https://api.awesomefee.com/x402/v1/tron/energy` with `{"address":"","amount":65000}` → `402`: the same terms in the `PAYMENT-REQUIRED` header (base64 JSON) and in the body. Sign `accepts[0]` and repeat the same POST with `PAYMENT-SIGNATURE` (base64 PaymentPayload) → `200` with the delivery and `PAYMENT-RESPONSE` (the USDC settlement on Base). 3. Send a signed transaction with its energy: `POST https://api.awesomefee.com/x402/v1/tron/send` with `{"signed_tx": }` → `402` → pay → `200` with `txid`, `block`, `result`. 4. Estimate a transaction (free): `POST https://api.awesomefee.com/x402/v1/tron/estimate` with `{"trc20_transfer":{"owner":"T…","token":"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t","to":"T…","amount":"1000000"}}` → energy, bandwidth, what is missing and its price; `buyable: false` with `refusal` (e.g. `ADDRESS_RESERVED`) = we would not sell to that owner, stop or use another address. 5. Find anything else (free): `GET https://api.awesomefee.com/v1/search?q=` → routes with `url`, `parameters`, `price`, `quote_url`, curl `example`. About the answers: `202` means paid and still in progress — poll `https://api.awesomefee.com/x402/v1/payments/{payment_id}` and never pay again; if an order cannot be fulfilled the USDC is refunded to the payer automatically. An empty or incomplete body gets `402` with example terms and the missing fields named in `error`. Any x402 v2 client does the 402 → sign → repeat loop: `@x402/fetch`, `@x402/axios`, Python `x402`. ## Docs - [OpenAPI 3.1](https://api.awesomefee.com/openapi.yaml): every route, request and response schemas, `x-payment-info`, error codes - [Search](https://api.awesomefee.com/v1/search?q=energy): the catalogue of routes (no `q` = everything) - [x402 manifest](https://api.awesomefee.com/.well-known/x402): paid routes and how to pay - [Skill](https://api.awesomefee.com/SKILL.md): when to use, recipe "send USDT without TRX", refusals - [Full text for LLMs](https://api.awesomefee.com/llms-full.txt): this file, the skill, all examples and the OpenAPI in one file - [Status](https://api.awesomefee.com/x402/v1/status): whether payments, sending and refunds work right now ## Passes `POST /x402/v1/{proxy/pass | rpc/pass | events/sub}` with `{"tier": ""}`, paid the same way; the answer has a `token` for `Authorization: Bearer` and the URL to use. `tier` = tier name or its USDC price. - Proxy (`proxy/pass`, also `senders`: up to 5 TRON addresses): proxy-5, proxy-20, proxy-100 — credits in USDC, 30 days; broadcast to `https://api.awesomefee.com/proxy` as usual, energy is supplied and charged per transaction - Node reads (`rpc/pass`): rpc-trial 0.5 = 50 000 credits / 7 days; rpc-s 9 = 1M; rpc-m 35 = 5M; rpc-l 120 = 20M; rpc-xl 300 = 60M (30 days; 1 credit per ordinary call); TronWeb `fullHost` `https://api.awesomefee.com/rpc`, `TRON-PRO-API-KEY` - Address events (`events/sub`): ev-s 3 = 10 addresses, 200 000 events; ev-m 15 = 100, 2M; ev-l 60 = 1 000, 10M (30 days); webhook or WebSocket at `https://api.awesomefee.com/v1/events` - Balance: `GET https://api.awesomefee.com/x402/v1/pass` with the token (free) ## Examples - [curl: 402 → sign → 200 by hand](https://awesomefee.com/agents/examples/curl.sh) with [signer](https://awesomefee.com/agents/examples/sign-x402.mjs) - [JavaScript, @x402/fetch](https://awesomefee.com/agents/examples/x402-fetch.mjs) - [JavaScript, @x402/axios](https://awesomefee.com/agents/examples/x402-axios.mjs) - [Python, x402 + requests](https://awesomefee.com/agents/examples/x402_requests.py) ## Optional - MCP server `https://api.awesomefee.com/mcp` (Streamable HTTP): one tool `search` and these docs as resources; it never pays. [Server card](https://api.awesomefee.com/mcp/server-card), [AI catalog](https://api.awesomefee.com/.well-known/ai-catalog.json), [MCP client config](https://awesomefee.com/agents/examples/mcp-config.json) - [Agents overview for people](https://awesomefee.com/docs/en/agents/overview/) - [AwesomeFee documentation](https://awesomefee.com/docs/en/) --- # TRON energy and transaction sending for USDC (x402) ## How to use it — always these steps 1. **Find:** `GET https://api.awesomefee.com/v1/search?q=` (free; English or Russian, e.g. `q=send transaction`, `q=buy energy`, `q=rpc`, `q=events webhook`; no `q` = the whole catalogue; `limit` 1–50). Each result has `id`, `title`, `description`, `method`, `url`, `parameters` (JSON Schema of the body), `price`, `payment` (`free` | `x402` | `pass`), a curl `example` and what it `returns`. 2. **Call** the returned URL with an x402 v2 HTTP client (`@x402/fetch`, `@x402/axios`, Python `x402`). 3. **Pay on 402:** the client signs the USDC terms from YOUR wallet (Base, EIP-3009, no gas) and repeats the request. 4. **Get the result** (`200`, or `202` + `status_url` while it runs). No account, no API key, nothing to install. The reference below describes each product. API: `https://api.awesomefee.com` · Catalog: `GET https://api.awesomefee.com/x402/v1` · OpenAPI: `https://api.awesomefee.com/openapi.json` · MCP: `https://api.awesomefee.com/mcp` · Docs: `https://awesomefee.com/docs/en/agents/overview/` ## When to use - You must send USDT (TRC-20) or call a contract on TRON and the sender has no energy: without it the network **burns TRX** from the sender (100 SUN per energy unit; a USDT transfer ≈ 64 285 energy ≈ 6.4 TRX; to an address that never held USDT ≈ 130 285 energy). If the sender has no TRX at all, the transaction fails. - You hold USDC on Base (any EVM wallet) but no TRX — pay in USDC, gasless (EIP-3009 signature). - You need a price or an estimate before acting — free. - You need TRON node reads or address notifications — prepaid passes, cheaper than typical RPC providers. ## TRON resources in 5 lines - **Energy** pays for smart-contract execution (USDT transfers, contract calls). **Bandwidth** pays for bytes of every transaction (~345 bytes for a USDT transfer, ~270 for TRX). - Every address gets 600 free bandwidth bytes per day; energy is never free. - Missing resource → the network burns TRX from the sender: 100 SUN/energy, 1 000 SUN/byte (1 TRX = 10^6 SUN). - Energy can be delegated to an address from someone else's stake: that is what we do; the sender keeps its keys. - A new receiver of USDT costs ~2× energy (new storage slot). ## Endpoints (base `https://api.awesomefee.com`) | Need | Call | Price | |---|---|---| | Find the right product and URL | `GET /v1/search?q=…` | free | | Price of energy / sending; pass tiers | `GET /x402/v1/quote?product=energy&amount=65000` (`product`: energy, send, proxy_pass, rpc_pass, events_sub) | free | | Energy and bandwidth of a transaction, what is missing, price | `POST /x402/v1/tron/estimate {"transaction": {…}}` or `{"trc20_transfer": {"owner","token","to","amount"}}` | free | | What an address spends and burns (7 days) | `GET /x402/v1/address/T…` | free | | Send a **signed** transaction with its energy included | `POST /x402/v1/tron/send {"signed_tx": {…}}` | x402 | | Energy to any address for 1000 blocks (~50 min) | `POST /x402/v1/tron/energy {"address":"T…","amount":65000}` | x402 | | Pass: send through our Proxy, energy per transaction from the pass | `POST /x402/v1/proxy/pass {"tier":"proxy-5","senders":["T…"]}` (≤ 5 senders) | x402 | | Pass: read our full TRON node (`/rpc/wallet/*`, `/rpc/walletsolidity/*`, `/rpc/jsonrpc`) | `POST /x402/v1/rpc/pass {"tier":"rpc-s"}` | x402 | | Pass: events of addresses (webhook or WebSocket) | `POST /x402/v1/events/sub {"tier":"ev-s"}` (optional `addresses`, https `webhook_url`) | x402 | | Pass balance | `GET /x402/v1/pass` + `Authorization: Bearer ` | free | | State of a paid order, refund | `GET /x402/v1/payments/{payment_id}` | free | `tier` is the tier name or its USDC price (`{"tier":9}` = `rpc-s`). A pass answer: `pass_id`, `token` (`tlp_…`, keep it), `tier`, `unit`, `added_credits`, `expires_at`, `limits`, `rpc_url` or `events_url`, `balance_url`. Buying again with `Authorization: Bearer ` tops that pass up (credits add, the later expiry wins). `GET /x402/v1/pass` answers `credits_left`, `spent`, `held`, `paid_usdc`. The catalogue of everything sold: `GET /x402/v1`. ## Pass tiers (`tier` = name or USDC price) Proxy (`proxy/pass`; credits = USDC, each sent transaction is charged the agent price of the energy supplied; ≤ 5 senders): proxy-5 (5), proxy-20 (20), proxy-100 (100), 30 days. Node reads (`rpc/pass`; 1 credit per ordinary call, 2–10 for heavy ones like blocks and logs): | Tier | USDC | Credits | Rate | Days | |---|---|---|---|---| | rpc-trial | 0.5 | 50 000 | 5 rps | 7 | | rpc-s | 9 | 1 000 000 | 10 rps | 30 | | rpc-m | 35 | 5 000 000 | 25 rps | 30 | | rpc-l | 120 | 20 000 000 | 50 rps | 30 | | rpc-xl | 300 | 60 000 000 | 100 rps | 30 | Address events (`events/sub`; 1 credit per delivered event): | Tier | USDC | Addresses | Subscriptions | Events | Days | |---|---|---|---|---|---| | ev-s | 3 | 10 | 3 | 200 000 | 30 | | ev-m | 15 | 100 | 10 | 2 000 000 | 30 | | ev-l | 60 | 1 000 | 25 | 10 000 000 | 30 | ## Paying (x402 v2) 1. Call the paid endpoint as is → `402`, header `PAYMENT-REQUIRED` = base64 JSON `{x402Version:2, accepts:[{scheme:"exact", network:"eip155:8453", amount:"", asset:"", payTo, maxTimeoutSeconds, extra}]}`. 2. Sign one `accepts` entry with your EVM wallet (EIP-3009 `transferWithAuthorization`, no gas) → PaymentPayload. 3. Repeat the same request with header `PAYMENT-SIGNATURE: ` → `200` + result + `PAYMENT-RESPONSE` (settlement tx on Base). `202 {"status":"pending","status_url":…}` = paid, still running: poll `status_url`. Do not hand-roll it: `@x402/fetch` / `@x402/axios` (JS) or `x402` (Python, `x402_requests`) do steps 1–3. ```js import { wrapFetchWithPaymentFromConfig } from '@x402/fetch'; import { ExactEvmScheme } from '@x402/evm/exact/client'; import { privateKeyToAccount } from 'viem/accounts'; const pay = wrapFetchWithPaymentFromConfig(fetch, { schemes: [{ network: 'eip155:8453', client: new ExactEvmScheme(privateKeyToAccount(process.env.EVM_PRIVATE_KEY)) }], spendControls: { maxAmountPerPayment: '$1' }, }); const r = await pay('https://api.awesomefee.com/x402/v1/tron/send', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ signed_tx }) }); ``` ## Recipe: send USDT on TRON without TRX 1. Build the TRC-20 `transfer` with your TRON library (TronWeb: `transactionBuilder.triggerSmartContract` on `TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t`, `transfer(address,uint256)`), set **expiration ≥ 2 min** ahead, sign it with the sender's TRON key. We never see that key and never change the transaction. 2. `POST /x402/v1/tron/estimate {"transaction": signed}` — check `estimate.missing_energy`, `estimate.would_revert`, `estimate.bandwidth_source` (must not be `unavailable`), `cover.price_usdc`. 3. `POST /x402/v1/tron/send {"signed_tx": signed}` with x402 → `{status:"confirmed", txid, block, result:"SUCCESS", energy_used, energy_burned_sun:0}`. ## Recipe: TronWeb on our node with an RPC pass `new TronWeb({ fullHost: 'https://api.awesomefee.com/rpc', headers: { 'TRON-PRO-API-KEY': token } })` — reads only; broadcasting is refused there (use `tron/send` or a Proxy pass: `https://api.awesomefee.com/proxy/wallet/broadcasttransaction` with `Authorization: Bearer `). ## Rules and refusals - Prices: **agent price** in USDC at the live TRX/USD rate. `GET /x402/v1/quote` shows the price with the full payment terms (`accepts[0]`, `pay`) by GET; quotes show `burn_equivalent_sun` / `burn_equivalent_usd`. - An empty or incomplete body gets 402 with example terms (`error` names the missing fields); paying them gives a new 402, nothing is charged. - Refused before payment (no 402, nothing charged): expired transaction, a call that would revert, a type other than TRX / TRC-20 and contract calls / TRC-10, sender not activated, more than 300 000 energy, the sender lacks its own or free bandwidth (`BANDWIDTH_UNAVAILABLE`: bandwidth is not sold yet), no capacity (`NO_CAPACITY`), rate limit (`RATE_LIMITED`, `Retry-After`). - Paid but not delivered by our fault → automatic USDC refund to the payer (see `payments/{id}`). Delivered but your transaction reverted on chain → no refund (the resource was used). - Energy bought with `tron/energy` lasts 1000 blocks; unused energy is not refunded. - Repeating the **same** payment returns the same answer; a new payment is a new order. ## MCP A thin directory: one tool `search` (the same `/v1/search`) and these docs as resources (llms.txt, SKILL.md, OpenAPI). Remote: `https://api.awesomefee.com/mcp` (Streamable HTTP, stateless). Local: `npx -y tron-x402-mcp` with `TRON_X402_API_URL=https://api.awesomefee.com`. The MCP server never pays: call the product URL with your own x402 client. ## Examples ### curl.sh ```bash #!/usr/bin/env bash # The x402 cycle by hand: 402 → sign → 200. One step per command; needs curl, jq, node (for signing only). # export API=https://api.awesomefee.com EVM_PRIVATE_KEY=0x… (YOUR wallet with USDC on Base) set -euo pipefail DEFAULT_API='https://api.awesomefee.com' API="${API:-$DEFAULT_API}" ADDR="${1:?TRON receiver address}" BODY="{\"address\":\"$ADDR\",\"amount\":65000,\"duration_blocks\":1000}" # 0. Find the product (free): its url, method, body schema, price curl -s "$API/v1/search?q=buy+energy&limit=1" | jq '.results[0] | {id, method, url, payment, price}' # 1. Free price curl -s "$API/x402/v1/quote?product=energy&amount=65000" | jq . # 2. Paid call without payment → 402; the terms are in the PAYMENT-REQUIRED header (base64 JSON) REQ=$(curl -s -o /dev/null -D - -X POST "$API/x402/v1/tron/energy" -H 'Content-Type: application/json' -d "$BODY" | tr -d '\r' | sed -n 's/^payment-required: //Ip') echo "$REQ" | base64 -d | jq '{amount: .accepts[0].amount, network: .accepts[0].network, payTo: .accepts[0].payTo, extra: .accepts[0].extra}' # 3. Sign the terms with your wallet (offline, EIP-3009: no gas) → PAYMENT-SIGNATURE SIG=$(echo "$REQ" | node sign-x402.mjs) # 4. The same request with the payment → 200 + result; PAYMENT-RESPONSE carries the settlement transaction HDR=$(mktemp) curl -s -D "$HDR" -X POST "$API/x402/v1/tron/energy" -H 'Content-Type: application/json' -H "PAYMENT-SIGNATURE: $SIG" -d "$BODY" | jq . tr -d '\r' < "$HDR" | sed -n 's/^payment-response: //Ip' | base64 -d | jq . rm -f "$HDR" ``` ### mcp-config.json ```json { "mcpServers": { "tron-x402": { "command": "npx", "args": [ "-y", "tron-x402-mcp" ], "env": { "TRON_X402_API_URL": "https://api.awesomefee.com" } }, "tron-x402-remote": { "type": "http", "url": "https://api.awesomefee.com/mcp" } } } ``` ### sign-x402.mjs ```js // Helper for the curl walk-through: reads a PAYMENT-REQUIRED header value (base64) on stdin and prints the // PAYMENT-SIGNATURE value (base64 PaymentPayload) signed with EVM_PRIVATE_KEY. Signing is offline (EIP-3009). // npm i @x402/core @x402/evm viem import { x402Client } from '@x402/core/client'; import { decodePaymentRequiredHeader, encodePaymentSignatureHeader } from '@x402/core/http'; import { ExactEvmScheme } from '@x402/evm/exact/client'; import { privateKeyToAccount } from 'viem/accounts'; const chunks = []; for await (const c of process.stdin) chunks.push(c); const required = decodePaymentRequiredHeader(Buffer.concat(chunks).toString().trim()); const client = new x402Client().register('eip155:*', new ExactEvmScheme(privateKeyToAccount(process.env.EVM_PRIVATE_KEY))); process.stdout.write(encodePaymentSignatureHeader(await client.createPaymentPayload(required))); ``` ### x402_requests.py ```python """Buy energy for a TRON address with the Python x402 SDK (requests). pip install "x402[requests,evm]" eth-account TRON_X402_API_URL=https://api.awesomefee.com EVM_PRIVATE_KEY=0x... python x402_requests.py TReceiverAddress... 65000 """ import base64 import json import os import sys from eth_account import Account from x402 import x402ClientSync from x402.http.clients.requests import x402_requests from x402.mechanisms.evm import EthAccountSigner from x402.mechanisms.evm.exact import ExactEvmScheme API = os.environ.get("TRON_X402_API_URL", "https://api.awesomefee.com") address, energy = sys.argv[1], int(sys.argv[2]) if len(sys.argv) > 2 else 65000 client = x402ClientSync() client.register(os.environ.get("X402_NETWORK", "eip155:8453"), ExactEvmScheme(signer=EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))) session = x402_requests(client) # free: find the product (search-v1) product = session.get(f"{API}/v1/search", params={"q": "buy energy", "limit": 1}).json()["results"][0] print("found:", product["id"], product["method"], product["url"]) # free print("quote:", session.get(f"{API}/x402/v1/quote", params={"product": "energy", "amount": energy}).json()) # paid: 402 -> sign -> 200 r = session.request(product["method"], product["url"], json={"address": address, "amount": energy, "duration_blocks": 1000}) print(r.status_code, r.json()) if "PAYMENT-RESPONSE" in r.headers: print("payment:", json.loads(base64.b64decode(r.headers["PAYMENT-RESPONSE"]))) ``` ### x402-axios.mjs ```js // Send a signed TRON transaction with its energy included, using @x402/axios. // npm i axios @x402/axios @x402/evm viem // TRON_X402_API_URL=https://api.awesomefee.com EVM_PRIVATE_KEY=0x… node x402-axios.mjs signed-tx.json import { readFileSync } from 'node:fs'; import axios from 'axios'; import { wrapAxiosWithPaymentFromConfig, decodePaymentResponseHeader } from '@x402/axios'; import { ExactEvmScheme } from '@x402/evm/exact/client'; import { privateKeyToAccount } from 'viem/accounts'; const API = process.env.TRON_X402_API_URL ?? 'https://api.awesomefee.com'; const signedTx = JSON.parse(readFileSync(process.argv[2], 'utf8')); // {txID, raw_data, raw_data_hex, signature[]} const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY); const api = wrapAxiosWithPaymentFromConfig(axios.create({ baseURL: API }), { schemes: [{ network: process.env.X402_NETWORK ?? 'eip155:8453', client: new ExactEvmScheme(account) }], spendControls: { maxAmountPerPayment: '$1' }, }); // free: what it costs and what it would burn without us const { data: est } = await axios.post(`${API}/x402/v1/tron/estimate`, { transaction: signedTx }); console.log('estimate:', est); // paid const res = await api.post('/x402/v1/tron/send', { signed_tx: signedTx }); console.log(res.status, res.data); // {status:"confirmed", txid, block, result:"SUCCESS", energy_used, ...} const settle = res.headers['payment-response']; if (settle) console.log('payment:', decodePaymentResponseHeader(settle)); ``` ### x402-fetch.mjs ```js // Buy energy for a TRON address with @x402/fetch (x402 v2): the 402 → pay → 200 cycle is automatic. // npm i @x402/fetch @x402/evm viem // TRON_X402_API_URL=https://api.awesomefee.com EVM_PRIVATE_KEY=0x… node x402-fetch.mjs TReceiverAddress… 65000 import { wrapFetchWithPaymentFromConfig, decodePaymentResponseHeader } from '@x402/fetch'; import { ExactEvmScheme } from '@x402/evm/exact/client'; import { privateKeyToAccount } from 'viem/accounts'; const API = process.env.TRON_X402_API_URL ?? 'https://api.awesomefee.com'; const [address, energy = '65000'] = process.argv.slice(2); const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY); // YOUR wallet with USDC on Base const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, { schemes: [{ network: process.env.X402_NETWORK ?? 'eip155:8453', client: new ExactEvmScheme(account) }], spendControls: { maxAmountPerPayment: '$1' }, // never pay more than $1 for one call }); // free: find the product (search-v1) — its url, method and body schema const { results } = await (await fetch(`${API}/v1/search?q=buy+energy&limit=1`)).json(); const product = results[0]; // {id: "x402.energy", method: "POST", url, parameters, price, payment: "x402", …} console.log('found:', product.id, product.method, product.url); // free: the price const quote = await (await fetch(`${API}/x402/v1/quote?product=energy&amount=${energy}`)).json(); console.log('quote:', quote); // paid: 402 → sign → 200 const res = await fetchWithPayment(product.url, { method: product.method, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ address, amount: Number(energy), duration_blocks: 1000 }), }); console.log(res.status, await res.json()); const settle = res.headers.get('PAYMENT-RESPONSE'); if (settle) console.log('payment:', decodePaymentResponseHeader(settle)); ``` ## OpenAPI ```yaml openapi: 3.1.0 info: title: 'AwesomeFee API for AI agents: TRON resources via x402' version: 1.0.0 summary: TRON energy, transaction sending, node access and address events, paid in USDC on Base via x402 v2. description: | **Start with `GET /v1/search?q=`**: it returns the product URLs; call one with an x402 v2 HTTP client, pay on 402, get the result. No account and no API key. Paid endpoints answer `402 Payment Required` with the x402 v2 terms in the `PAYMENT-REQUIRED` header (base64 JSON, also in the body); repeat the same request with `PAYMENT-SIGNATURE` (base64 PaymentPayload, scheme `exact`, USDC, EIP-3009 — the payer pays no gas) and get the result with `PAYMENT-RESPONSE` (settlement). Any x402 v2 client does this for you (`@x402/fetch`, `@x402/axios`, Python `x402`). Prices: agent price in USDC at the live TRX/USD rate. `GET /x402/v1/quote` shows the price and the full payment terms (the same `accepts[0]` as the 402) with a GET request; quotes also show `burn_equivalent_sun` / `burn_equivalent_usd`: what the sender would burn without us. Free: `GET /x402/v1`, `quote`, `tron/estimate`, `address/{address}`, `pass`, `payments/{id}`. Paid (x402): `tron/energy`, `tron/send`, `proxy/pass`, `rpc/pass`, `events/sub`. With a pass (Bearer): `/rpc/*` (node reads), `/proxy/wallet/broadcast*` (sending through our Proxy), `/v1/events/*` (address events). If a paid order cannot be fulfilled, the USDC is refunded to the payer automatically (see `payments/{id}`). Pass tiers (`tier` = name or its USDC price): Proxy proxy-5 / proxy-20 / proxy-100 (credits = USDC, 30 days); node reads rpc-trial 0.5 (50 000 credits, 7 days), rpc-s 9 (1M), rpc-m 35 (5M), rpc-l 120 (20M), rpc-xl 300 (60M); address events ev-s 3 (10 addresses, 200 000 events), ev-m 15 (100, 2M), ev-l 60 (1 000, 10M); 30 days unless noted. contact: url: 'https://awesomefee.com/docs/en/agents/overview/' x-guidance: >- To buy TRON energy for a USDT transfer: GET /x402/v1/quote?product=energy&amount=65000&address= (free) returns the price and the x402 terms (accepts[0]: scheme exact, network eip155:8453, USDC asset, amount in USDC atomic units, payTo); POST /x402/v1/tron/energy with {"address":"","amount":65000} answers 402 with the same terms in the PAYMENT-REQUIRED header; sign an EIP-3009 authorization for accepts[0] and repeat the same POST with PAYMENT-SIGNATURE (base64 PaymentPayload) to get 200 with the delivery and PAYMENT-RESPONSE. A 202 means paid and in progress: poll /x402/v1/payments/{payment_id} and never pay again. To send a signed transaction with its energy, POST it to /x402/v1/tron/send the same way. Free routes need no payment and no key; GET /v1/search?q= lists every route. servers: - url: 'https://api.awesomefee.com' tags: - { name: free, description: No payment. } - { name: paid, description: 'x402 v2, scheme exact, USDC on Base.' } - { name: pass, description: 'A pass token from a paid pass: Authorization: Bearer (node reads also TRON-PRO-API-KEY).' } paths: /v1/search: get: tags: [free] security: [] operationId: search summary: Find products (start here) description: | The public catalogue: free routes, paid x402 products and how to use a pass. Words in English or Russian (with synonyms: энергия → energy, отправить → send, нода → node, …); no `q` returns the whole catalogue. Then call `url` with `method` and a body matching `parameters`; `payment: x402` answers 402 first. Organization keys are never needed. parameters: - { name: q, in: query, required: false, schema: { type: string, maxLength: 200 }, examples: { send: { value: send USDT transaction }, energy: { value: купить энергию }, rpc: { value: rpc } } } - { name: limit, in: query, required: false, schema: { type: integer, minimum: 1, maximum: 50, default: 10 } } responses: '200': description: Catalogue entries, best first content: application/json: schema: { $ref: '#/components/schemas/SearchAnswer' } '429': { $ref: '#/components/responses/Error' } /x402/v1: get: tags: [free] operationId: catalog security: [] summary: What is sold, how to pay, free routes responses: '200': { description: Catalog, content: { application/json: { schema: { type: object, additionalProperties: true } } } } /x402/v1/quote: get: tags: [free] operationId: quote security: [] summary: Price and full payment terms of energy, sending or a pass (GET only) description: | The price plus the same terms as the 402 of the paid route: `x402Version`, `accepts[0]`, `resource`, and `pay` (method, url, body to repeat with `PAYMENT-SIGNATURE`). With all request fields (energy: `address`; passes: `tier`, proxy also `senders`) the quote is `payable`: a POST of exactly `pay.body` with `PAYMENT-SIGNATURE` for `accepts[0]` is accepted until `valid_until` without a first 402. Without them the terms are an example. parameters: - { name: product, in: query, schema: { type: string, enum: [energy, send, proxy_pass, rpc_pass, events_sub], default: energy } } - { name: amount, in: query, description: 'Energy units (energy, send); default 65000', schema: { type: integer, minimum: 1 } } - { name: address, in: query, description: 'energy: the receiver; makes the quote payable', schema: { $ref: '#/components/schemas/TronAddress' } } - { name: tier, in: query, description: 'passes: tier name; makes the quote payable', schema: { type: string } } - { name: senders, in: query, description: 'proxy_pass: comma-separated sender addresses', schema: { type: string } } responses: '200': description: Price (energy, send) or tiers (passes), with the payment terms content: { application/json: { schema: { $ref: '#/components/schemas/Quote' } } } '400': { $ref: '#/components/responses/Error' } '503': { $ref: '#/components/responses/Error' } /x402/v1/tron/estimate: post: tags: [free] operationId: estimateTx security: [] summary: Energy and bandwidth of a transaction on our node, what is missing, the price to cover it, whether we sell to its owner description: 'One of: a transaction (signed or not; nothing is broadcast), or a TRC-20 / TRX transfer / contract call described by fields.' requestBody: required: true content: application/json: schema: type: object properties: transaction: { $ref: '#/components/schemas/TronTransaction' } trc20_transfer: type: object properties: { owner: { $ref: '#/components/schemas/TronAddress' }, token: { $ref: '#/components/schemas/TronAddress' }, to: { $ref: '#/components/schemas/TronAddress' }, amount: { type: string, description: base units } } trx_transfer: type: object properties: { owner: { $ref: '#/components/schemas/TronAddress' }, to: { $ref: '#/components/schemas/TronAddress' }, amount_sun: { type: integer } } call: type: object properties: { owner: { $ref: '#/components/schemas/TronAddress' }, contract: { $ref: '#/components/schemas/TronAddress' }, data: { type: string, description: 'hex: selector + ABI arguments' }, call_value: { type: integer } } responses: '200': description: Estimate, and `cover` with the price when energy is missing content: { application/json: { schema: { $ref: '#/components/schemas/EstimateAnswer' } } } '400': { $ref: '#/components/responses/Error' } /x402/v1/address/{address}: get: tags: [free] operationId: analyzeAddress security: [] summary: Resource use of an address (7 days) parameters: - { name: address, in: path, required: true, schema: { $ref: '#/components/schemas/TronAddress' } } - { name: days, in: query, schema: { type: integer, enum: [7], default: 7 } } responses: '200': { description: 'Analysis; `status:"loading"` on the first call for a new address — repeat in 2–3 s', content: { application/json: { schema: { type: object, additionalProperties: true } } } } /x402/v1/tron/energy: post: tags: [paid] operationId: buyEnergy summary: Energy to any address for 1000 blocks (~50 min) description: | Delegates energy to any activated TRON address for 1000 blocks. A USDT transfer uses ≈ 65 000 energy (≈ 131 000 to an address that never held USDT); with it delegated the transfer burns no TRX. An empty or incomplete body is answered with 402 and example terms (the amount for 65 000 energy); a wrong value with 400. x-payment-info: { price: { mode: dynamic, currency: USD, amount: '0.45', description: 'live; GET /x402/v1/quote?product=energy&amount=65000' }, protocols: [{ x402: { version: 2, scheme: exact, network: 'eip155:8453', asset: USDC } }] } parameters: [{ $ref: '#/components/parameters/PaymentSignature' }] requestBody: required: true content: application/json: schema: type: object required: [address, amount] properties: address: { $ref: '#/components/schemas/TronAddress' } amount: { type: integer, description: 'energy units; a USDT transfer ≈ 65 000, to an address that never held USDT ≈ 130 000' } duration_blocks: { type: integer, enum: [1000] } examples: usdt: { summary: energy for one USDT transfer, value: { address: TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf, amount: 65000 } } responses: '200': description: Delivered headers: { PAYMENT-RESPONSE: { $ref: '#/components/headers/PaymentResponse' } } content: { application/json: { schema: { $ref: '#/components/schemas/EnergyOrder' } } } '202': { $ref: '#/components/responses/Pending' } '402': { $ref: '#/components/responses/PaymentRequired' } '4XX': { $ref: '#/components/responses/Error' } '503': { $ref: '#/components/responses/Error' } /x402/v1/tron/send: post: tags: [paid] operationId: sendTx summary: Send a signed transaction with its energy included x-payment-info: { price: { mode: dynamic, currency: USD, amount: '0.45', description: 'depends on the transaction: the 402 of the real body states it; POST /x402/v1/tron/estimate is free' }, protocols: [{ x402: { version: 2, scheme: exact, network: 'eip155:8453', asset: USDC } }] } description: | We check the transaction on our node, delegate the missing energy to the sender, broadcast the transaction exactly as signed and wait for the block. Allowed: TRX transfers, TRC-20 transfers and contract calls, TRC-10. Sign with `expiration` at least 2 minutes ahead. Bandwidth is not sold yet: the sender must have its own or free bytes (else refused before payment, `BANDWIDTH_UNAVAILABLE`). If the transaction itself fails on chain after the energy was delivered, there is no refund. parameters: [{ $ref: '#/components/parameters/PaymentSignature' }] requestBody: required: true content: application/json: schema: { type: object, required: [signed_tx], properties: { signed_tx: { $ref: '#/components/schemas/TronTransaction' } } } examples: tronweb: { summary: a TronWeb-signed transaction, value: { signed_tx: { txID: '…', raw_data_hex: '0a02…', signature: ['…'] } } } responses: '200': description: In a block (`status:"confirmed"`), or accepted by the node without a block yet (`status:"broadcast"`) headers: { PAYMENT-RESPONSE: { $ref: '#/components/headers/PaymentResponse' } } content: { application/json: { schema: { $ref: '#/components/schemas/SendResult' } } } '202': { $ref: '#/components/responses/Pending' } '402': { $ref: '#/components/responses/PaymentRequired' } '4XX': { $ref: '#/components/responses/Error' } '503': { $ref: '#/components/responses/Error' } /x402/v1/proxy/pass: post: tags: [paid] operationId: buyProxyPass summary: Prepaid pass for sending through our Proxy node x-payment-info: { price: { mode: dynamic, currency: USD, min: '5', max: '100', description: 'proxy-5 / proxy-20 / proxy-100' }, protocols: [{ x402: { version: 2, scheme: exact, network: 'eip155:8453', asset: USDC } }] } description: | Broadcast as usual to `rpc_url` (`/proxy/wallet/broadcasttransaction`, `/proxy/wallet/broadcasthex`) with `Authorization: Bearer `: energy is supplied before each transaction of the bound senders and charged from the pass at the agent price. Send the request with an existing pass as Bearer to top it up. parameters: [{ $ref: '#/components/parameters/PaymentSignature' }, { $ref: '#/components/parameters/TopUp' }] requestBody: required: true content: application/json: schema: type: object required: [tier] properties: tier: { oneOf: [{ type: string, enum: [proxy-5, proxy-20, proxy-100] }, { type: number, enum: [5, 20, 100] }], description: 'tier name or its USDC price; credits = USDC micro' } senders: { type: array, maxItems: 5, items: { $ref: '#/components/schemas/TronAddress' }, description: 'up to 5; required for a new pass' } responses: '200': { $ref: '#/components/responses/Pass' } '402': { $ref: '#/components/responses/PaymentRequired' } '4XX': { $ref: '#/components/responses/Error' } /x402/v1/rpc/pass: post: tags: [paid] operationId: buyRpcPass summary: Prepaid pass for reads of our TRON full node x-payment-info: { price: { mode: dynamic, currency: USD, min: '0.5', max: '300', description: 'rpc-trial 0.5 / rpc-s 9 / rpc-m 35 / rpc-l 120 / rpc-xl 300' }, protocols: [{ x402: { version: 2, scheme: exact, network: 'eip155:8453', asset: USDC } }] } description: 'Credits per call (1 for ordinary calls, 2–10 for heavy ones). Use `rpc_url` (`/rpc`) as TronWeb `fullHost` with `TRON-PRO-API-KEY: `, or `Authorization: Bearer `.' parameters: [{ $ref: '#/components/parameters/PaymentSignature' }, { $ref: '#/components/parameters/TopUp' }] requestBody: required: true content: application/json: schema: { type: object, required: [tier], properties: { tier: { oneOf: [{ type: string, enum: [rpc-trial, rpc-s, rpc-m, rpc-l, rpc-xl] }, { type: number, enum: [0.5, 9, 35, 120, 300] }], description: 'tier name or its USDC price: rpc-trial 0.5 = 50 000 credits / 7 days / 5 rps, rpc-s 9 = 1M / 10 rps, rpc-m 35 = 5M / 25 rps, rpc-l 120 = 20M / 50 rps, rpc-xl 300 = 60M / 100 rps (30 days)' } } } responses: '200': { $ref: '#/components/responses/Pass' } '402': { $ref: '#/components/responses/PaymentRequired' } '4XX': { $ref: '#/components/responses/Error' } /x402/v1/events/sub: post: tags: [paid] operationId: buyEventsSub summary: Prepaid subscription to events of TRON addresses x-payment-info: { price: { mode: dynamic, currency: USD, min: '3', max: '60', description: 'ev-s 3 / ev-m 15 / ev-l 60' }, protocols: [{ x402: { version: 2, scheme: exact, network: 'eip155:8453', asset: USDC } }] } description: 1 credit per delivered event (webhook 2xx or a WebSocket message). Manage subscriptions at `/v1/events/subscriptions` with the token. parameters: [{ $ref: '#/components/parameters/PaymentSignature' }, { $ref: '#/components/parameters/TopUp' }] requestBody: required: true content: application/json: schema: type: object required: [tier] properties: tier: { oneOf: [{ type: string, enum: [ev-s, ev-m, ev-l] }, { type: number, enum: [3, 15, 60] }], description: 'tier name or its USDC price: ev-s 3 = 10 addresses / 3 subscriptions / 200 000 events, ev-m 15 = 100 / 10 / 2M, ev-l 60 = 1 000 / 25 / 10M (30 days)' } addresses: { type: array, items: { $ref: '#/components/schemas/TronAddress' }, description: 'optional first addresses (≤ tier limit); subscriptions are managed at events_url' } webhook_url: { type: string, format: uri, description: 'optional, https only' } responses: '200': { $ref: '#/components/responses/Pass' } '402': { $ref: '#/components/responses/PaymentRequired' } '4XX': { $ref: '#/components/responses/Error' } /x402/v1/pass: get: tags: [free] operationId: passStatus summary: Balance of a pass security: [{ pass: [] }] responses: '200': { description: Pass state, content: { application/json: { schema: { $ref: '#/components/schemas/PassBalance' } } } } '401': { $ref: '#/components/responses/Error' } /x402/v1/status: get: tags: [free] operationId: status security: [] summary: 'Connectivity: facilitator, sanctions list, capacity budget, sending, refunds' responses: '200': { description: Status, content: { application/json: { schema: { type: object, additionalProperties: true } } } } /x402/v1/payments/{payment_id}: get: tags: [free] operationId: paymentStatus security: [] summary: State of a paid order and its refund parameters: [{ name: payment_id, in: path, required: true, schema: { type: string } }] responses: '200': description: Payment content: application/json: schema: type: object properties: payment_id: { type: string } product: { type: string } status: { type: string, examples: [pending, fulfilled, refund_pending, refunded] } paid_usdc: { type: string } settle_tx: { type: string } answer: { type: object, additionalProperties: true } refund: { type: object, properties: { status: { type: string }, amount_usdc: { type: string }, tx: { type: string }, to: { type: string }, reason: { type: string } } } '404': { $ref: '#/components/responses/Error' } /rpc/wallet/{method}: post: tags: [pass] operationId: nodeWallet summary: Full node HTTP API, read methods (RPC pass) description: 'Allowed: account, block, transaction, resource and chain-parameter reads, constant calls, unsigned transaction builders. Refused: broadcast (use `tron/send` or a Proxy pass), key methods, node admin. The answer is the node''s.' security: [{ pass: [] }, { tronProApiKey: [] }] parameters: [{ name: method, in: path, required: true, schema: { type: string, examples: [getaccount, getnowblock, triggerconstantcontract] } }] requestBody: { content: { application/json: { schema: { type: object, additionalProperties: true } } } } responses: '200': { description: Node answer, content: { application/json: { schema: { type: object, additionalProperties: true } } } } '401': { description: 'pass_required / pass_unknown' } '402': { description: 'pass_expired / pass_exhausted (with `buy`: where to top up)' } '403': { description: method_not_allowed } '429': { description: 'rate_limited (Retry-After)' } /rpc/walletsolidity/{method}: post: tags: [pass] operationId: nodeSolidity summary: Confirmed state reads (RPC pass) security: [{ pass: [] }, { tronProApiKey: [] }] parameters: [{ name: method, in: path, required: true, schema: { type: string } }] responses: { '200': { description: Node answer } } /rpc/jsonrpc: post: tags: [pass] operationId: nodeJsonRpc summary: Ethereum-style JSON-RPC reads (eth_*), batches up to 20 (RPC pass) security: [{ pass: [] }, { tronProApiKey: [] }] requestBody: { content: { application/json: { schema: { type: object, additionalProperties: true } } } } responses: { '200': { description: JSON-RPC answer } } /proxy/wallet/broadcasttransaction: post: tags: [pass] operationId: proxyBroadcast summary: Broadcast through our Proxy with energy supplied from a Proxy pass description: Same body and answer as the node's `/wallet/broadcasttransaction`. A refusal comes in the node's style `{"result":false,"code":"…"}` (e.g. ADDRESS_NOT_BOUND, INSUFFICIENT_CREDITS, BANDWIDTH_UNAVAILABLE). security: [{ pass: [] }] requestBody: { content: { application/json: { schema: { $ref: '#/components/schemas/TronTransaction' } } } } responses: { '200': { description: Node answer }, '401': { description: no pass header } } /proxy/wallet/broadcasthex: post: tags: [pass] operationId: proxyBroadcastHex summary: Broadcast a hex transaction through our Proxy (Proxy pass) security: [{ pass: [] }] requestBody: { content: { application/json: { schema: { type: object, properties: { transaction: { type: string } } } } } } responses: { '200': { description: Node answer } } /v1/events/subscriptions: post: tags: [pass] operationId: createSubscription summary: Watch addresses (events pass) security: [{ pass: [] }] requestBody: content: application/json: schema: type: object properties: kind: { type: string, enum: [webhook, ws] } webhook_url: { type: string, format: uri } addresses: { type: array, maxItems: 500, items: { $ref: '#/components/schemas/TronAddress' } } types: { type: array, items: { type: string, enum: [trx.in, trx.out, trc20.in, trc20.out, delegation.in, delegation.out, undelegation.in, undelegation.out, resource.usage] } } min_finality: { type: string, enum: [head, final] } responses: '201': { description: '{subscription, secret} — the webhook secret is shown once (HMAC-SHA256 in X-TL-Signature)' } get: tags: [pass] operationId: listSubscriptions summary: Subscriptions, limits, credits left security: [{ pass: [] }] responses: { '200': { description: List } } /v1/events/ws: get: tags: [pass] operationId: eventsWebSocket summary: Live event stream (WebSocket) description: 'Pass in the Authorization header, or `?token=` from a browser. No replay: use a webhook for guaranteed delivery.' parameters: [{ name: subscription, in: query, required: true, schema: { type: string } }] responses: { '101': { description: Switching protocols } } /v1/events/types: get: tags: [free] operationId: eventTypes security: [] summary: Event types responses: { '200': { description: Types } } components: securitySchemes: pass: { type: http, scheme: bearer, description: token from proxy/pass, rpc/pass or events/sub } tronProApiKey: { type: apiKey, in: header, name: TRON-PRO-API-KEY, description: the RPC pass token (TronWeb header) } parameters: PaymentSignature: { name: PAYMENT-SIGNATURE, in: header, required: false, description: base64 JSON x402 v2 PaymentPayload (on the repeat after a 402), schema: { type: string } } TopUp: { name: Authorization, in: header, required: false, description: 'Bearer : adds credits to that pass', schema: { type: string } } headers: PaymentResponse: description: base64 JSON SettleResponse `{success, transaction, network, payer}` schema: { type: string } responses: PaymentRequired: description: | Pay and repeat. Terms in the `PAYMENT-REQUIRED` header (base64 JSON) and in the body; `X-Offer` (base64 JSON) has the order details. Also returned for an empty or incomplete body (example terms, `error` names the missing fields; paying them gives a new 402, nothing is charged). headers: { PAYMENT-REQUIRED: { description: base64 JSON PaymentRequired, schema: { type: string } } } content: { application/json: { schema: { $ref: '#/components/schemas/PaymentRequired' } } } Pending: description: Paid, still running — poll `status_url` (`/x402/v1/payments/{id}`); do not pay again content: { application/json: { schema: { type: object, properties: { status: { const: pending }, status_url: { type: string } }, additionalProperties: true } } } Pass: description: Pass issued (or topped up) headers: { PAYMENT-RESPONSE: { $ref: '#/components/headers/PaymentResponse' } } content: { application/json: { schema: { $ref: '#/components/schemas/Pass' } } } Error: description: 'Refused (before a 402 nothing is charged) or failed after payment (refunded automatically)' content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } } schemas: TronAddress: { type: string, pattern: '^T[1-9A-HJ-NP-Za-km-z]{33}$', examples: [TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t] } TronTransaction: description: 'Node JSON `{txID, raw_data, raw_data_hex, signature[]}` (TronWeb / `/wallet/createtransaction`), or the hex of the serialized Transaction' oneOf: - type: object properties: txID: { type: string } raw_data: { type: object } raw_data_hex: { type: string } signature: { type: array, items: { type: string } } visible: { type: boolean } - type: string SearchAnswer: type: object properties: query: { type: string } count: { type: integer } results: { type: array, items: { $ref: '#/components/schemas/CatalogueEntry' } } payment: type: object properties: { protocol: { type: string, examples: ['x402 v2'] }, scheme: { type: string }, network: { type: string }, asset: { type: string }, pay_to: { type: string } } note: { type: string } CatalogueEntry: type: object properties: id: { type: string, examples: [x402.energy, x402.send, x402.rpc_pass, use.rpc_pass, quote] } title: { type: object, properties: { en: { type: string }, ru: { type: string } } } description: { type: object, properties: { en: { type: string }, ru: { type: string } } } method: { type: string, examples: [POST] } path: { type: string, examples: [/x402/v1/tron/energy] } url: { type: string, format: uri } parameters: { type: object, description: JSON Schema of the request body or query } price: description: '"free", a live agent price ({kind, pricing, asset, network, energy_65000_usdc, as_of}), tiers ({tiers: [{tier, price_usdc, credits, days, limits}]}) or "charged from the pass"' oneOf: [{ type: string }, { type: object, additionalProperties: true }] payment: { type: string, enum: [free, x402, pass] } example: { type: string, description: a curl command } returns: { type: string } quote_url: { type: string, format: uri, description: 'paid routes: GET for the price and the full payment terms' } docs_url: { type: string, format: uri } openapi_url: { type: string, format: uri } tags: { type: array, items: { type: string } } score: { type: number } Quote: type: object properties: product: { type: string } energy: { type: integer } billed_units: { type: integer } duration_blocks: { type: integer, examples: [1000] } price_usdc: { type: string, examples: ['0.448500'] } amount: { type: string, description: USDC atomic units } network: { type: string, examples: ['eip155:8453'] } trx_usd: { type: number } burn_equivalent_sun: { type: integer } burn_equivalent_usd: { type: number } pricing: { type: string } valid_for_sec: { type: integer } tiers_usdc: { type: array, items: { type: string } } days: { type: integer } usage: { type: object, additionalProperties: true } x402Version: { type: integer, const: 2 } accepts: { type: array, items: { $ref: '#/components/schemas/PaymentRequirements' }, description: 'the same as in the 402' } resource: { $ref: '#/components/schemas/ResourceInfo' } payable: { type: boolean, description: 'true: stored like a 402, pay accepts[0] and POST pay.body with PAYMENT-SIGNATURE until valid_until' } quote_id: { type: string } valid_until: { type: string, format: date-time } example_terms: { type: string, description: 'when not payable: what to add' } pay: type: object properties: method: { type: string, const: POST } url: { type: string, format: uri } content_type: { type: string } body: { type: object, additionalProperties: true } header: { type: string } steps: { type: array, items: { type: string } } buy: { type: object, properties: { method: { type: string }, url: { type: string } } } EstimateAnswer: type: object properties: estimate: type: object properties: owner: { $ref: '#/components/schemas/TronAddress' } contract_type: { type: string } energy: { type: integer } would_revert: { type: boolean } revert_message: { type: string } bandwidth_bytes: { type: integer } have: { type: object, additionalProperties: { type: integer } } missing_energy: { type: integer } bandwidth_source: { type: string, enum: [staked, free, unavailable] } burn_equivalent_sun: { type: integer } energy_fee_sun_per_unit: { type: integer } cover: type: object properties: { energy: { type: integer }, price_usdc: { type: string }, buy_send: { type: string }, buy_energy: { type: string } } buyable: type: boolean description: 'Whether we would sell energy to `estimate.owner`. false = stop here: `refusal` says why and there is no `cover`. Absent when the check could not run (the purchase checks again).' address_reserved: type: boolean description: 'true when `estimate.owner` is a platform address (refusal ADDRESS_RESERVED): use another owner.' refusal: description: 'The error the quote and the purchase would return for this owner: ADDRESS_RESERVED, ADDRESS_SANCTIONED or ADDRESS_NOT_ACTIVATED.' $ref: '#/components/schemas/Error' EnergyOrder: type: object properties: status: { type: string, examples: [delivered] } address: { $ref: '#/components/schemas/TronAddress' } energy: { type: integer } expires_at: { type: string, format: date-time } payment_id: { type: string } SendResult: type: object properties: status: { type: string, enum: [confirmed, broadcast, expired, rejected] } txid: { type: string } owner: { $ref: '#/components/schemas/TronAddress' } block: { type: integer } result: { type: string, examples: [SUCCESS, REVERT, OUT_OF_ENERGY] } energy_used: { type: integer } energy_burned_sun: { type: integer } bandwidth_used: { type: integer } bandwidth_burned_sun: { type: integer } Pass: type: object properties: pass_id: { type: string } token: { type: string, examples: ['tlp_…'], description: 'send it as Authorization: Bearer ; not shown again (a replay of the same payment returns it)' } tier: { type: string, examples: [rpc-s] } unit: { type: string, enum: [credit, usdc_micro], description: 'what credits count: node/event credits, or USDC micro for Proxy' } added_credits: { type: integer } expires_at: { type: string, format: date-time } limits: { type: object, additionalProperties: true, description: 'e.g. rps, burst, max_addresses, max_subscriptions' } rpc_url: { type: string, format: uri, description: 'proxy and rpc passes' } events_url: { type: string, format: uri, description: 'events pass' } balance_url: { type: string, format: uri } PassBalance: type: object properties: pass_id: { type: string } tier: { type: string } unit: { type: string, enum: [credit, usdc_micro] } credits_left: { type: integer } spent: { type: integer } held: { type: integer, description: reserved for transactions in flight (Proxy) } paid_usdc: { type: string } expires_at: { type: string, format: date-time } limits: { type: object, additionalProperties: true } PaymentRequired: type: object required: [x402Version, accepts] properties: x402Version: { type: integer, const: 2 } error: { type: string } resource: { $ref: '#/components/schemas/ResourceInfo' } accepts: { type: array, items: { $ref: '#/components/schemas/PaymentRequirements' } } extensions: { type: object, additionalProperties: true, description: 'bazaar: input example and JSON Schema of the body' } examples: - x402Version: 2 error: PAYMENT-SIGNATURE header is required resource: { url: 'https://api.awesomefee.com/x402/v1/tron/energy', description: Delegates TRON energy to any activated TRON address for 1000 blocks …, mimeType: application/json, tags: [tron, energy, usdt, trc20, x402] } accepts: [{ scheme: exact, network: 'eip155:8453', amount: '448500', asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', payTo: '0x…', maxTimeoutSeconds: 60, extra: { name: USD Coin, version: '2' } }] ResourceInfo: type: object properties: url: { type: string, format: uri } description: { type: string, maxLength: 500 } mimeType: { type: string } serviceName: { type: string } tags: { type: array, maxItems: 5, items: { type: string } } iconUrl: { type: string, format: uri } PaymentRequirements: type: object properties: scheme: { type: string, const: exact } network: { type: string, examples: ['eip155:8453'] } amount: { type: string, description: USDC atomic units (6 decimals) } asset: { type: string, description: USDC contract on that network } payTo: { type: string } maxTimeoutSeconds: { type: integer } extra: { type: object, additionalProperties: true, description: EIP-712 domain of USDC (name, version) } Error: type: object properties: code: type: string description: | Before payment (nothing charged): 400 BAD_REQUEST, BAD_AMOUNT, DURATION_FIXED, INVALID_ADDRESS, BAD_TIER, SENDERS_REQUIRED, TOO_MANY_SENDERS, TOO_MANY_ADDRESSES, BAD_WEBHOOK, BAD_PRODUCT, INVALID_PAYMENT; 403 ADDRESS_RESERVED; 409 NO_RESOURCES_NEEDED, PAYMENT_REUSED; 422 ADDRESS_NOT_ACTIVATED, BANDWIDTH_UNAVAILABLE, BAD_TX; 429 RATE_LIMITED; 451 ADDRESS_SANCTIONED; 503 NO_CAPACITY, FACILITATOR_UNAVAILABLE, PRICE_UNAVAILABLE, NODE_UNAVAILABLE, OFAC_UNAVAILABLE, RS_UNAVAILABLE, PROXY_UNAVAILABLE (retry later). After payment: PAYMENT_REJECTED (not settled), PAYMENT_IN_PROGRESS / SETTLEMENT_PENDING (poll status), DELIVERY_FAILED / DELIVERY_TIMEOUT (refunded automatically). Passes: 401 PASS_INVALID. examples: [BAD_AMOUNT, INVALID_ADDRESS, NO_CAPACITY, RATE_LIMITED, BAD_TIER] error: { type: string, description: message } details: { type: object, additionalProperties: true } ```