Last verified 2026-08-15 by executing the recipe end to end.
The recipe
main.sh
How it works
- Query project token usage
is a
POST, not aGET, because the date range and grouping travel in the body. - Every analytics measure shares one request shape:
startDate,endDate, and anintervalofday,hour, ormonth. Swapping the measure in the path is the only change needed, which is why this recipe queries three in a loop. - Dates are ISO 8601. A range whose end precedes its start returns an empty series rather than an error, so assert on the shape you expect.
- The same measures exist at workspace and organization scope. See the Analytics section for the full list.
- Usage attributed to individual functions, playbooks, and tools is a separate set of measures under the same prefix.