Tronergydocs

Balance

Read your prepaid balance, history and usage, get a deposit address, set alerts and withdraw.

Your balance is prepaid TRX that pays for relays. There is one per chain and environment; sandbox and live are separate. See Billing.

Amounts on this page are integer strings in sun: "25000000" is 25 TRX. Divide by 10 ^ currencyPrecision (6 for TRX) to display them.

Get your balance

The simplest way to read your balance. Returns TRX, not sun, as exact decimal strings: "125.5" is 125.5 TRX.

GET/api/gas_tank/portal/balance
curl "https://apiv2.tronergy.io/api/gas_tank/portal/balance?chain=tron&environment=live" \
  -H "x-api-key: $TRONERGY_API_KEY"
Parameters
chainstringquery

Always tron. Defaults to tron.

environment"sandbox" | "live"query

sandbox or live. Defaults to live.

Response
{
  "ok": true,
  "chain": "tron",
  "environment": "live",
  "currency": "TRX",
  "available": "125.5",
  "inflight": "2.95",
  "total": "128.45"
}

available is what you can spend now. inflight is held for relays still running. total is both. Before your first deposit all three are "0".

Get a deposit address

Returns your personal deposit address and creates it on the first call. Send TRX to it to top up. The address does not change.

GET/api/payment_gateways/portal/deposit
curl "https://apiv2.tronergy.io/api/payment_gateways/portal/deposit?chain=tron&environment=live" \
  -H "x-api-key: $TRONERGY_API_KEY"
Parameters
chainstringrequiredquery

Always tron.

environment"sandbox" | "live"query

sandbox or live. Defaults to sandbox.

Response
{
  "ok": true,
  "payment": {
    "depositAddress": "TDepositAddress...",
    "chain": "tron",
    "environment": "live",
    "token": "TRX",
    "amount": "1000000",
    "status": "requires_action",
    "checkpoint": "awaiting_transfer"
  }
}

token is what to send and amount is the minimum deposit. Deposit progress shows up in List transactions.

GET /api/gas_tank/portal/deposit-address with the same query returns { ok, address, chain, environment } for an address that already exists, and 404 if there is none yet. It never creates one.

List balances

Returns your active balance accounts.

GET/api/gas_tank/portal/accounts
curl "https://apiv2.tronergy.io/api/gas_tank/portal/accounts" \
  -H "x-api-key: $TRONERGY_API_KEY"
Response
{
  "ok": true,
  "accounts": [
    {
      "id": "f3a1...",
      "chain": "tron",
      "environment": "live",
      "status": "active",
      "balance": { "available": "125000000", "inflight": "2950000" },
      "currency": "TRX",
      "currencyPrecision": 6
    }
  ]
}

available is what you can spend now. inflight is held for relays still running.

Balance stats

Totals across your accounts.

GET/api/gas_tank/portal/stats
curl "https://apiv2.tronergy.io/api/gas_tank/portal/stats?environment=live" \
  -H "x-api-key: $TRONERGY_API_KEY"
Parameters
environment"sandbox" | "live"query

sandbox or live. Leave out to add up both.

Response
{
  "ok": true,
  "totalDeposited": "127950000",
  "totalAvailable": "125000000",
  "totalInflight": "2950000",
  "totalConsumedThisMonth": "61000000",
  "activeAccounts": 1,
  "pendingDeposits": 0,
  "byChain": [
    { "chain": "tron", "available": "125000000", "inflight": "2950000", "deposited": "127950000", "currency": "TRX", "currencyPrecision": 6 }
  ]
}

totalDeposited is your current balance including held amounts (totalAvailable + totalInflight), not a lifetime total. totalConsumedThisMonth counts relay charges from 00:00 UTC on the 1st; withdrawals and refunded deposits are not counted. pendingDeposits is how many of your deposits are seen but not yet credited, in the given environment or in both when it is left out.

List transactions

Deposits, relay charges, withdrawals and refunded deposits, newest first.

GET/api/gas_tank/portal/transactions
curl "https://apiv2.tronergy.io/api/gas_tank/portal/transactions?page=1&pageSize=20&direction=deposit&environment=live" \
  -H "x-api-key: $TRONERGY_API_KEY"
Parameters
pagenumberquery

Page number. Defaults to 1.

pageSizenumberquery

Items per page. Default 20, max 100.

direction"deposit" | "usage" | "withdrawal" | "refund"query

deposit (deposits and sandbox credits), usage (relay charges), withdrawal or refund (a deposit taken back after the payment was refunded).

status"posted" | "inflight" | "committed" | "void"query

inflight is a hold for a running relay, committed and posted are final, void is a released hold.

environment"sandbox" | "live"query

sandbox or live.

sortDir"asc" | "desc"query

Sort by date. Defaults to desc.

format"json" | "csv"query

csv downloads a file. Defaults to json.

Response
{
  "ok": true,
  "items": [
    {
      "id": "...",
      "direction": "deposit",
      "amount": "100000000",
      "currency": "TRX",
      "precision": 6,
      "status": "posted",
      "chain": "tron",
      "environment": "live",
      "txHash": "ab12...",
      "explorerUrl": "https://tronscan.org/#/transaction/ab12...",
      "createdAt": "2026-10-20T08:00:00.000Z"
    }
  ],
  "incoming": [],
  "total": 1,
  "page": 1,
  "pageSize": 20,
  "totalPages": 1
}

incoming lists up to 12 deposits seen on chain but not yet credited, with confirmations, confirmationsRequired and a checkpoint (awaiting_transfer, chain_seen, confirming or finalizing). It is filled only on page 1, and only when direction is left out or deposit and status is left out or inflight.

Usage

Relay spend for a period.

