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

MethodPathAudience
POST/report/runreport/external/tokenfactory/usage/spendOrg admin
POST/report/runreport/external/tokenfactory/usage/tokensOrg admin
POST/report/runreport/external/tokenfactory/usage/requestsOrg admin
POST/report/runreport/external/tokenfactory/usage/avg-response-timeOrg admin
POST/report/runreport/external/tokenfactory/usage/tokens-usedOrg admin
POST/report/runreport/external/tokenfactory/usage/output-tokensOrg admin
POST/report/runreport/external/tokenfactory/usage/my-spendMember
POST/report/runreport/external/tokenfactory/usage/my-tokensMember
POST/report/runreport/external/tokenfactory/usage/my-requestsMember
POST/report/runreport/external/tokenfactory/usage/my-avg-response-timeMember

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"
  }
}
FieldRequiredDescription
filtersnoMap 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": {} }'