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

CodeMeaning
200Success
400Bad request: malformed JSON or missing required fields
401Unauthorized: missing or invalid API key
404Not found
422Validation error: field-level errors in response body
429Rate limited: monthly event quota exceeded
500Server error

Rate limits

PlanEvents / monthBurst
Free10,000100 / min
Growth1,000,0001,000 / min
ProUnlimited10,000 / min

Events above the monthly quota are rejected with a 429. No overages are charged. Upgrade for higher limits.