Skip to main content
Predexy’s usage stats endpoints let you monitor how your API keys are being used. You can retrieve aggregated call counts and latency metrics by time period, or pull raw per-request logs for debugging. Both endpoints require console session authentication (Authorization: Bearer <access_token>).

Get aggregated usage statistics

GET /api/v1/console/stats returns call volume and latency metrics aggregated by time period for a specific API key. Query parameters:
api_key_id
string
required
UUID of the API key to fetch statistics for. Get this from GET /api/v1/console/keys.
granularity
string
default:"daily"
Aggregation period. One of hourly, daily, or monthly.
limit
integer
default:"30"
Number of periods to return. Minimum 1, maximum 90.
Example request:
curl "https://api.predexy.com/api/v1/console/stats?api_key_id=YOUR_KEY_UUID&granularity=daily&limit=7" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example response:
{
  "data": [
    {
      "period_start": "2026-04-20T00:00:00Z",
      "total_calls": 1523,
      "successful_calls": 1500,
      "error_calls": 23,
      "avg_latency_ms": 42.5,
      "p95_latency_ms": 120.0,
      "unique_endpoints": 3
    },
    {
      "period_start": "2026-04-21T00:00:00Z",
      "total_calls": 891,
      "successful_calls": 888,
      "error_calls": 3,
      "avg_latency_ms": 38.1,
      "p95_latency_ms": 95.0,
      "unique_endpoints": 2
    }
  ],
  "meta": {
    "granularity": "daily",
    "count": 2
  }
}
Response fields:
period_start
string (date-time)
Start of the aggregation period in ISO 8601 format.
total_calls
integer
Total API requests made during the period.
successful_calls
integer
Requests that returned a 2xx status code.
error_calls
integer
Requests that returned a 4xx or 5xx status code.
avg_latency_ms
number
Average server-side response time in milliseconds.
p95_latency_ms
number
95th percentile response time in milliseconds. Useful for detecting slow outliers.
unique_endpoints
integer
Number of distinct API endpoints called during the period.

Get raw request logs

GET /api/v1/console/logs returns a paginated list of individual API requests for a specific key. Use this to debug errors or audit specific calls. Query parameters:
api_key_id
string
required
UUID of the API key to fetch logs for.
limit
integer
default:"50"
Maximum number of log entries to return (1–200).
offset
integer
default:"0"
Number of entries to skip for pagination.
Example request:
curl "https://api.predexy.com/api/v1/console/logs?api_key_id=YOUR_KEY_UUID&limit=20&offset=0" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example response:
{
  "data": [
    {
      "endpoint": "/api/v1/external/arbitrage/opportunities",
      "method": "GET",
      "status_code": 200,
      "response_time_ms": 45,
      "created_at": "2026-04-21T14:32:01Z"
    },
    {
      "endpoint": "/api/v1/external/arbitrage/opportunities",
      "method": "GET",
      "status_code": 429,
      "response_time_ms": 5,
      "created_at": "2026-04-21T14:31:58Z"
    }
  ],
  "meta": {
    "count": 2,
    "offset": 0,
    "limit": 20,
    "total": 1523
  }
}
endpoint
string
The API endpoint path that was called.
method
string
HTTP method used (GET, POST, DELETE, etc.).
status_code
integer
HTTP status code returned by the server.
response_time_ms
integer
Server-side response time in milliseconds.
created_at
string (date-time)
Timestamp of the request in ISO 8601 format.

Tips

To find your API key’s UUID, call GET /api/v1/console/keys and use the id field from the key you want to inspect.
Use granularity=hourly when debugging a sudden error spike, and granularity=monthly for quota planning. Switch to raw logs (/console/logs) to identify the exact requests causing 4xx errors.