Quickstart
This guide takes you from nothing to a completed Energy order. You'll need a funded account and an API key.
1. Create an account and API key
API keys are issued from the main site, not the API:
- Sign in to the homepage at https://www.hexvetron.com.
- Open the account menu (your email), choose API, then click Create API key.
- Click Send verification code, enter the code sent to your email, then create the key.
- Save the access key id and the secret — the secret is shown once.
The secret is stored encrypted; if you lose it, revoke the key and create a new one.
2. Sign a request
Every request is signed with HMAC-SHA256. The full scheme is documented in Authentication. Here is a self-contained bash example that creates a quote:
SECRET="YOUR_API_SECRET"
KEY="YOUR_ACCESS_KEY_ID"
BODY='{"amount":64400,"duration_minutes":60}'
TS=$(date +%s)
NONCE=$(openssl rand -hex 16)
BODY_HASH=$(printf '%s' "$BODY" | openssl dgst -sha256 -hex | awk '{print $2}')
CANONICAL=$(printf 'TEA1-HMAC-SHA256\nPOST\n/api/v1/energy/quotes\n\n%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")
SIGNATURE=$(printf '%s' "$CANONICAL" | openssl dgst -sha256 -hmac "$SECRET" -hex | awk '{print $2}')
curl -X POST "https://api.hexvetron.com/api/v1/energy/quotes" \
-H "content-type: application/json" \
-H "x-api-key: $KEY" \
-H "x-timestamp: $TS" \
-H "x-nonce: $NONCE" \
-H "x-body-hash: $BODY_HASH" \
-H "x-signature: $SIGNATURE" \
-d "$BODY"
The response is a quote with a quote_id and a customer_price:
{
"data": {
"quote_id": "qte_…",
"product": "TRON_ENERGY",
"amount": 64400,
"duration_minutes": 60,
"customer_price": "2.093",
"currency": "TRX",
"expires_at": "2026-09-22T12:01:00.000Z",
"target_activated": true
},
"request_id": "…"
}
3. Place an order
Create the order in one step — pass the amount, duration, target address, and an idempotency key you generate:
BODY='{"amount":64400,"duration_minutes":60,"target_address":"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE","idempotency_key":"idem-0001"}'
# sign with the same scheme (method POST, path /api/v1/energy/orders) and POST to https://api.hexvetron.com/api/v1/energy/orders
The price is resolved at order time. If you created a quote in step 2 and want to lock that exact price, apply it with POST /api/v1/energy/apply_quote_orders instead.
For duration-less energy top-ups, use the flash order endpoint
POST /api/v1/energy/flash_ordersinstead.
4. Poll until the order settles
# GET https://api.hexvetron.com/api/v1/energy/orders/<order_id> (signed)
Poll every few seconds until status is COMPLETED, FAILED, or RECONCILIATION_REQUIRED. Energy is delegated to the target address once the order completes.
