Authentication
Every TronAgg API request requires an API key in the X-API-Key header:
X-API-Key: ta_your_key_here
API keys are tied to your TronAgg account (wallet address). All purchases are deducted from the account balance associated with that key.
Creating an API Key
- Log in to the TronAgg Dashboard
- Click API Keys in the sidebar
- Click Create API Key
- Enter a descriptive name (e.g., "Production Bot", "Testing")
- Click Create
- Copy the key immediately -- it is displayed only once
danger
The full API key is shown only at creation time. If you lose it, revoke the key and create a new one.
Limits
- Maximum 5 API keys per account
- Each key has independent access to your full account balance
- Revoking one key does not affect others
Key Format
- Prefix:
ta_(identifies TronAgg keys at a glance) - Body: 43 characters of URL-safe random data
- Total length: 46 characters
Example: ta_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789-_ab
Only the SHA-256 hash of the key is stored on our servers. The full key exists only in your possession.
Key Management
Revoking a Key
If a key is compromised or no longer needed:
- Go to API Keys in the Dashboard
- Find the key you want to revoke
- Click the Revoke button
- Confirm the action
Revoked keys stop working immediately. Revocation cannot be undone.
Best Practices
- Name keys descriptively -- "Prod Trading Bot" is better than "Key 1"
- Use separate keys for different applications or environments
- Revoke unused keys promptly
- Rotate keys periodically as a security measure
Storing Keys Securely
Never hardcode API keys in source code. Use environment variables instead:
export TRONAGG_API_KEY="ta_your_key_here"
Or use a .env file (excluded from git):
.env
TRONAGG_API_KEY=ta_your_key_here
app.py
from dotenv import load_dotenv
import os
load_dotenv()
API_KEY = os.environ["TRONAGG_API_KEY"]
Error Responses
| Status | Meaning |
|---|---|
401 Unauthorized | API key is missing, invalid, or revoked |
403 Forbidden | API key is valid but the account lacks permission |
If a Key is Compromised
- Revoke the key in the Dashboard immediately
- Create a new key
- Update your application with the new key
- Audit recent orders for unauthorized activity