Get Prompt Usage
Return prompt usage for the organization that owns the given product as flat count buckets, always grouped by product. Use the repeatable breakdown_by parameter to control dimensions (user, origin, date); by default counts are broken down by origin, aggregated over the whole window. The API key authorizes its own product, but the response covers every product in that organization so a single key gives org-wide visibility. Counts cover all prompt origins unless the origin parameter is supplied. Requires prompt usage tracking to be enabled for the organization. Dates are optional and default to the last 30 days.
breakdown_by parameter to control dimensions —
user, origin (APP, SLACK or API_KEY) and date (UTC calendar day) — in any
combination. By default counts are broken down by origin, aggregated over the whole window.
Your API key authorizes its own product, but the response covers every product in that
organization, so a single key gives org-wide visibility. Requires prompt usage tracking to
be enabled for your organization.
Both dates are optional: end_date defaults to today (UTC) and start_date to 30 days
before end_date, so calling with no date parameters returns the last 30 days. The response
always echoes the resolved window.
Dimension fields appear on rows only when the matching breakdown_by value was requested.
Authorizations
API key obtained from the ClarityQ dashboard.
Path Parameters
Query Parameters
First UTC calendar day to include (YYYY-MM-DD). Defaults to 30 days before end_date.
Last UTC calendar day to include, inclusive (YYYY-MM-DD). Defaults to today (UTC).
Dimensions to break the counts down by (repeatable): user, origin, date. Product is always included. Defaults to origin.
Extra dimensions a prompt usage row can be broken down by (product is always included).
user, origin, date Restrict to these products in the org (repeatable). Defaults to all products.
Restrict to these users (repeatable). Defaults to all users.
Filter to users whose email or full name contains this text.
Restrict to a single prompt origin (APP, SLACK, API_KEY). Defaults to all origins. Channel a prompt was sent through, used to filter the usage export.
APP, SLACK, API_KEY Response
Successful Response
Org-wide prompt usage for a date window, one row per requested dimension combination.
First UTC calendar day included in the window (YYYY-MM-DD)
Last UTC calendar day included in the window, inclusive (YYYY-MM-DD)
Total prompts across all rows in the response
Extra dimensions the rows are broken down by (product is always included)
Extra dimensions a prompt usage row can be broken down by (product is always included).
user, origin, date Prompt-count buckets, one per product and requested dimension combination