Skip to main content
GET
Get prompt usage
Returns 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 (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.
Example request
Example response

Authorizations

X-API-Key
string
header
required

API key obtained from the ClarityQ dashboard.

Path Parameters

product_id
string<uuid>
required

Query Parameters

start_date
string<date> | null

First UTC calendar day to include (YYYY-MM-DD). Defaults to 30 days before end_date.

end_date
string<date> | null

Last UTC calendar day to include, inclusive (YYYY-MM-DD). Defaults to today (UTC).

breakdown_by
enum<string>[]

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).

Available options:
user,
origin,
date
product_ids
string<uuid>[] | null

Restrict to these products in the org (repeatable). Defaults to all products.

user_ids
string<uuid>[] | null

Restrict to these users (repeatable). Defaults to all users.

search
string | null

Filter to users whose email or full name contains this text.

origin
enum<string> | null

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.

Available options:
APP,
SLACK,
API_KEY

Response

Successful Response

Org-wide prompt usage for a date window, one row per requested dimension combination.

start_date
string<date>
required

First UTC calendar day included in the window (YYYY-MM-DD)

end_date
string<date>
required

Last UTC calendar day included in the window, inclusive (YYYY-MM-DD)

total_prompts
integer
required

Total prompts across all rows in the response

breakdown_by
enum<string>[]

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).

Available options:
user,
origin,
date
rows
PromptUsageRow · object[]

Prompt-count buckets, one per product and requested dimension combination