tdx usage#

Read usage reports.

Read observability usage rollups and series as JSON. CSV export is not supported by the CLI.

Every command also takes the global flags and reads the environment variables that the command reference lists once.

Commands#

CommandDescriptionType
tdx usage reportRead a usage rollup.Read
tdx usage seriesRead a usage time series.Read

tdx usage report#

Read a usage rollup.

Reads

Read one grouped rollup over the filtered window. Requires usage.read; the gateway narrows rows to the reader's reach. CSV is not supported by the CLI: format is never sent, so the gateway replies in JSON. Token counts and costUsd are the gateway's numbers, unchanged. Calls and traces are out of scope. Very large replies, such as grouping by key on installs with many keys, may exceed the masker's safety limits and are refused rather than shown partially (OUTPUT_MASK_LIMIT); narrow --since/--until, filter or group more coarsely. Uses auth status host-bound bearer rules; reads are read-only and --dry-run still reads.

Shell
# GET /observability/v1/usage
tdx usage report --group-by <agent|model|provider|key|tag|project|user|workspace> [flags]

Required flags

FlagTypeDefaultDescription
--group-byone of agent, model, provider, key, tag, project, user, workspaceGroup rows by this dimension.

Optional flags

FlagTypeDefaultDescription
--sincedatetimeWindow start, ISO-8601 with a time zone.
--untildatetimeWindow end, ISO-8601 with a time zone.
--statusstringFilter by status; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--providerstringFilter by provider; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--modelstringFilter by model; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--agentstringFilter by agent; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--projectstringFilter by project; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--tagstringFilter by tag; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--searchstringFilter by search; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--key-idstringFilter by API key id; needs user management on: a gateway without it ignores this filter on usage report, which the CLI then refuses, and serves no usage series.
--user-idstringFilter by user id; needs user management on: a gateway without it ignores this filter on usage report, which the CLI then refuses, and serves no usage series.
--workspace-idstringFilter by workspace id; needs user management on: a gateway without it ignores this filter on usage report, which the CLI then refuses, and serves no usage series.
--request-idstringFilter by request id; needs user management on: a gateway without it ignores this filter on usage report, which the CLI then refuses, and serves no usage series.
--sessionsone of grouped, sourcedSession grouping filter; needs user management on: a gateway without it ignores this filter on usage report, which the CLI then refuses, and serves no usage series.

Output fields (inside data)

FieldTypeDescription
rowsusage-row[]Grouped rows: name, calls, token totals, costUsd when shown, coverage.
pagepageGateway page metadata as reported.
groupBystringGrouping dimension.
summaryusage-summaryTotals over the whole filtered window.
windowusage-windowResolved since and until.
moneyraw|hidden|nullGateway money mode: hidden withholds every costUsd; null when the gateway omits it (user management off).
directoryattribution-directory|nullNames and states of the keys, users and workspaces the rows name; null when omitted.

tdx usage series#

Read a usage time series.

Reads

Read bucketed usage; the gateway bounds the window per interval and groups series past the top N as other. Requires usage.read; the gateway narrows rows to the reader's reach. CSV is not supported by the CLI: format is never sent, so the gateway replies in JSON. Token counts and costUsd are the gateway's numbers, unchanged. Calls and traces are out of scope. Very large replies, such as grouping by key on installs with many keys, may exceed the masker's safety limits and are refused rather than shown partially (OUTPUT_MASK_LIMIT); narrow --since/--until, filter or group more coarsely. Uses auth status host-bound bearer rules; reads are read-only and --dry-run still reads.

Shell
# GET /observability/v1/usage/series
tdx usage series --interval <minute|hour|day> --since <datetime> [flags]

Required flags

FlagTypeDefaultDescription
--intervalone of minute, hour, dayUTC bucket size.
--sincedatetimeWindow start, ISO-8601 with a time zone.

Optional flags

FlagTypeDefaultDescription
--group-byone of agent, model, provider, key, tag, project, user, workspaceSplit series by this dimension.
--rank-byone of calls, costUsd, totalTokensRank the top series by.
--topintegerPositive integer number of series; the gateway clamps it to 20 and reports the value it used.
--untildatetimeWindow end, ISO-8601 with a time zone.
--statusstringFilter by status; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--providerstringFilter by provider; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--modelstringFilter by model; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--agentstringFilter by agent; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--projectstringFilter by project; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--tagstringFilter by tag; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--searchstringFilter by search; passed through to the gateway; refused locally if it could hide a credential: a percent sign, bare or written %25 (which decodes to %), or an escape that is not valid UTF-8; name: value or name=value where the name contains token, secret, password, key, credential, authorization or cookie; a #, ? or & directly before such a name, or before reset or invite, with or without =; #reset or #invite; Bearer text or a tokedex_ token.
--key-idstringFilter by API key id; needs user management on: a gateway without it ignores this filter on usage report, which the CLI then refuses, and serves no usage series.
--user-idstringFilter by user id; needs user management on: a gateway without it ignores this filter on usage report, which the CLI then refuses, and serves no usage series.
--workspace-idstringFilter by workspace id; needs user management on: a gateway without it ignores this filter on usage report, which the CLI then refuses, and serves no usage series.
--request-idstringFilter by request id; needs user management on: a gateway without it ignores this filter on usage report, which the CLI then refuses, and serves no usage series.
--sessionsone of grouped, sourcedSession grouping filter; needs user management on: a gateway without it ignores this filter on usage report, which the CLI then refuses, and serves no usage series.

Output fields (inside data)

FieldTypeDescription
intervalstringBucket size.
windowseries-windowFloored since and exclusive until.
bucketsstring[]Every bucket start in the window.
groupBystring|nullGrouping dimension.
rankBystringRanking.
topintegerSeries count the gateway used after clamping.
seriesusage-series[]Per-group totals and sparse points.
summaryusage-pointWindow totals.
moneyraw|hidden|nullGateway money mode: hidden withholds every costUsd; null when the gateway omits it (user management off).
directoryattribution-directory|nullNames and states of the keys, users and workspaces the rows name; null when omitted.