Skip to main content

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 *_trx string 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 returns 404 not_found, never 403.

Endpoints

MethodPathReference
POST/subscriptionsSubscribe
GET/subscriptionsList subscriptions
GET/subscriptions/{address}Get subscription
PATCH/subscriptions/{address}Update settings
POST/subscriptions/{address}/reactivateReactivate
POST/subscriptions/{address}/closeClose
DELETE/subscriptions/{address}Delete
GET/subscriptions/{address}/usageList usage
GET/subscriptions/{address}/billingList billing
GET/pricingGet pricing

Error slugs

Errors return the HTTP status with a body of the form {"detail": {"error": <slug>, "message": …}}:

Statuserror slugMeaning
422invalid_addressThe address is malformed.
409address_busyThe address already has a live subscription.
409address_existsYou already have a closed subscription on it — reactivate or delete first.
409not_reactivatableOnly a closed subscription can be reactivated.
409not_deletableOnly a closed subscription can be deleted.
404not_foundNo such subscription for your account.
400insufficient_balanceBalance can't cover the required amount.
400plan_not_foundThe referenced plan doesn't exist.
502fulfiller_unavailableEnergy 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.