Get Granular Usage
Changed onGet granular usage data with flexible grouping.
kind selects the billable usage domain:
- traces (default): trace counts.
- langsmith_deployments: LangSmith Deployment metrics (nodes executed, agent runs, agent uptime). The three Deployment fields are populated and traces is 0.
trace_tier (only meaningful for kind=traces) optionally restricts results to a single retention tier (longlived = extended retention, shortlived = standard retention). When group_by=trace_tier, results are split into one record per retention tier per time bucket.
workspace_ids filters results to the specified workspaces. Only workspaces the user has read access to are included. When omitted, all workspaces the user can read are included (avoids enumerating every workspace id in the URL, which can exceed proxy header limits).
Request
- Base URLhttps://api.smith.langchain.com
- URLhttps://api.smith.langchain.com/api/v1/orgs/current/billing/granular-usage
- Auth
- API key in header X-API-Key
- or API key in header X-Organization-Id
- or HTTP bearer
Query parameters
Dimensions for grouping granular usage data.
Which billable usage domain a granular-usage query targets.
- traces: trace counts.
- langsmith_deployments: LangSmith Deployment metrics (nodes executed, agent runs, agent uptime).
Default is traces for backward compatibility — existing callers of GET /granular-usage without a kind query param get the same response shape they always did.
Response
Successful Response
Changes
- breaking
the
/response's property type changed fromobjecttostringfor status - breaking
removed the required property
//from the response with the status - breaking
removed the required property
//from the response with the status - breaking
removed the required property
//from the response with the status - info
added the new optional
queryrequest parameterkind - info
added the new optional
queryrequest parametertrace_tier - info
the
queryrequest parameterworkspace_idsbecame optional - info
added the new enum value
trace_tierto thequeryrequest parametergroup_by - info
queryrequest parameterworkspace_idslist-of-types was widened by adding typesnull - info
for the
queryrequest parameterworkspace_ids, the type was generalized fromarrayto no type - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
///to the response with the status - info
added the optional property
//to the response with the status
- breaking