API Overview
The AgentMetrics API is a REST API. All requests use HTTPS. JSON is the request and response format.
Base URL
Shell
https://api.agentmetrics.dev/v1
Versioning
The API is versioned via path prefix (/v1). Breaking changes are introduced in new major versions. The current version is v1.
Authentication
All requests require an Authorization header with your SDK key:
Shell
Authorization: Bearer am_live_xxxxxxxxxxxxxxxxxxxx
SDK keys are prefixed with am_live_. Generate one from the Settings page in your dashboard. Keys are hashed before storage and cannot be recovered — rotate immediately if lost.
Response format
All responses are JSON.
Success
JSON
{
"data": {
"accepted": 1,
"rejected": 0
}
}
Error
JSON
{
"error": {
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked."
}
}
Status codes
| Code | Meaning |
|---|---|
200 | Success |
400 | Bad request: malformed JSON or missing required fields |
401 | Unauthorized: missing or invalid API key |
404 | Not found |
422 | Validation error: field-level errors in response body |
429 | Rate limited: monthly event quota exceeded |
500 | Server error |
Rate limits
| Plan | Events / month | Burst |
|---|---|---|
| Free | 10,000 | 100 / min |
| Growth | 1,000,000 | 1,000 / min |
| Pro | Unlimited | 10,000 / min |
Events above the monthly quota are rejected with a 429. No overages are charged. Upgrade for higher limits.