跳转到主要内容
GET
GET /admin/api/usage

授权

gproxy_session
string
cookie
必填

请求头

x-gproxy-admin-scope
string

Administrative scope selected by the caller.

查询参数

apiKeyId
string | null

One of the caller's own keys. A key that is not theirs matches nothing, because the user filter is applied as well.

bucketMs
integer<int64> | null

Bucket width for the trend. Absent means no trend is computed; present requires toMs, and without fromMs the buckets start at the first matching record.

credentialId
string | null

Admin surface only: the share of one credential's attempts. A portal refuses it for the same reason it refuses groupBy: credential — credential ids are the operator's, not the caller's.

fromMs
integer<int64> | null

Inclusive lower bound on startedAtMs.

groupBy

Absent means no grouped cut is computed.

可用选项:
user,
apiKey,
operation
model
string | null
operation
string | null
providerId
string | null

Admin surface only: the share of one upstream provider's attempts. A portal refuses it, because it never shows a caller provider ids.

toMs
integer<int64> | null

Exclusive upper bound.

userId
string | null

Ignored. See the type note.

响应

Success

The caller's own usage over the requested range.

fromMs
integer<int64> | null
必填
groups
object[]
必填

Empty unless groupBy was given.

summary
object
必填

Totals over the records a scan covered.

toMs
integer<int64> | null
必填
trend
object[]
必填

Empty unless bucketMs was given.