Authentication Guide
All Athena AI Smart Money API endpoints require authentication using Bearer tokens. This guide explains how to get your API key and use it properly.
Getting Your API Key
To access the API, you'll need an API key:
- Contact us: Email support@0xathena.ai
- Provide details: Tell us about your use case and expected volume
- Receive key: We'll send you a unique API key within 24 hours
How to Use Your API Key
Include your API key in the Authorization header of every request using the Bearer token format:
Authorization: Bearer YOUR_API_KEY_HERE
Example Requests
Using cURL:
curl -H "Authorization: Bearer sk_live_abc123..." \
https://api.0xathena.ai/smart-money/token-stats
Using JavaScript/Fetch:
const response = await fetch('https://api.0xathena.ai/smart-money/token-stats', {
headers: {
Authorization: 'Bearer sk_live_abc123...',
},
});
const data = await response.json();
Using Python/Requests:
import requests
headers = {
'Authorization': 'Bearer sk_live_abc123...'
}
response = requests.get(
'https://api.0xathena.ai/smart-money/token-stats',
headers=headers
)
data = response.json()
Using TypeScript/Axios:
import axios from 'axios';
const response = await axios.get('https://api.0xathena.ai/smart-money/token-stats', {
headers: {
Authorization: 'Bearer sk_live_abc123...',
},
});
Testing Without Authentication
Want to test the API before getting a key? Use our demo endpoint:
curl https://api.0xathena.ai/smart-money/demo-token-stats?limit=5
This endpoint returns sample data with the exact same structure as the authenticated endpoints, perfect for:
- Testing your integration
- Prototyping applications
- Evaluating API response formats
- Development and debugging
Rate Limits
All API keys have the following rate limits:
| Limit Type | Amount |
|---|---|
| Per Minute | 100 requests |
| Per Day | 10,000 requests |
Rate Limit Headers
Every API response includes rate limit information in the headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1640000000
X-RateLimit-Limit: Total requests allowed per windowX-RateLimit-Remaining: Requests remaining in current windowX-RateLimit-Reset: Unix timestamp when the limit resets
Handling Rate Limits
If you exceed the rate limit, you'll receive a 429 Too Many Requests response:
{
"error": "Rate Limit Exceeded",
"message": "You have exceeded the rate limit of 100 requests per minute",
"retry_after": 45,
"timestamp": "2025-01-28T19:45:32.123Z"
}
Best Practices:
- Monitor the
X-RateLimit-Remainingheader - Implement exponential backoff on 429 responses
- Cache responses when possible (respect cache TTLs)
- Use webhooks instead of polling (coming soon)
Error Handling
Authentication Errors
Missing Authorization Header (401):
{
"error": "Unauthorized",
"message": "Missing or invalid authorization header",
"timestamp": "2025-01-28T19:45:32.123Z"
}
Invalid API Key (401):
{
"error": "Unauthorized",
"message": "Invalid API key",
"timestamp": "2025-01-28T19:45:32.123Z"
}
Expired API Key (401):
{
"error": "Unauthorized",
"message": "API key has expired",
"timestamp": "2025-01-28T19:45:32.123Z"
}
Security Best Practices
✅ DO:
- Store API keys in environment variables
- Use HTTPS for all requests
- Rotate keys periodically
- Use different keys for development and production
- Keep keys out of version control
❌ DON'T:
- Commit API keys to Git repositories
- Share API keys in public forums or chat
- Hardcode keys in client-side JavaScript
- Use the same key across multiple applications
- Log or print API keys
Example: Environment Variables
.env file:
ATHENA_API_KEY=sk_live_abc123...
ATHENA_API_URL=https://api.0xathena.ai
JavaScript/Node.js:
require('dotenv').config();
const apiKey = process.env.ATHENA_API_KEY;
const apiUrl = process.env.ATHENA_API_URL;
Python:
import os
from dotenv import load_dotenv
load_dotenv()
api_key = os.getenv('ATHENA_API_KEY')
api_url = os.getenv('ATHENA_API_URL')
API Key Formats
API keys follow this format:
- Live keys:
sk_live_followed by 32 alphanumeric characters - Test keys:
sk_test_followed by 32 alphanumeric characters
Example: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
Need Help?
Lost your API key? Email support@0xathena.ai with your account details to get a new key.
Need higher rate limits? Contact support@0xathena.ai to discuss enterprise plans with custom rate limits.
Security concern? If you believe your API key has been compromised, email security@0xathena.ai immediately to revoke and rotate your key.
Disclaimer: The information provided by Athena AI is for informational purposes only and should not be considered financial advice. Cryptocurrency investments carry significant risk. Always conduct your own research and consult with qualified financial advisors before making investment decisions. Athena AI is not responsible for any losses incurred from using this information.