How to Buy TRON Bandwidth via API — Bandwidth Rental Guide (2026)

Alex Goldsmith
Author & Researcher
12 articles
Paste this into Claude Code or Cursor — buy energy & bandwidth

Connect TronRental via its REST API and buy TRON resources — energy and/or bandwidth — for me.

Copy this prompt and paste it into Claude Code, Cursor, or any AI tool. The AI registers an account, creates an API key, shows the deposit address, and buys energy or bandwidth via the REST API — no manual setup.

Permanent setup: MCP server

1. Copy the command:

2. Run it in your terminal — Claude Code will pick up the server. (Cursor / Windsurf: add npx -y @tronrental-com/mcp-server to mcp.json.)

Once connected, the assistant gets direct access to TronRental: it registers an account, generates an API key, shows the deposit address, and buys energy or bandwidth — all in plain text: "Buy 350 bandwidth for address T...".

Learn more about MCP →

Below — for those who want to understand the details and build the integration manually.

Why rent bandwidth?

Every TRON transaction consumes bandwidth. Each activated address gets 600 free bandwidth per day — but that runs out fast:

  • 600 free bandwidth/day = about 1 USDT (TRC-20) transfer — then it's gone
  • Out of free bandwidth → the network burns ~0.35 TRX per transaction in its place

Renting bandwidth via API costs ~0.34 TRX for 350 units (one transfer). For services doing many transfers per day from one address, renting is cheaper and predictable.

Bandwidth is the cheap resource — but at scale (mass payouts, exchanges, bots) the burned TRX adds up. Rent it the same way you rent energy.

What you'll need

  • Account at tronrental.com
  • API key (Dashboard → API → Create Key)
  • TRX on your balance (Dashboard → Deposit)
  • 5 minutes

Quick start: first purchase in 3 steps

Step 1 — Check the price

curl https://api.tronrental.com/v1/bandwidth/prices
{
  "price_sun_1h": 400,
  "price_sun_1d": 630,
  "min_volume": 350,
  "max_volume": 100000,
  "fixed_fee_trx": "0.2"
}

price_sun_1h is the price per bandwidth unit for a 1-hour rental; price_sun_1d for a 1-day rental. min_volume / max_volume bound a single order, fixed_fee_trx is added on top.

Step 2 — Buy bandwidth

curl -X POST https://api.tronrental.com/v1/bandwidth/buy \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target_address": "TRecipient...", "volume": 350, "duration": "1h"}'
{
  "id": 1842,
  "status": "pending",
  "volume": 350,
  "price_trx": "0.34",
  "target_address": "TRecipient..."
}

Bandwidth is delegated to target_address — this can be your own address or someone else's. 350 units covers one standard USDT transfer.

Step 3 — Confirm the order

curl https://api.tronrental.com/v1/orders/1842 \
  -H "X-API-Key: YOUR_API_KEY"
{
  "id": 1842,
  "status": "filled",
  "volume": 350,
  "txid": "a1b2c3..."
}

When status becomes "filled" — bandwidth has been delegated. You can now send your transaction.

Same thing in Python

import httpx

API_KEY = "your_api_key"
BASE = "https://api.tronrental.com/v1"
HEADERS = {"X-API-Key": API_KEY}

async def buy_bandwidth(target_address: str, amount: int = 350) -> dict:
    async with httpx.AsyncClient() as client:
        resp = await client.post(
            f"{BASE}/bandwidth/buy",
            headers=HEADERS,
            json={"target_address": target_address, "volume": amount, "duration": "1h"},
        )
        resp.raise_for_status()
        return resp.json()

Same thing in JavaScript

const API_KEY = "your_api_key";
const BASE = "https://api.tronrental.com/v1";

async function buyBandwidth(targetAddress, amount = 350) {
  const resp = await fetch(`${BASE}/bandwidth/buy`, {
    method: "POST",
    headers: {
      "X-API-Key": API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      target_address: targetAddress,
      volume: amount,
      duration: "1h",
    }),
  });
  if (!resp.ok) throw new Error(`API error: ${resp.status}`);
  return resp.json();
}

How much bandwidth to buy?

ScenarioBandwidthWhy
One USDT transfer350Standard TRC-20 transfer size
Several transfers from one address350 × NFree 600/day only covers the first transfer

Not sure how much free bandwidth is left? Check before buying:

curl "https://api.tronrental.com/v1/tools/address-info?address=TRecipient..."
{
  "bandwidth_used": 0,
  "bandwidth_limit": 600,
  "is_activated": true
}

Limits: minimum 350 bandwidth per order, maximum 100,000. Durations: "1h" and "1d".

Renting energy

Bandwidth covers the transaction itself, but a USDT (TRC-20) transfer also needs energy — and that's where the real cost is. Without energy the network burns 6.43–13.28 TRX per transfer.

If you send USDT, you almost always want energy too. Renting it costs ~1.80 TRX for 65K instead of burning 6.43 TRX.

Purchase

curl -X POST https://api.tronrental.com/v1/energy/buy \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target_address": "TRecipient...", "volume": 65000, "duration": "1h"}'

65,000 energy = 1 USDT transfer (recipient already holds USDT), 131,000 if the recipient has never held USDT. See the dedicated energy API guide for details.

Full example: buy bandwidth → send transaction

Real-world pattern — buy bandwidth for the sender address, wait for delegation, then send the transaction:

import asyncio
import httpx

API_KEY = "your_api_key"
BASE = "https://api.tronrental.com/v1"
HEADERS = {"X-API-Key": API_KEY}


async def buy_bandwidth_and_wait(target: str, amount: int = 350) -> str:
    async with httpx.AsyncClient() as client:
        resp = await client.post(
            f"{BASE}/bandwidth/buy",
            headers=HEADERS,
            json={"target_address": target, "volume": amount, "duration": "1h"},
        )
        data = resp.json()

        if resp.status_code == 400:
            raise Exception(f"Purchase failed: {data.get('detail', data)}")
        resp.raise_for_status()

        order_id = data["id"]

        for _ in range(10):
            await asyncio.sleep(3)
            check = await client.get(f"{BASE}/orders/{order_id}", headers=HEADERS)
            order = check.json()
            if order["status"] == "filled":
                return order["txid"]

        raise TimeoutError(f"Order {order_id} not filled after 30s")


async def send_usdt_with_resources(sender: str, recipient: str, amount_usdt: float):
    bw_tx = await buy_bandwidth_and_wait(sender, amount=350)
    print(f"Bandwidth delegated: {bw_tx}")
    # ... your USDT transfer logic here (tronpy, tronweb, etc.)

Error handling

HTTP statusWhat it meansWhat to do
400Bad request (invalid address, insufficient balance)Read the error message, fix and retry
429Rate limit exceeded (100 req/min)Wait and retry with backoff
5xxServer errorRetry with exponential backoff

FAQ

How fast is bandwidth delegated?

Usually 3–5 seconds. Bandwidth is delegated on-chain in the next block.

Do I even need to buy bandwidth? Isn't it free?

Each address gets 600 free bandwidth per day — enough for ~1 USDT transfer. If you transfer more than that from one address daily, the network burns TRX for bandwidth, and renting is cheaper.

Bandwidth or energy — what do I need for a USDT transfer?

Both. Bandwidth covers the transaction record (~350 units); energy covers the smart-contract execution (65,000 units). Energy is the expensive one — most users rent both.

Can I buy bandwidth for someone else's address?

Yes. Set target_address to any valid TRON address. You don't need to own it.

Where are the full docs?

docs.tronrental.com — all endpoints, request/response schemas, webhook setup, and more.

Share:

Was this helpful?