Get organization usage
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const organization = await client.organizations.getUsage({ organizationId: '<organizationId>',});console.log(organization);curl -X GET 'https://app.flora.ai/api/v1/organizations/<organizationId>/usage' \ -H 'Authorization: Bearer $FLORA_API_KEY'Returns usage charged across every workspace in an organization for an inclusive UTC day range (default: the last 30 days), as USD totals and run counts. Pass group_by to add one breakdown: per workspace, per member, per model, or per day. The figures come from the same aggregates as the in-app Organization Analytics tab; for per-generation detail with project and user columns, create a usage export instead. Requires an organization with multiple workspaces enabled, and the credential’s user must hold billing permissions in that organization. An API key works for the organization that owns its workspace; an OAuth token works for any organization the user administers. Other organizations return 403.
Error responses use the standard error body.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Organization identifier
Organization identifier
Query Parameters
Section titled “Query Parameters ”First UTC day to include (YYYY-MM-DD). Defaults to 29 days before end_date.
First UTC day to include (YYYY-MM-DD). Defaults to 29 days before end_date.
Last UTC day to include (YYYY-MM-DD). Defaults to today (UTC).
Last UTC day to include (YYYY-MM-DD). Defaults to today (UTC).
Breakdown axis. workspace: one row per organization workspace. user: one row per member (plus agent-attributed pool spend). model: one row per model endpoint, with all technique runs combined under model_id technique. day: one row per UTC day.
Breakdown axis. workspace: one row per organization workspace. user: one row per member (plus agent-attributed pool spend). model: one row per model endpoint, with all technique runs combined under model_id technique. day: one row per UTC day.
Responses
Section titled “ Responses ”Organization usage returned.
object
Organization identifier
Inclusive UTC day range the figures cover
object
UTC calendar day in YYYY-MM-DD form
UTC calendar day in YYYY-MM-DD form
Usage charged across the organization in USD, derived from the same per-day aggregate as the Organization Analytics tab. Breakdown rows and CSV exports sum exact per-charge amounts, so their totals can differ from this figure by rounding, well under 0.1%.
Charged runs across the organization
Charged runs split by output modality
object
Text generation runs
Image generation runs
Video generation runs
Audio generation runs
Technique runs
Runs whose modality could not be classified. Includes technique runs recorded before technique became its own category, which the in-app analytics count the same way.
Every active workspace in the organization; the totals cover all of them
object
Workspace identifier
Workspace name
Per-workspace rows, highest cost first. Present when group_by is workspace.
object
Workspace identifier
Workspace name
Usage charged in USD
Charged runs
Per-member rows summed across every workspace, highest cost first. Present when group_by is user. Covers people who currently hold a membership in one of the workspaces; spend by members since removed stays in the totals but is not itemized here — use a usage export for that.
Per-model rows summed across workspaces, highest cost first. Present when group_by is model. Rows cover the live and static model catalogs; spend on endpoints retired from both is reported in unattributed_cost.
object
Model endpoint ID, or technique for every technique run combined
Output modality of the model
Usage charged in USD
Charged runs
With group_by=model: USD charged in the covered workspaces that no model row accounts for. Mostly endpoints no longer in any catalog; a small residue can also come from rounding between the per-day and per-model aggregates. Zero when every row was readable. Present when group_by is model.
One row per UTC day in the period, oldest first. Present when group_by is day.
object
UTC calendar day in YYYY-MM-DD form
Usage charged in USD
Charged runs
Present only when a model breakdown covered the top workspaces by cost rather than all of them; totals still cover every workspace.
object
Workspaces the model breakdown was read from
Active workspaces in the organization
Example
{ "organization_id": "org_abc123", "period": { "start_date": "2026-08-01", "end_date": "2026-08-01" }, "workspaces": [ { "workspace_id": "ws_abc123" } ], "group_by": "workspace", "by_workspace": [ { "workspace_id": "ws_abc123" } ], "by_user": [ { "kind": "member" } ], "by_model": [ { "model_id": "t2i-flux-2-pro", "category": "text" } ], "by_day": [ { "date": "2026-08-01" } ]}