Skip to content
LoginSign up

EnergyTRX API

REST API for the EnergyTRX TRON energy resale platform. Buy energy, manage Smart Energy subscriptions, list transactions, and integrate with your own scripts and bots.

OpenAPI 3.1JSONBearer authHMAC-signed writes
Base URL: https://energy-trx.com/api/v1 · openapi.json

Quickstart

  1. Sign in at /dashboard and create an API key on the API keys page.
  2. Save the full key (ek_live_…) and secret (sk_live_…) shown once at creation.
  3. Call the API with a Bearer token:
bash
curl -H "Authorization: Bearer ek_live_…" \
  https://energy-trx.com/api/v1/prices

Public endpoints (e.g. /prices) don't need auth. Read endpoints need the Bearer token. Write endpoints additionally need an HMAC signature — see Authentication.

Authentication

API key

Every request carries Authorization: Bearer ek_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. Keys can be revoked at any time from the dashboard — revocation is immediate.

HMAC signing (writes only)

For POST, PATCH, and DELETE requests, include two extra headers:

  • X-Timestamp — current unix timestamp in seconds. Requests older than 5 minutes are rejected.
  • X-Signature — hex HMAC-SHA256 of ${timestamp}.${body} using your secret as the key.
bash
ts=$(date +%s)
body='{"target_address":"T...","energy_amount":65000}'
sig=$(printf "%s.%s" "$ts" "$body" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')

curl -X POST \
  -H "Authorization: Bearer $KEY" \
  -H "X-Timestamp: $ts" \
  -H "X-Signature: $sig" \
  -H "Content-Type: application/json" \
  -d "$body" https://energy-trx.com/api/v1/orders

Rate limits

API-key callers are limited to 180 requests / 60 seconds per key. Every response includes:

  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset (unix seconds)

On 429 a Retry-After header tells you exactly how many seconds to wait before retrying.

Errors

Every error response shares one shape:

json
{
  "error": { "code": "RESOURCE_NOT_FOUND", "message": "Order not found." },
  "meta":  { "request_id": "ab12cd34ef56gh78" }
}
CodeHTTPMeaning
AUTH_REQUIRED401No credentials supplied.
INVALID_API_KEY401Key not found, revoked, or expired.
INVALID_SIGNATURE401HMAC mismatch or missing signature headers on a write.
TIMESTAMP_INVALID401X-Timestamp outside the 5-minute skew window.
RATE_LIMIT_EXCEEDED429Per-key rate limit hit.
INVALID_REQUEST400Validation failed — see `details`.
INSUFFICIENT_BALANCE402Not enough TRX for this operation.
RESOURCE_NOT_FOUND404The requested resource doesn't exist or isn't yours.
RESOURCE_CONFLICT409Conflicting state — e.g. cancelling a non-pending order.
SERVICE_UNAVAILABLE503Upstream temporarily down. Safe to retry.
INTERNAL_ERROR500Unexpected server error. Cite the `request_id` if reporting.

Webhooks (preview)

Webhook subscription endpoints are not yet live — the event emission points are wired in the server though, so the public contract below is stable. Phase 3b will land /api/v1/webhooks + delivery.

Events you'll be able to subscribe to:

order.createdorder.completedorder.failedorder.cancelledorder.expireddeposit.receivedsmart_energy.activatedsmart_energy.pausedsmart_energy.resumedsmart_energy.topped_upsmart_energy.depleted

Each delivery will carry an HMAC signature in X-Energytrx-Signature so receivers can verify authenticity. The body shape will match { id, event, user_id, created, data }.

Endpoint reference

Auto-generated from the OpenAPI spec. All paths are relative to https://energy-trx.com/api/v1.

GET/pricesPublic

Get current energy prices

Public endpoint — no authentication required. Returns live per-package pricing in TRX.

curl https://energy-trx.com/api/v1/prices

Response

200 Current pricing
json
{
  "data": {
    "currency": "TRX",
    "price_per_package_trx": 3.14,
    "package_units": 65000,
    "min_order_units": 65000,
    "max_order_units": 1000000,
    "default_duration_hours": 1,
    "enabled_packages": [
      65000,
      131000,
      650000,
      1000000
    ],
    "quotes": {
      "65000": 3.14,
      "131000": 6.28,
      "650000": 31.4,
      "1000000": 48.3
    },
    "updated_at": "2026-05-27T10:00:00.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}
GET/account

Get the authenticated user's account

Returns the caller's profile, balances, and deposit address.

curl -H "Authorization: Bearer $KEY" https://energy-trx.com/api/v1/account

Response

200 Account info
json
{
  "data": {
    "user_id": "clu0a1b2c3d4e5f6g7h8i9",
    "email": "[email protected]",
    "balance_trx": "1234.567890",
    "balance_usdt": "456.78",
    "deposit_address": "TXyZabc1234567890ABCDEF",
    "deposit_network": "TRC-20",
    "created_at": "2026-04-15T09:30:00.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
GET/orders

List your orders

Paginated list, newest first. Optional `status` filter accepts any OrderStatus.

curl -H "Authorization: Bearer $KEY" https://energy-trx.com/api/v1/orders?page=1&per_page=50&status=completed

Parameters

NameInTypeRequiredDescription
pagequeryintegerno
Page number, 1-indexed.
e.g. 1
per_pagequeryintegerno
Page size (max 100).
e.g. 50
statusquerystringno
Filter to one status value (e.g. `pending`).
e.g. completed

Response

200 Paginated orders
json
{
  "data": [
    {
      "id": "clord1234567890",
      "status": "completed",
      "energy_amount": "65000",
      "duration_hours": 1,
      "target_address": "TXyZrecipient1234567890ABCDEF",
      "cost_trx": "3.140000",
      "tx_id": "2c1d3e9b...",
      "created_at": "2026-05-27T10:15:22.000Z",
      "updated_at": "2026-05-27T10:16:01.000Z",
      "expires_at": "2026-05-27T11:15:22.000Z"
    }
  ],
  "meta": {
    "request_id": "ab12cd34ef56gh78",
    "page": 1,
    "per_page": 50,
    "total": 1,
    "has_more": false
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
POST/orders

Create an Energy Transfer order

Delegates energy to `target_address` for 1 hour. Debits `cost_trx` from your TRX balance.

# HMAC-signed write
ts=$(date +%s)
body='{ "target_address": "TXyZrecipient1234567890ABCDEF", "energy_amount": 65000 }'
sig=$(printf "%s.%s" "$ts" "$body" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')

curl -X POST \
  -H "Authorization: Bearer $KEY" \
  -H "X-Timestamp: $ts" \
  -H "X-Signature: $sig" \
  -H "Content-Type: application/json" \
  -d "$body" \
  https://energy-trx.com/api/v1/orders

Request body

Content-Type: application/json

json
{
  "target_address": "TXyZrecipient1234567890ABCDEF",
  "energy_amount": 65000
}

Response

201 Order created
json
{
  "data": {
    "id": "clord1234567890",
    "status": "completed",
    "energy_amount": "65000",
    "duration_hours": 1,
    "target_address": "TXyZrecipient1234567890ABCDEF",
    "cost_trx": "3.140000",
    "tx_id": "2c1d3e9b...",
    "created_at": "2026-05-27T10:15:22.000Z",
    "updated_at": "2026-05-27T10:16:01.000Z",
    "expires_at": "2026-05-27T11:15:22.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}

Errors

StatusDescription
400INVALID_REQUEST
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
402INSUFFICIENT_BALANCE
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
GET/orders/{id}

Get an order

Single-order lookup scoped to the caller.

curl -H "Authorization: Bearer $KEY" https://energy-trx.com/api/v1/orders/clord1234567890

Parameters

NameInTypeRequiredDescription
idpathstringyes
Order id.
e.g. clord1234567890

Response

200 Order
json
{
  "data": {
    "id": "clord1234567890",
    "status": "completed",
    "energy_amount": "65000",
    "duration_hours": 1,
    "target_address": "TXyZrecipient1234567890ABCDEF",
    "cost_trx": "3.140000",
    "tx_id": "2c1d3e9b...",
    "created_at": "2026-05-27T10:15:22.000Z",
    "updated_at": "2026-05-27T10:16:01.000Z",
    "expires_at": "2026-05-27T11:15:22.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
404RESOURCE_NOT_FOUND
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
POST/orders/{id}/cancel

Cancel a pending order

Refunds the order cost to your TRX balance. Only orders in `pending` status can be cancelled.

# HMAC-signed write
ts=$(date +%s)
body=''
sig=$(printf "%s.%s" "$ts" "$body" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')

curl -X POST \
  -H "Authorization: Bearer $KEY" \
  -H "X-Timestamp: $ts" \
  -H "X-Signature: $sig" \
  -H "Content-Type: application/json" \
  -d "$body" \
  https://energy-trx.com/api/v1/orders/clord1234567890/cancel

Parameters

NameInTypeRequiredDescription
idpathstringyes
Order id.
e.g. clord1234567890

Response

200 Order cancelled
json
{
  "data": {
    "id": "clord1234567890",
    "status": "completed",
    "energy_amount": "65000",
    "duration_hours": 1,
    "target_address": "TXyZrecipient1234567890ABCDEF",
    "cost_trx": "3.140000",
    "tx_id": "2c1d3e9b...",
    "created_at": "2026-05-27T10:15:22.000Z",
    "updated_at": "2026-05-27T10:16:01.000Z",
    "expires_at": "2026-05-27T11:15:22.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
404RESOURCE_NOT_FOUND
409RESOURCE_CONFLICT — order is not pending
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
GET/smart-energy

List Smart Energy subscriptions

Your active subscriptions. Pass `include_deleted=1` to include soft-deleted rows.

curl -H "Authorization: Bearer $KEY" https://energy-trx.com/api/v1/smart-energy?include_deleted=0

Parameters

NameInTypeRequiredDescription
include_deletedquerystringno
Include soft-deleted subs.
e.g. 0

Response

200 Array of subscriptions
json
{
  "data": [
    {
      "id": "clsmart1234567890",
      "address": "TXyZrecipient1234567890ABCDEF",
      "product_slug": "smart-delegation-65k",
      "product_name": "Smart Energy 65k",
      "status": "active",
      "balance_trx": "100.000000",
      "total_delegations": 42,
      "deleted_at": null,
      "refund_amount_trx": null,
      "created_at": "2026-05-20T08:00:00.000Z"
    }
  ],
  "meta": {
    "request_id": "ab12cd34ef56gh78",
    "count": 1
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
POST/smart-energy

Create a Smart Energy subscription

Locks `top_up_trx` from your balance and auto-delivers energy to `address` whenever it needs it.

# HMAC-signed write
ts=$(date +%s)
body='{ "address": "TXyZrecipient1234567890ABCDEF", "top_up_trx": 100, "product_slug": "smart-delegation-65k" }'
sig=$(printf "%s.%s" "$ts" "$body" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')

curl -X POST \
  -H "Authorization: Bearer $KEY" \
  -H "X-Timestamp: $ts" \
  -H "X-Signature: $sig" \
  -H "Content-Type: application/json" \
  -d "$body" \
  https://energy-trx.com/api/v1/smart-energy

Request body

Content-Type: application/json

json
{
  "address": "TXyZrecipient1234567890ABCDEF",
  "top_up_trx": 100,
  "product_slug": "smart-delegation-65k"
}

Response

201 Subscription created
json
{
  "data": {
    "id": "clsmart1234567890",
    "address": "TXyZrecipient1234567890ABCDEF",
    "product_slug": "smart-delegation-65k",
    "product_name": "Smart Energy 65k",
    "status": "active",
    "balance_trx": "100.000000",
    "total_delegations": 42,
    "deleted_at": null,
    "refund_amount_trx": null,
    "created_at": "2026-05-20T08:00:00.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}

Errors

StatusDescription
400INVALID_REQUEST
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
402INSUFFICIENT_BALANCE
409RESOURCE_CONFLICT — duplicate active subscription for this address
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
GET/smart-energy/{id}

Get a subscription

Single-subscription lookup scoped to the caller.

curl -H "Authorization: Bearer $KEY" https://energy-trx.com/api/v1/smart-energy/clsmart1234567890

Parameters

NameInTypeRequiredDescription
idpathstringyes
Subscription id.
e.g. clsmart1234567890

Response

200 Subscription
json
{
  "data": {
    "id": "clsmart1234567890",
    "address": "TXyZrecipient1234567890ABCDEF",
    "product_slug": "smart-delegation-65k",
    "product_name": "Smart Energy 65k",
    "status": "active",
    "balance_trx": "100.000000",
    "total_delegations": 42,
    "deleted_at": null,
    "refund_amount_trx": null,
    "created_at": "2026-05-20T08:00:00.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
404RESOURCE_NOT_FOUND
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
POST/smart-energy/{id}/pause

Pause a subscription

Halts auto-delegation. Balance is preserved; resume any time.

# HMAC-signed write
ts=$(date +%s)
body=''
sig=$(printf "%s.%s" "$ts" "$body" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')

curl -X POST \
  -H "Authorization: Bearer $KEY" \
  -H "X-Timestamp: $ts" \
  -H "X-Signature: $sig" \
  -H "Content-Type: application/json" \
  -d "$body" \
  https://energy-trx.com/api/v1/smart-energy/clsmart1234567890/pause

Parameters

NameInTypeRequiredDescription
idpathstringyes
Subscription id.
e.g. clsmart1234567890

Response

200 Paused
json
{
  "data": {
    "id": "clsmart1234567890",
    "address": "TXyZrecipient1234567890ABCDEF",
    "product_slug": "smart-delegation-65k",
    "product_name": "Smart Energy 65k",
    "status": "active",
    "balance_trx": "100.000000",
    "total_delegations": 42,
    "deleted_at": null,
    "refund_amount_trx": null,
    "created_at": "2026-05-20T08:00:00.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
404RESOURCE_NOT_FOUND
409RESOURCE_CONFLICT — not in active state
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
POST/smart-energy/{id}/resume

Resume a paused subscription

Returns the subscription to active state.

# HMAC-signed write
ts=$(date +%s)
body=''
sig=$(printf "%s.%s" "$ts" "$body" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')

curl -X POST \
  -H "Authorization: Bearer $KEY" \
  -H "X-Timestamp: $ts" \
  -H "X-Signature: $sig" \
  -H "Content-Type: application/json" \
  -d "$body" \
  https://energy-trx.com/api/v1/smart-energy/clsmart1234567890/resume

Parameters

NameInTypeRequiredDescription
idpathstringyes
Subscription id.
e.g. clsmart1234567890

Response

200 Resumed
json
{
  "data": {
    "id": "clsmart1234567890",
    "address": "TXyZrecipient1234567890ABCDEF",
    "product_slug": "smart-delegation-65k",
    "product_name": "Smart Energy 65k",
    "status": "active",
    "balance_trx": "100.000000",
    "total_delegations": 42,
    "deleted_at": null,
    "refund_amount_trx": null,
    "created_at": "2026-05-20T08:00:00.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
404RESOURCE_NOT_FOUND
409RESOURCE_CONFLICT — not in paused state
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
POST/smart-energy/{id}/topup

Top up a subscription's balance

Adds TRX to an active subscription.

# HMAC-signed write
ts=$(date +%s)
body='{ "top_up_trx": 50 }'
sig=$(printf "%s.%s" "$ts" "$body" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')

curl -X POST \
  -H "Authorization: Bearer $KEY" \
  -H "X-Timestamp: $ts" \
  -H "X-Signature: $sig" \
  -H "Content-Type: application/json" \
  -d "$body" \
  https://energy-trx.com/api/v1/smart-energy/clsmart1234567890/topup

Parameters

NameInTypeRequiredDescription
idpathstringyes
Subscription id.
e.g. clsmart1234567890

Request body

Content-Type: application/json

json
{
  "top_up_trx": 50
}

Response

200 Topped up
json
{
  "data": {
    "id": "clsmart1234567890",
    "address": "TXyZrecipient1234567890ABCDEF",
    "product_slug": "smart-delegation-65k",
    "product_name": "Smart Energy 65k",
    "status": "active",
    "balance_trx": "100.000000",
    "total_delegations": 42,
    "deleted_at": null,
    "refund_amount_trx": null,
    "created_at": "2026-05-20T08:00:00.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
402INSUFFICIENT_BALANCE
404RESOURCE_NOT_FOUND
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
GET/transactions

List your transactions

Your transaction ledger. Some non-customer system entries are excluded, as are below-minimum deposits.

curl -H "Authorization: Bearer $KEY" https://energy-trx.com/api/v1/transactions?page=1&per_page=50&type=deposit

Parameters

NameInTypeRequiredDescription
pagequeryintegerno
Page number.
e.g. 1
per_pagequeryintegerno
Page size (max 100).
e.g. 50
typequerystringno
Filter by ledger type.
e.g. deposit

Response

200 Paginated transactions
json
{
  "data": [
    {
      "id": "cltx1234567890",
      "type": "deposit",
      "amount": "100.000000",
      "currency": "TRX",
      "status": "confirmed",
      "tx_hash": "9f8e7d6c5b4a3210...",
      "created_at": "2026-05-26T14:22:11.000Z"
    }
  ],
  "meta": {
    "request_id": "ab12cd34ef56gh78",
    "page": 1,
    "per_page": 50,
    "total": 1,
    "has_more": false
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
GET/transactions/{id}

Get a transaction

Single-transaction lookup. Returns 404 if the transaction isn't part of your visible ledger.

curl -H "Authorization: Bearer $KEY" https://energy-trx.com/api/v1/transactions/cltx1234567890

Parameters

NameInTypeRequiredDescription
idpathstringyes
Transaction id.
e.g. cltx1234567890

Response

200 Transaction
json
{
  "data": {
    "id": "cltx1234567890",
    "type": "deposit",
    "amount": "100.000000",
    "currency": "TRX",
    "status": "confirmed",
    "tx_hash": "9f8e7d6c5b4a3210...",
    "created_at": "2026-05-26T14:22:11.000Z"
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78"
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
404RESOURCE_NOT_FOUND
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
GET/webhooks

List your webhook subscriptions

Returns the public projection — never the signing secret. Read-only on this surface; create / edit / delete / test live behind the dashboard at /dashboard/webhooks (session-authenticated). HMAC signatures on outbound deliveries land in the `X-Energytrx-Signature` header.

curl -H "Authorization: Bearer $KEY" https://energy-trx.com/api/v1/webhooks

Response

200 Array of webhooks
json
{
  "data": [
    {
      "id": "clwh1234567890",
      "url": "https://your-server.example.com/webhook",
      "events": [
        "order.created",
        "deposit.received"
      ],
      "active": true,
      "failure_count": 0,
      "last_delivery_at": "2026-05-27T10:00:00.000Z",
      "last_failure_at": null,
      "created_at": "2026-05-20T08:00:00.000Z",
      "updated_at": "2026-05-20T08:00:00.000Z"
    }
  ],
  "meta": {
    "request_id": "ab12cd34ef56gh78",
    "count": 1
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
GET/api-keys

List your API keys

Returns the public projection — never the full key or secret. Read-only on this surface; key creation + revocation live behind the dashboard at /dashboard/api-keys (session-authenticated).

curl -H "Authorization: Bearer $KEY" https://energy-trx.com/api/v1/api-keys

Response

200 Array of keys
json
{
  "data": [
    {
      "id": "clkey1234567890",
      "name": "Production server",
      "prefix": "a1b2c3d4",
      "scopes": [
        "read",
        "write"
      ],
      "lastUsedAt": "2026-05-27T09:00:00.000Z",
      "lastUsedIp": "203.0.113.42",
      "expiresAt": null,
      "revokedAt": null,
      "createdAt": "2026-05-01T12:00:00.000Z"
    }
  ],
  "meta": {
    "request_id": "ab12cd34ef56gh78",
    "count": 1
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure
GET/api-usage

Aggregate your recent API traffic

Returns daily request counts, top endpoints, per-key breakdown, and overall error rate for the last `days` days (default 7, max 90).

curl -H "Authorization: Bearer $KEY" https://energy-trx.com/api/v1/api-usage?days=7

Parameters

NameInTypeRequiredDescription
daysqueryintegerno
Window length in days (1..90).
e.g. 7
api_key_idquerystringno
Narrow to a single API key.

Response

200 Aggregated usage
json
{
  "data": {
    "total_requests": 1247,
    "total_errors": 12,
    "error_rate": 0.0096,
    "unique_endpoints": 8,
    "daily": [
      {
        "date": "2026-05-27",
        "total": 247,
        "errors": 1
      }
    ],
    "top_endpoints": [
      {
        "method": "GET",
        "path": "/api/v1/prices",
        "count": 612,
        "error_count": 0
      }
    ],
    "per_key": [
      {
        "api_key_id": "clkey1234567890",
        "count": 1247,
        "error_count": 12
      }
    ]
  },
  "meta": {
    "request_id": "ab12cd34ef56gh78",
    "window_days": 7
  }
}

Errors

StatusDescription
401AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID
429RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After
500INTERNAL_ERROR — server fault, include the request_id when reporting
503SERVICE_UNAVAILABLE — temporary upstream failure