Tawa docs
Analytics

Aggregate metrics for a period

Call volume, decisions, latency, credits, and an organization-wide billing snapshot for the calling app. Defaults to the org's current billing period when `start`/`end` are omitted. Requires an analytics API key — a regular scan key is rejected.

GET
/analytics/summary

Call volume, decisions, latency, credits, and an organization-wide billing snapshot for the calling app. Defaults to the org's current billing period when start/end are omitted. Requires an analytics API key — a regular scan key is rejected.

Authorization

AuthorizationBearer <token>

Your API key as a bearer token.

In: header

Query Parameters

start?string

Inclusive range start (ISO 8601 date-time). Must be given together with end, or omitted along with it to use the current billing period.

end?string

Exclusive range end (ISO 8601 date-time). See start.

include_preview?boolean

Include scans run from the dashboard (free preview scans). Defaults to false, so figures reflect production traffic only.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/analytics/summary"
{
  "appId": "string",
  "generatedAt": "2019-08-24T14:15:22Z",
  "period": {
    "start": "2019-08-24T14:15:22Z",
    "end": "2019-08-24T14:15:22Z"
  },
  "volume": {
    "total": 0,
    "completed": 0,
    "failed": 0,
    "inflight": 0,
    "errorRate": 0
  },
  "decisions": {
    "allow": 0,
    "softBlock": 0,
    "review": 0,
    "needsReview": 0,
    "sandbox": 0,
    "hardBlock": 0,
    "classified": 0,
    "blockRate": 0,
    "avgConfidence": 0
  },
  "latency": {
    "avgMs": 0,
    "p50Ms": 0,
    "p95Ms": 0
  },
  "credits": {
    "used": 0
  },
  "byCategory": [
    {
      "jobCategory": "prompt",
      "total": 0,
      "blocked": 0
    }
  ],
  "byKeyType": [
    {
      "keyType": "dev",
      "total": 0,
      "creditsUsed": 0
    }
  ],
  "org": {
    "periodStart": "2019-08-24T14:15:22Z",
    "periodEnd": "2019-08-24T14:15:22Z",
    "creditsUsed": 0,
    "creditsLimit": 0,
    "overageCreditsUsed": 0,
    "allowOverage": true,
    "overageSpentCents": 0,
    "spendCapCents": 0,
    "currency": "GBP"
  }
}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "retryAfter": 0
}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "retryAfter": 0
}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "retryAfter": 0
}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "retryAfter": 0
}