Skip to main content

Consumption data

You can monitor hourly metrics by specifying start and end dates or times:
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/usage'\
  '?from=2025-12-24'\
  '&to=2025-12-25'
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/usage'\
  '?from=2025-12-24T18:00:00-06:00'\
  '&to=2025-12-2505T9:00:00-06:00'
The API will return a JSON report:
[{
  "email": "[email protected]",
  "from": "2025-12-24T00:00:00+00:00",
  "to": "2025-12-25T00:00:00+00:00",
  "service": "browser",
  "result": "success",
  "calls": 17208,
  "meanSecs": 6.78
}, {
  "email": "[email protected]",
  "from": "2025-12-24T07:00:00+00:00",
  "to": "2025-12-24T15:00:00+00:00",
  "service": "browser",
  "result": "failure",
  "calls": 18,
  "meanSecs": 60.22
}]
You can also filter the metrics by one or more services:
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/usage'\
  '?from=2025-12-24'\
  '&to=2025-12-25'\
  '&service=search'
$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/usage'\
  '?from=2025-12-24'\
  '&to=2025-12-25'\
  '&service=search'\
  '&service=browser'
Here are the report request keys and values:
KeyRequiredValue
fromThe ISO datetime to query data starting from, inclusively
toThe ISO datetime to query data up to, inclusively
email[Whitelabelers only] The (case-insensitive) email address of the user to query data for; multiple email addresses can be provided by repeating the key; data for all email addresses will be included by default
serviceThe service to query data for, search or browser; multiple services can be provided by repeating the key; data for all services will be included by default
Here are the response keys and values:
KeyValue
emailThe email address of the user whose data has been queried
fromThe ISO datetime of the first datapoint
toThe ISO datetime of the last datapoint
serviceThe service included in the data, search or browser
resultThe type of result included in the data, success or failure
callsThe number of API calls of the service and result type
meanSecsThe average number of elapsed seconds of the API calls
This endpoint is rate limited; if you receive a 429 response, pause for the backoff time given by the Retry-After header before making another request.

Additional examples

Email filtering

$ curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
  'https://api.agentfirst.dev/usage'\
  '?from=2025-12-24'\
  '&to=2025-12-25'\
  '&[email protected]'\
  '&[email protected]'\
  '&[email protected]'