Authentication
Create an API key and send it with every request.
Every request needs an API key, except the public Pricing endpoints.
Create a key
- Log in at apiv2.tronergy.io.
- Open API keys and click Create.
- Give it a name, and an expiry date if you want one.
- Copy the key. It is shown only once. If you lose it, revoke it and create a new one.
Keys start with omk_.
Send the key
Put it in the x-api-key header.
curl https://apiv2.tronergy.io/api/chain_relayers/portal/operations \
-H "x-api-key: omk_live_..."Authorization: ApiKey omk_live_... works too.
Authorization: Bearer omk_... does not work. Use x-api-key or the ApiKey scheme.
Keep keys on your server
Anyone with your key can spend your balance.
- Call the API from your backend. Never put a key in a browser or mobile app.
- Store keys in environment variables or a secrets manager.
- Use one key per service, so you can revoke one without breaking the rest.
What a key can do
A key acts as the dashboard user who created it, with that user's permissions. One key works in both sandbox and live.
A few actions need you to be signed in to the dashboard. An API key gets 403 with code: "SESSION_REQUIRED" for:
- withdrawing your balance
- creating API keys
- creating node links, and linking or unlinking wallets
- changing balance alerts and the budget cap
- changing the node proxy broadcast policy
- inviting users or changing their roles
So a leaked key can pay for relays, but it cannot move your money out, lift your budget cap, or create new keys.
Limits
- Up to 25 active keys per account. Expired and revoked keys do not count.
- Revoked and expired keys stop working at once.
Auth errors
401 Authentication required: the key is missing, wrong, expired or revoked.403 Insufficient permissions: the key's user is not allowed to do this.403 SESSION_REQUIRED: this action needs a dashboard session.
Manage keys from code with the API keys endpoint.