APIAnalytics

LLM spend summary

Subscription-vs-API cost split for a time range, using configured seat pricing. Accepts only seat-coherent filters: provider, user, and group scope both the usage legs and the priced seats; a model can't scope a seat, so there is no model param (and no auth_mode — the endpoint decomposes by auth path itself).

GET
/analytics/llm-spend-summary

Subscription-vs-API cost split for a time range, using configured seat pricing. Accepts only seat-coherent filters: provider, user, and group scope both the usage legs and the priced seats; a model can't scope a seat, so there is no model param (and no auth_mode — the endpoint decomposes by auth path itself).

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

Bearer token authentication. Send an API key (a saai_api_-prefixed token) as Authorization: Bearer <token>.

Required permission

view_llm_analytics

Query Parameters

scope?string

own returns only the caller's own records, even when they may see the whole organization. all, the default, returns everything the caller may see. It never widens what the caller may see.

Value in"all""own"
start_time*string
Formatdate-time
end_time*string
Formatdate-time
provider?array<>
user_id?array<>
user_group?array<string>

Response Body

The request has succeeded.

application/json
  1. response

Subscription-vs-API cost split for a time range, using configured seat pricing.

api_equivalent*number

List-price value of all usage in range (estimate).

Formatdouble
api_spend*number

API-equivalent of auth_mode=api usage — real, metered spend.

Formatdouble
subscription_spend*number

Configured seat price × active subscription seats per calendar month touched by the range. Configured, not invoiced.

Formatdouble
subscription_savings*number

API-equivalent of user-attributed subscription usage minus subscription spend.

Formatdouble
seat_pricing_configured*boolean

False until the org has any seat pricing configured; spend/savings are 0 then.

Example Request
curl -X GET 'https://your-org.aisecurity.services.us.connect.secureauth.com/api/v1/analytics/llm-spend-summary?start_time=2019-08-24T14%3A15%3A22Z&end_time=2019-08-24T14%3A15%3A22Z'
Example Response
{  "api_equivalent": 0.1,  "api_spend": 0.1,  "subscription_spend": 0.1,  "subscription_savings": 0.1,  "seat_pricing_configured": true}