Programmatic spend for the calling key
FlexAI-specific shape (intentionally not OpenAI’s /v1/organization/usage/*
— that surface requires org/team scoping which FlexAI does not yet model).
Returns total spend, total tokens, per-model breakdown, and a daily
history for the API key in the Authorization header. Cached per-key
for 60 seconds. The total_spend value reconciles against your
invoices within 1% tolerance.
Authorizations
Virtual API key. Create one from the
FlexAI dashboard. Pass as
Authorization: Bearer sk-xxxx.
Query Parameters
Number of trailing days to include in daily.
1 <= x <= 365Response
Successful response
usage USD Per-model spend rows. Multi-modality models appear once per
modality (image+image_edit, etc.) — use model+modality as
the composite key. Text rows have modality=text,
units_consumed=null, billing_unit=tokens.