All API requests require authentication using an API key.
SMAvatar API keys follow this format:
sma_AqNYHpfSLGz51YEzJwqavCw6rTlxnlka
sma_ (identifies SMAvatar keys)Include your API key in the Authorization header:
curl 'https://api.smavatar.com/api/v1/...' \
-H 'Authorization: Bearer sma_YOUR_API_KEY_HERE'
SMAvatar uses a hierarchical structure:
Organization (your account)
└── Project (e.g., "My App")
└── API Keys (multiple allowed)
└── Jobs (avatars, maps)
# .env (never commit this file!)
SMAVATAR_API_KEY=sma_your_key_here
SMAVATAR_PROJECT_ID=your-project-uuid
// Node.js
const apiKey = process.env.SMAVATAR_API_KEY
# Python
import os
api_key = os.environ.get('SMAVATAR_API_KEY')
API keys have the following rate limits:
| Limit | Value |
|---|---|
| Job creation | 20 per hour |
| Job status checks | 100 per minute |
| MCP tools | 100 per minute |
Exceeding rate limits returns 429 Too Many Requests.
If a key is compromised:
Revoked keys stop working immediately.
{
"statusCode": 401,
"message": "Invalid API key"
}
{
"statusCode": 401,
"message": "Authorization header required"
}
{
"statusCode": 403,
"message": "API key does not have access to this project"
}