Sign in at /dashboard and create an API key on the API keys page . Save the full key (ek_live_…) and secret (sk_live_…) shown once at creation. Call the API with a Bearer token: bash
Copycurl -H "Authorization: Bearer ek_live_…" \
https://energy-trx.com/api/v1/pricesPublic endpoints (e.g. /prices) don't need auth. Read endpoints need the Bearer token. Write endpoints additionally need an HMAC signature — see 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
Copyts=$(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/ordersAPI-key callers are limited to 180 requests / 60 seconds per key. Every response includes:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset (unix seconds)On 429 a Retry-After header tells you exactly how many seconds to wait before retrying.
Every error response shares one shape:
json
Copy{
"error" : { "code" : "RESOURCE_NOT_FOUND" , "message" : "Order not found." } ,
"meta" : { "request_id" : "ab12cd34ef56gh78" }
} Code HTTP Meaning AUTH_REQUIRED 401 No credentials supplied. INVALID_API_KEY 401 Key not found, revoked, or expired. INVALID_SIGNATURE 401 HMAC mismatch or missing signature headers on a write. TIMESTAMP_INVALID 401 X-Timestamp outside the 5-minute skew window. RATE_LIMIT_EXCEEDED 429 Per-key rate limit hit. INVALID_REQUEST 400 Validation failed — see `details`. INSUFFICIENT_BALANCE 402 Not enough TRX for this operation. RESOURCE_NOT_FOUND 404 The requested resource doesn't exist or isn't yours. RESOURCE_CONFLICT 409 Conflicting state — e.g. cancelling a non-pending order. SERVICE_UNAVAILABLE 503 Upstream temporarily down. Safe to retry. INTERNAL_ERROR 500 Unexpected server error. Cite the `request_id` if reporting.
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 }.
Auto-generated from the OpenAPI spec . All paths are relative to https://energy-trx.com/api/v1.
curl Node Python
Copycurl https://energy-trx.com/api/v1/pricesResponse 200 Current pricing
json
Copy{
"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"
}
} curl Node Python
Copycurl -H "Authorization: Bearer $KEY " https://energy-trx.com/api/v1/accountResponse 200 Account info
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copycurl -H "Authorization: Bearer $KEY " https://energy-trx.com/api/v1/orders?page=1&per_page=50&status=completedParameters Name In Type Required Description page query integer no Page number, 1-indexed.
e.g. 1
per_page query integer no Page size (max 100).
e.g. 50
status query string no Filter to one status value (e.g. `pending`).
e.g. completed
Response 200 Paginated orders
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copy
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/ordersRequest body Content-Type: application/json
json
Copy{
"target_address" : "TXyZrecipient1234567890ABCDEF" ,
"energy_amount" : 65000
} Response 201 Order created
json
Copy{
"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 Status Description 400 INVALID_REQUEST 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 402 INSUFFICIENT_BALANCE 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copycurl -H "Authorization: Bearer $KEY " https://energy-trx.com/api/v1/orders/clord1234567890Parameters Name In Type Required Description id path string yes Order id.
e.g. clord1234567890
Response 200 Order
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 404 RESOURCE_NOT_FOUND 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copy
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/cancelParameters Name In Type Required Description id path string yes Order id.
e.g. clord1234567890
Response 200 Order cancelled
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 404 RESOURCE_NOT_FOUND 409 RESOURCE_CONFLICT — order is not pending 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copycurl -H "Authorization: Bearer $KEY " https://energy-trx.com/api/v1/smart-energy?include_deleted=0Parameters Name In Type Required Description include_deleted query string no Include soft-deleted subs.
e.g. 0
Response 200 Array of subscriptions
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copy
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-energyRequest body Content-Type: application/json
json
Copy{
"address" : "TXyZrecipient1234567890ABCDEF" ,
"top_up_trx" : 100 ,
"product_slug" : "smart-delegation-65k"
} Response 201 Subscription created
json
Copy{
"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 Status Description 400 INVALID_REQUEST 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 402 INSUFFICIENT_BALANCE 409 RESOURCE_CONFLICT — duplicate active subscription for this address 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copycurl -H "Authorization: Bearer $KEY " https://energy-trx.com/api/v1/smart-energy/clsmart1234567890Parameters Name In Type Required Description id path string yes Subscription id.
e.g. clsmart1234567890
Response 200 Subscription
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 404 RESOURCE_NOT_FOUND 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copy
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/pauseParameters Name In Type Required Description id path string yes Subscription id.
e.g. clsmart1234567890
Response 200 Paused
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 404 RESOURCE_NOT_FOUND 409 RESOURCE_CONFLICT — not in active state 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copy
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/resumeParameters Name In Type Required Description id path string yes Subscription id.
e.g. clsmart1234567890
Response 200 Resumed
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 404 RESOURCE_NOT_FOUND 409 RESOURCE_CONFLICT — not in paused state 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copy
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/topupParameters Name In Type Required Description id path string yes Subscription id.
e.g. clsmart1234567890
Request body Content-Type: application/json
json
Copy{
"top_up_trx" : 50
} Response 200 Topped up
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 402 INSUFFICIENT_BALANCE 404 RESOURCE_NOT_FOUND 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copycurl -H "Authorization: Bearer $KEY " https://energy-trx.com/api/v1/transactions?page=1&per_page=50&type =depositParameters Name In Type Required Description page query integer no Page number.
e.g. 1
per_page query integer no Page size (max 100).
e.g. 50
type query string no Filter by ledger type.
e.g. deposit
Response 200 Paginated transactions
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copycurl -H "Authorization: Bearer $KEY " https://energy-trx.com/api/v1/transactions/cltx1234567890Parameters Name In Type Required Description id path string yes Transaction id.
e.g. cltx1234567890
Response 200 Transaction
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 404 RESOURCE_NOT_FOUND 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copycurl -H "Authorization: Bearer $KEY " https://energy-trx.com/api/v1/webhooksResponse 200 Array of webhooks
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
curl Node Python
Copycurl -H "Authorization: Bearer $KEY " https://energy-trx.com/api/v1/api-keysResponse 200 Array of keys
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure
GET /api-usage
Returns daily request counts, top endpoints, per-key breakdown, and overall error rate for the last `days` days (default 7, max 90).
curl Node Python
Copycurl -H "Authorization: Bearer $KEY " https://energy-trx.com/api/v1/api-usage?days=7Parameters Name In Type Required Description days query integer no Window length in days (1..90).
e.g. 7
api_key_id query string no Narrow to a single API key.
Response 200 Aggregated usage
json
Copy{
"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 Status Description 401 AUTH_REQUIRED / INVALID_API_KEY / INVALID_SIGNATURE / TIMESTAMP_INVALID 429 RATE_LIMIT_EXCEEDED — see X-RateLimit-Reset + Retry-After 500 INTERNAL_ERROR — server fault, include the request_id when reporting 503 SERVICE_UNAVAILABLE — temporary upstream failure