Reports
Run Token Factory Usage and Analytics charts for org admins and members.
Reports
Prefix: /api/v1/report/runreport/external/tokenfactory/usage
See Overview for authentication.
Each endpoint runs one Token Factory Usage & Analytics chart and returns its data. Org admin endpoints cover the whole organization. Member endpoints (my-…) cover only the calling user.
Endpoint summary
| Method | Path | Audience |
|---|---|---|
| POST | /report/runreport/external/tokenfactory/usage/spend | Org admin |
| POST | /report/runreport/external/tokenfactory/usage/tokens | Org admin |
| POST | /report/runreport/external/tokenfactory/usage/requests | Org admin |
| POST | /report/runreport/external/tokenfactory/usage/avg-response-time | Org admin |
| POST | /report/runreport/external/tokenfactory/usage/tokens-used | Org admin |
| POST | /report/runreport/external/tokenfactory/usage/output-tokens | Org admin |
| POST | /report/runreport/external/tokenfactory/usage/my-spend | Member |
| POST | /report/runreport/external/tokenfactory/usage/my-tokens | Member |
| POST | /report/runreport/external/tokenfactory/usage/my-requests | Member |
| POST | /report/runreport/external/tokenfactory/usage/my-avg-response-time | Member |
Common request and response
All report endpoints take the same optional query and body. Optional query: formatResponse=true.
Request body (optional). Omit the body or send an empty filters object to run with no extra filters. Filter keys must be field API names on the report's source object. A scalar value becomes EQ. An array becomes IN.
{
"filters": {
"service_id": "optional-uuid"
}
}| Field | Required | Description |
|---|---|---|
filters | no | Map of field API name to a value or array. Empty or omitted means no additional filters |
Response 200 — the report payload for that chart.
Response when the report is not seeded on the tenant:
{
"status": 500,
"error": "Platform Error",
"message": "Report not found with slug: tokenfactory/usage/spend"
}Get spend
Returns the data for the Spend chart on the org admin Usage & Analytics view.
POST /api/v1/report/runreport/external/tokenfactory/usage/spend
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
{ "filters": {} }curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$BASE/report/runreport/external/tokenfactory/usage/spend" \
-d '{ "filters": {} }'Get input tokens
Returns the data for the Tokens (input) chart on the org admin Usage & Analytics view.
POST /api/v1/report/runreport/external/tokenfactory/usage/tokens
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
{ "filters": {} }curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$BASE/report/runreport/external/tokenfactory/usage/tokens" \
-d '{ "filters": {} }'Get requests
Returns the data for the Requests chart on the org admin Usage & Analytics view.
POST /api/v1/report/runreport/external/tokenfactory/usage/requests
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
{ "filters": {} }curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$BASE/report/runreport/external/tokenfactory/usage/requests" \
-d '{ "filters": {} }'Get average response time
Returns the data for the Avg response time chart on the org admin Usage & Analytics view.
POST /api/v1/report/runreport/external/tokenfactory/usage/avg-response-time
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
{ "filters": {} }curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$BASE/report/runreport/external/tokenfactory/usage/avg-response-time" \
-d '{ "filters": {} }'Get tokens used
Returns the data for the Tokens chart on the org admin Usage & Analytics view.
POST /api/v1/report/runreport/external/tokenfactory/usage/tokens-used
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
{ "filters": {} }curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$BASE/report/runreport/external/tokenfactory/usage/tokens-used" \
-d '{ "filters": {} }'Get output tokens
Returns the data for the Output tokens chart on the org admin Usage & Analytics view.
POST /api/v1/report/runreport/external/tokenfactory/usage/output-tokens
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
{ "filters": {} }curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$BASE/report/runreport/external/tokenfactory/usage/output-tokens" \
-d '{ "filters": {} }'Get my spend
Returns the data for the Spend chart on the member Usage & Analytics view.
POST /api/v1/report/runreport/external/tokenfactory/usage/my-spend
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
{ "filters": {} }curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$BASE/report/runreport/external/tokenfactory/usage/my-spend" \
-d '{ "filters": {} }'Get my tokens
Returns the data for the Tokens chart on the member Usage & Analytics view.
POST /api/v1/report/runreport/external/tokenfactory/usage/my-tokens
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
{ "filters": {} }curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$BASE/report/runreport/external/tokenfactory/usage/my-tokens" \
-d '{ "filters": {} }'Get my requests
Returns the data for the Requests chart on the member Usage & Analytics view.
POST /api/v1/report/runreport/external/tokenfactory/usage/my-requests
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
{ "filters": {} }curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$BASE/report/runreport/external/tokenfactory/usage/my-requests" \
-d '{ "filters": {} }'Get my average response time
Returns the data for the Avg response time chart on the member Usage & Analytics view.
POST /api/v1/report/runreport/external/tokenfactory/usage/my-avg-response-time
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN
{ "filters": {} }curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$BASE/report/runreport/external/tokenfactory/usage/my-avg-response-time" \
-d '{ "filters": {} }'