Home/Buy via API

Rent TRON Energy via API

View documentation →

Energy is the resource the TRON network consumes when a transaction runs a smart contract — most commonly a USDT (TRC-20) transfer. Call one endpoint with a target address and a volume, and we delegate Energy 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": "energy", "targetAddress": "TXYZ...4f9a", "volume": 65000, "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. Energy: 65,000–1,000,000. Bandwidth: 1,000–300,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

About 65,000 Energy if the recipient's address currently holds USDT, and about 131,000 if its USDT balance is zero (the contract has to create a new balance record). Only the recipient's current USDT balance matters — not whether the address is new or belongs to an exchange.

The order is rejected before anything is charged (402, wallet.insufficient_balance) — top up your internal TRX balance and retry with the same Idempotency-Key.

If the provider can't fulfil the order, the charge is refunded to your internal balance automatically — no manual follow-up needed.

Not yet — every order uses your real internal TRX balance. Start with the smallest volume (65,000 Energy, 15 minutes) to try the flow end-to-end at minimal cost.

The response returns immediately with status "Created". Register a webhook for order.filled (or poll the order) to know exactly when delegation completes — typically around 0.3s later.