API Key Authentication
All API requests require an API key passed in the X-API-Key header.
curl https://api.tronrental.com/v1/account/balance \
-H "X-API-Key: your_api_key"
Getting an API key
- Sign up at tronrental.com
- Go to Dashboard → API Keys
- Click Create API Key
- Copy and securely store your key — it’s shown only once
IP Whitelist (optional)
You can restrict your API key to specific IP addresses for additional security. Configure this in the dashboard when creating or editing a key.
Key permissions
Each API key has full access to your account’s API operations:
- Buy energy and bandwidth
- Manage Smart Mode subscriptions
- Create invoices
- Check balance and transaction history
Keep your API key secret. Do not expose it in client-side code, public repositories, or URLs.
Rate Limits
API keys are rate-limited per endpoint. See Rate Limits for details.
Errors
Authentication errors return HTTP 401:
{
"detail": "Invalid or missing API key"
}
If your key is disabled or blocked, you’ll receive HTTP 403.