Skip to main content

get-ratelimits

Query rate limit requests and token usage with the Unkey CLI
1 min read

Run SQL queries against your rate limit analytics. Queries can use the raw ratelimits_v1 table or the per-minute, per-hour, per-day, and per-month aggregate tables.

Unkey restricts every query to the authenticated workspace. Workspace retention and query limits apply.

Usage#

Flags#

--querystringrequired#

SQL query to execute against your rate limit analytics data. The query can reference ratelimits_v1, ratelimits_per_minute_v1, ratelimits_per_hour_v1, ratelimits_per_day_v1, or ratelimits_per_month_v1.

Global flags#

FlagTypeDescription
--root-keystringOverride root key ($UNKEY_ROOT_KEY)
--api-urlstringOverride API base URL (default: https://api.unkey.com)
--configstringPath to config file (default: ~/.unkey/config.toml)
--outputstringOutput format. Use json for raw JSON
--bodystringSend this JSON string as the request body. You cannot combine it with request-building flags.

Examples#

See Query rate limit analytics for table schemas, query restrictions, and more examples.