Skip to content

API reference

API usage

Request volume, error rate and latency for your own API traffic.

1 operationBase URL https://packetexchange.io/api/v1Postman collection

Get API usage for your account or one key

GET/api/v1/account/api-usage

Access
API key. Scoped keys need account:read.
Rate limit
100 requests per second (the default)

Request volume, error rate, p95 latency, per-day counts and top endpoints over a trailing window (default 7 days, max 90). Pass keyId to see one API key; omit it for all traffic including dashboard sessions.

Parameters

  • days

    query · integer

    Trailing window in days (1-90)Default 7
  • keyId

    query · string (uuid)

    Only requests made with this API key (one of yours)

Response 200

  • datarequired

    object

  • totalRequestsrequired

    integer · data.totalRequests

  • errorRaterequired

    number · data.errorRate

    Fraction of requests answered 4xx/5xx, 0 to 1
  • p95LatencyMsrequired

    integer · data.p95LatencyMs

  • byDayrequired

    object[] · data.byDay

  • daterequired

    string · data.byDay[].date

    YYYY-MM-DD (UTC)
  • countrequired

    integer · data.byDay[].count

  • errorsrequired

    integer · data.byDay[].errors

  • topEndpointsrequired

    object[] · data.topEndpoints

  • pathrequired

    string · data.topEndpoints[].path

    Route pattern, e.g. /api/v1/routes/:id
  • countrequired

    integer · data.topEndpoints[].count

  • keyIdrequired

    string (uuid) | null · data.keyId

    The key the figures are filtered to, or null for all traffic

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.