GET/api/gas_tank/portal/usage
curl "https://apiv2.tronergy.io/api/gas_tank/portal/usage?period=month&environment=live" \
  -H "x-api-key: $TRONERGY_API_KEY"
Parameters
period"month" | "week"query

month (from 00:00 UTC on the 1st through now) or week (from 00:00 UTC seven days ago through now, so up to eight calendar days). Defaults to month.

environment"sandbox" | "live"query

sandbox or live.

Response
{
  "ok": true,
  "totalConsumed": "61000000",
  "totalRelays": 21,
  "avgCostPerRelay": "2904761",
  "byChain": [
    { "chain": "tron", "totalConsumed": "61000000", "relayCount": 21, "avgCostPerRelay": "2904761", "currency": "TRX", "currencyPrecision": 6 }
  ],
  "periodStart": "2026-10-01T00:00:00.000Z",
  "periodEnd": "2026-10-21T10:00:00.000Z",
  "networkBurnRateSun": 420
}

networkBurnRateSun is a fixed reference price (sun per energy unit) for comparing your cost with burning TRX.

Balance alerts

Read the low-balance and budget alerts that apply to you for one account: your own settings if you saved any, otherwise your organization's settings, otherwise the defaults shown below. id is an account id from List balances. Reading and changing alerts both need the portal.gas_tank.manage_alerts permission.

GET/api/gas_tank/portal/accounts/:id/alerts
curl "https://apiv2.tronergy.io/api/gas_tank/portal/accounts/f3a1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/alerts" \
  -H "x-api-key: $TRONERGY_API_KEY"
Parameters
idstringrequiredpath

Balance account ID.

Response
{
  "ok": true,
  "config": {
    "gasTankAccountId": "f3a1...",
    "lowBalanceEnabled": false,
    "lowBalanceThreshold": null,
    "budgetCapEnabled": false,
    "budgetCapAmount": null,
    "budgetWarnPercent": 80
  }
}

Change alerts. Only the fields you send change. Dashboard session only, so a leaked key cannot lift your budget cap.

Portal session only — API keys get 403 SESSION_REQUIRED.
PUT/api/gas_tank/portal/accounts/:id/alerts
curl -X PUT "https://apiv2.tronergy.io/api/gas_tank/portal/accounts/f3a1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d/alerts" \
  -H "Cookie: <portal-session-cookie>" \
  -H "Content-Type: application/json" \
  -d '{
    "lowBalanceEnabled": true,
    "lowBalanceThreshold": "50000000"
  }'
Parameters
idstringrequiredpath

Balance account ID.

lowBalanceEnabledboolean

Alert when the available balance drops below the threshold.

lowBalanceThresholdstring

Threshold in sun, digits only.

budgetCapEnabledboolean

Turn on a monthly spending cap. Has no effect until budgetCapAmount is set.

budgetCapAmountstring

Monthly cap in sun, digits only.

budgetWarnPercentnumber

Warn when this share of the cap is used. Whole number 1-99. Default 80.

With the cap on, a relay that would go over it ends failed with errorCode: "BUDGET_CAP_EXCEEDED". The cap month starts on the 1st at 00:00 UTC.

Withdraw

Sends unused balance to a TRON address. Dashboard session only, so a leaked key cannot move your balance out. Limit: 25 per hour.

Portal session only — API keys get 403 SESSION_REQUIRED.
POST/api/gas_tank/portal/withdraw
curl -X POST "https://apiv2.tronergy.io/api/gas_tank/portal/withdraw" \
  -H "Cookie: <portal-session-cookie>" \
  -H "Content-Type: application/json" \
  -d '{
    "chain": "tron",
    "amount": "10000000",
    "destinationAddress": "TDestinationxxxxxxxxxxxxxxxxxxxxxx",
    "environment": "live",
    "idempotencyKey": "9c4e2b1a-6d3f-4a8e-b7c5-1f0e2d3c4b5a"
  }'
Parameters
chainstringrequired

Always tron.

amountstringrequired

Amount in sun, positive integer string. Minimum 1000000 (1 TRX), maximum 100000000000 (100,000 TRX).

destinationAddressstringrequired

TRON address with a valid checksum.

environment"sandbox" | "live"

sandbox or live. Defaults to sandbox.

idempotencyKeystringrequired

A UUID per withdrawal. Resending it with the same amount and address returns the same withdrawal.

Response (202)
{ "ok": true, "status": "processing", "holdId": "2b7f..." }

Errors:

  • 422 Validation failed: the body is wrong, for example the address is not a TRON address.
  • 422 Invalid TRON destination address: the address looks right but its checksum is wrong.
  • 422 Minimum withdrawal amount is 1000000: send at least 1 TRX.
  • 422 Maximum single withdrawal exceeded: send at most 100,000 TRX at a time.
  • 422 Insufficient balance for withdrawal.
  • 409: the idempotencyKey belongs to a cancelled withdrawal, or was already used for a different amount, address or user.
  • 429: more than 25 withdrawals in an hour.

Get a withdrawal

Returns the payout for a withdrawal, or null if it has not been created yet. status is pending, processing, completed, failed, canceled or returned.

GET/api/gas_tank/portal/withdraw
curl "https://apiv2.tronergy.io/api/gas_tank/portal/withdraw?holdId=2b7f3c1d-8e9a-4b5c-a6d7-0e1f2a3b4c5d" \
  -H "x-api-key: $TRONERGY_API_KEY"
Parameters
holdIdstringrequiredquery

holdId from the withdraw response.

Response
{ "ok": true, "payout": { "payoutId": "7a1c...", "status": "completed", "holdId": "2b7f...", "txHash": "ab12..." } }