model THENERGY APIformat REST · JSONRU · EN · 中文← home

API Documentation

Rent TRON energy for your Telegram-bot balance
Energy lives for 60 minutes after delegation.

01 — start

  1. Get a key in the bot: the 🔑 API button → “Create key”. A trn_… string is shown once — copy it right away.
  2. Sign requests with the X-API-Key: trn_… or Authorization: Bearer trn_… header.

Payment comes from the bot balance. Limit: 30 requests per minute per key.

02 — endpoints

POST/v1/energy/rent

Rent energy to an address.

FieldWhat to send
addressTRON recipient address, starts with T, 34 chars
energyOnly 65000 · 66000 · 131000. Price: 100 / 110 / 200 RUB
client_keyOptional. Your order tag: repeating a request with the same tag returns the already created order instead of a new charge. Safe to press “retry”

Success — 200. Example response:

{"order_id": "7514cf6659a8ff19fe8105d63a8c994e",
  "address": "T...",
  "energy": 65000,
  "cost": 100,
  "balance": 400.0}
GET/v1/balance

Bot balance bound to the key. The “is the key working?” check lives here too.

{"user_id": 123456,
  "balance": 1240.5}
GET/v1/orders?limit=20

Recent orders, from 1 to 100.

{"orders": [
    {"order_id": "7514cf6659a8ff19fe8105d63a8c994e",
     "energy": 65000,
     "cost": 100,
     "date": "2026-10-09T12:00:00",
     "source": "api"}
  ]}
GET/v1/prices

Plans and prices.

{"currency": "RUB",
  "duration": "1h",
  "prices": [
    {"energy": 65000, "cost": 100},
    {"energy": 66000, "cost": 110},
    {"energy": 131000, "cost": 200}
  ]}

03 — errors

CodeWhat happened and what to do
401Key missing or foreign. Check the whole header — surrounding spaces count too
402Insufficient balance. The response carries need and balance — top up the difference in the bot
403Key revoked, request from a foreign IP, or user banned
422Unknown plan, malformed address, or address not activated on TRON
429Limit hit. Wait a minute
502Failed to send energy. No charge — retry later with the same client_key

04 — console

Sends live requests to ….

05 — examples

curl — rent:

curl -X POST https://api.thenergy.xyz/v1/energy/rent   -H "X-API-Key: trn_..." -H "Content-Type: application/json"   -d '{"address":"T...","energy":65000,"client_key":"order-1"}'

Python:

import requests

BASE = "https://api.thenergy.xyz"
HEADERS = {"X-API-Key": "trn_..."}  # key from the bot: API button

# balance
print(requests.get(BASE + "/v1/balance", headers=HEADERS).json())

# rent energy
payload = {
    "address": "T...",
    "energy": 65000,
    "client_key": "order-1",  # optional field
}
r = requests.post(BASE + "/v1/energy/rent", headers=HEADERS, json=payload)
print(r.status_code, r.json())