giip
PartnersSES Proposal
5 min read

gair Usage Statistics

A screen where administrators review gair (AI gateway) usage per CSN. It is composed of summary cards, a daily trend chart, per-CSN aggregate cards, per-key-prefix aggregate cards, and request-level drill-down cards. Aggregates and drill-down rows are rendered as cards rather than tables, so they stay readable on a mobile screen without horizontal scrolling.

📋 Overview

gair is the AI gateway inside GIIP. This screen answers which project (CSN) called which model, how many tokens it spent, and how many errors it produced.

  • Who can view it: administrators only (uLevel 70 or higher). Both the screen and the data queries are gated on that level.
  • What the data is: one row per provider call, written by the gair router into tAiGatewayUsage. It carries CSN, project, key prefix, model, tokens, latency, HTTP status, judgment (SIMPLE/CODE/DEEP), cache tokens, and stop reason.
  • Related screen: gair access permission (allow/revoke per CSN) and SK registration live in the gair admin console. This screen is read-only.

📈 Go to the gair Usage Statistics page →

🚀 Quick start

  1. Open the admin page (/admin) and pick gair Usage Statistics in the Configuration group.
  2. Set the period, CSN, model alias, and result filters. The default is all CSNs / last 7 days / all models / all results.
  3. Press Query to fill the summary cards, the daily trend chart, the aggregate cards, and the drill-down cards in one round.

📊 Detailed features

1. Filters

FilterOptionsNotes
PeriodLast 24 hours / Last 7 days / Last 30 daysUTC based. The start instant is inclusive, the end instant is exclusive.
CSNAll CSNs / one project"All" aggregates every project.
Model aliasEmpty (all) or an exact aliasMust match exactly. Aliases seen in the drill-down cards are offered as suggestions.
ResultAll / Success / ErrorSuccess is HTTP 200; error is anything else (including a missing status).

The filters apply to every aggregate below. The page never calls once per row: one query round calls each aggregate stored procedure exactly once.

2. Summary cards

CardContent
CallsTotal calls under the current filters and how many failed
Total tokensCombined tokens plus the input/output breakdown
Error rateError percentage and the number of 5xx errors
Avg latencyAverage response time per call (ms)
Cache read / write tokensCache token totals and the number of calls that recorded them
DEEP ratioDEEP judgment share with a policy badge (target: under 30%)

3. Daily trend chart

  • Plots calls or tokens per CSN by UTC day.
  • The metric (calls / tokens) can be switched.
  • When there are many CSNs, the 8 with the most calls are plotted and the rest are combined into Other.

4. Per-CSN aggregate cards

Shows CSN, project name, calls, total tokens, errors (count and percentage), SIMPLE/CODE/DEEP counts, unclassified count, average latency, and the DEEP ratio with its policy badge — one card per CSN. Unclassified means the profile was not recorded on that call (classification incomplete). The CSN and project name act as the card title; the remaining items are listed as label-value pairs.

5. Per-key-prefix aggregate cards

Aggregates calls, tokens, errors, and the last used timestamp per calling key (key prefix) within a CSN, one card per key prefix. Only the key prefix is stored, so the raw key never reaches the screen. The request location column shows one representative location recorded by that key.

6. Request drill-down cards

One card per request: the time acts as the card title, and request ID, CSN, request location, key prefix, model alias, actual model, judgment (SIMPLE/CODE/DEEP), input/output/cache tokens, stop reason, status (HTTP), and latency are listed as label-value pairs. Cards are loaded page by page.

7. "Not recorded" marking

Cache tokens and stop reason are not recorded on some calls (routers that never used the feature, responses without those values). Such items are shown as Not recorded, not as 0. A value genuinely recorded as 0 is still shown as 0. The cache token summary cards also show Not recorded instead of a total when no call recorded them.

❓ Troubleshooting

SymptomWhat to check
"Aggregation query failed"Whether the session is an administrator (uLevel 70+) and whether the aggregate stored procedures are deployed on the server.
No rows at allWhether the CSN filter is narrowed to one project, whether the model alias matches exactly, and whether the result filter is "All".
Empty CSN dropdownThe admin stored procedure that lists all CSNs returned nothing. Reload; if it stays empty, report it to an administrator.
Empty chartThere may be no calls in the selected period, or the CSN filter is too narrow.
Empty request cards but a non-zero totalThe current page may be out of range. Go to the previous page.

🔌 API reference

The screen calls four administrator stored procedures through the GIIP API (giipApi).

Screen areaCommandStored procedureReturns
Summary cards, per-CSN tableGairUsageAdminStatspApiGairUsageAdminStatsbyAKSummary row + per-CSN aggregates
Daily trendGairUsageAdminDailypApiGairUsageAdminDailybyAKDaily × CSN aggregates
Per-key-prefix tableGairUsageAdminKeyListpApiGairUsageAdminKeyListbyAKPer-key-prefix aggregates
Request drill-downGairUsageAdminListpApiGairUsageAdminListbyAKRequest rows + total count

The common input (jsondata) is:

{
  "fromDt": "2026-11-19T12:00:00.000Z",
  "toDt": "2026-11-26T12:00:00.000Z",
  "csn": 0,
  "modelAlias": "",
  "result": "all"
}
KeyMeaning
fromDt / toDtQuery window (UTC). fromDt inclusive, toDt exclusive.
csn0 means all CSNs, otherwise only that CSN.
modelAliasEmpty string means all models; otherwise an exact model match.
resultall / success / error.
page / pageSizeRequest drill-down only. pageSize defaults to 50, maximum 500.

📌 Metadata

ItemValue
Page path/[locale]/admin/gair-usage
PermissionAdministrator (uLevel 70 or higher)
Data sourcetAiGatewayUsage (giipdb)
Related issuesgiip #6221 (usage statistics screen), #6078 (gair access management), #5929 (usage query SP), #6220 (DEEP judgment and policy), #6303 (cache token and stop reason recording)
LanguagesKorean, English, Japanese, Chinese (Simplified and Traditional)