Home/Bandwidth API

Rent TRON Bandwidth via API

View documentation

Bandwidth is the resource TRON charges for standard transfers and contract calls that don't touch smart contract storage — most commonly a plain TRX transfer. Call one endpoint with a target address and a volume, and we delegate Bandwidth to it directly.

import requests resp = requests.post( "https://trongas.ai/api/v1/orders", headers={ "X-Api-Key": "tgk_4f9a1c8e2b7d...", "Idempotency-Key": "5c1e2b6a-9e21-4b7a-8f3d-1a2b3c4d5e6f", }, json={ "resource": "bandwidth", "targetAddress": "TXYZ...4f9a", "volume": 350, "duration": "1h", }, ) print(resp.json())

Request format

Request body
resourcestring

"energy" or "bandwidth". Defaults to energy if omitted.

targetAddressstring

TRON address that receives the delegated resource.

volumeinteger

Amount to delegate. Bandwidth: 350–300,000. Energy: 65,000–1,000,000.

durationstring

"15m", "1h" or "1d".

Headers
X-Api-Key

Your API key.

Idempotency-Key

A UUID you generate. Retrying with the same key returns the original order instead of charging twice.

Response body
id

Order id.

status

"Created" at first, then "Filled" once delegated (or "Failed"). Subscribe to the order.filled webhook to know the moment it lands.

priceTrx / activationTrx / totalTrx

Charge in TRX. activationTrx is only non-zero when the target address is receiving TRX for the first time.

txId

Delegation transaction hash, populated once the order is filled.

From zero to your first request

01
Sign up
Create a free TronGasAi account.
02
Get your API key
Issue a scoped key from the dashboard.
03
Send a test request
Call POST /orders with your key.
04
Connect it to your project
Wire the same call into your app or service.

Frequently asked questions