AutoEnergy API
Every AutoEnergy operation the workspace exposes is also available over REST. The complete, interactive endpoint reference — request/response schemas, parameters, and a "Try it" console — lives in the API Methods → AutoEnergy section:
→ Open the AutoEnergy API reference
Basics
- Base path:
https://tronagg.ai/api/v1/autoenergy - Auth: header
X-API-Key: <your key>— the same key as the rest of the programmatic API. Create one from the workspace. - Money: amounts are in SUN (
1 TRX = 1,000,000 SUN); responses also include*_trxstring fields for display. - Scoping: every by-address route resolves the subscription by
(your user, address). An address you don't own is indistinguishable from a missing one — it returns404 not_found, never403.
Endpoints
| Method | Path | Reference |
|---|---|---|
POST | /subscriptions | Subscribe |
GET | /subscriptions | List subscriptions |
GET | /subscriptions/{address} | Get subscription |
PATCH | /subscriptions/{address} | Update settings |
POST | /subscriptions/{address}/reactivate | Reactivate |
POST | /subscriptions/{address}/close | Close |
DELETE | /subscriptions/{address} | Delete |
GET | /subscriptions/{address}/usage | List usage |
GET | /subscriptions/{address}/billing | List billing |
GET | /pricing | Get pricing |
Error slugs
Errors return the HTTP status with a body of the form {"detail": {"error": <slug>, "message": …}}:
| Status | error slug | Meaning |
|---|---|---|
422 | invalid_address | The address is malformed. |
409 | address_busy | The address already has a live subscription. |
409 | address_exists | You already have a closed subscription on it — reactivate or delete first. |
409 | not_reactivatable | Only a closed subscription can be reactivated. |
409 | not_deletable | Only a closed subscription can be deleted. |
404 | not_found | No such subscription for your account. |
400 | insufficient_balance | Balance can't cover the required amount. |
400 | plan_not_found | The referenced plan doesn't exist. |
502 | fulfiller_unavailable | Energy delegation couldn't be activated/resumed right now — retry shortly. |
For the full request/response detail of each endpoint, use the API Methods → AutoEnergy reference.