> For the complete documentation index, see [llms.txt](https://docs.flora.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flora.ai/api/reference/organizations/getorganizationusage.md).

# Get organization usage

Get organization usage with the FLORA API: GET /organizations/{organizationId}/usage.

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.

```http
GET https://app.flora.ai/api/v1/organizations/{organizationId}/usage
```

* **Auth:** API key as a bearer token, `Authorization: Bearer $FLORA_API_KEY`. See [Authentication](https://docs.flora.ai/api/platform/authentication.md).
* **TypeScript SDK:** `client.organizations.getUsage()`.
* **Operation ID:** `getOrganizationUsage`.

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET 'https://app.flora.ai/api/v1/organizations/org_abc123/usage' \
  -H "Authorization: Bearer $FLORA_API_KEY"
```

{% endtab %}

{% tab title="TypeScript SDK" %}

```typescript
import { FloraClient } from '@flora-ai/flora';

const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });

const organization = await client.organizations.getUsage({
  organizationId: 'org_abc123',
});
console.log(organization);
```

{% endtab %}
{% endtabs %}

## Path parameters

| Name             | Type   | Required | Description                                                           |
| ---------------- | ------ | -------- | --------------------------------------------------------------------- |
| `organizationId` | string | Yes      | Organization identifier. Pattern: `^org_\S+$`. Example: `org_abc123`. |

## Query parameters

| Name         | Type   | Required | Description                                                                                                                                                                                                                                                                                       |
| ------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `start_date` | string | No       | First UTC day to include (YYYY-MM-DD). Defaults to 29 days before end\_date. Pattern: `^\d{4}-\d{2}-\d{2}$`. Example: `2026-08-01`.                                                                                                                                                               |
| `end_date`   | string | No       | Last UTC day to include (YYYY-MM-DD). Defaults to today (UTC). Pattern: `^\d{4}-\d{2}-\d{2}$`. Example: `2026-08-01`.                                                                                                                                                                             |
| `group_by`   | string | No       | 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. One of: `workspace`, `user`, `model`, `day`. |

## Responses

### 200: Organization usage returned.

| Field                          | Type             | Required | Description                                                                                                                                                                                                                                                                                                     |
| ------------------------------ | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `organization_id`              | string           | Yes      | Organization identifier. Pattern: `^org_\S+$`. Example: `org_abc123`.                                                                                                                                                                                                                                           |
| `period`                       | object           | Yes      | Inclusive UTC day range the figures cover                                                                                                                                                                                                                                                                       |
| `period.start_date`            | string           | Yes      | UTC calendar day in YYYY-MM-DD form. Pattern: `^\d{4}-\d{2}-\d{2}$`. Example: `2026-08-01`.                                                                                                                                                                                                                     |
| `period.end_date`              | string           | Yes      | UTC calendar day in YYYY-MM-DD form. Pattern: `^\d{4}-\d{2}-\d{2}$`. Example: `2026-08-01`.                                                                                                                                                                                                                     |
| `total_cost`                   | number           | Yes      | 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%. At least 0.                                     |
| `total_runs`                   | integer          | Yes      | Charged runs across the organization. At least 0.                                                                                                                                                                                                                                                               |
| `runs_by_category`             | object           | Yes      | Charged runs split by output modality                                                                                                                                                                                                                                                                           |
| `runs_by_category.text`        | integer          | Yes      | Text generation runs. At least 0.                                                                                                                                                                                                                                                                               |
| `runs_by_category.image`       | integer          | Yes      | Image generation runs. At least 0.                                                                                                                                                                                                                                                                              |
| `runs_by_category.video`       | integer          | Yes      | Video generation runs. At least 0.                                                                                                                                                                                                                                                                              |
| `runs_by_category.audio`       | integer          | Yes      | Audio generation runs. At least 0.                                                                                                                                                                                                                                                                              |
| `runs_by_category.technique`   | integer          | Yes      | Technique runs. At least 0.                                                                                                                                                                                                                                                                                     |
| `runs_by_category.unknown`     | integer          | Yes      | 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. At least 0.                                                                                                                              |
| `workspaces`                   | array of objects | Yes      | Every active workspace in the organization; the totals cover all of them                                                                                                                                                                                                                                        |
| `workspaces[].workspace_id`    | string           | Yes      | Workspace identifier. Pattern: `^ws_\S+$`. Example: `ws_abc123`.                                                                                                                                                                                                                                                |
| `workspaces[].name`            | string           | Yes      | Workspace name                                                                                                                                                                                                                                                                                                  |
| `group_by`                     | string or null   | Yes      | Breakdown that was requested; null when only totals were requested. One of: `workspace`, `user`, `model`, `day`.                                                                                                                                                                                                |
| `by_workspace`                 | array of objects | No       | Per-workspace rows, highest cost first. Present when group\_by is workspace.                                                                                                                                                                                                                                    |
| `by_workspace[].workspace_id`  | string           | Yes      | Workspace identifier. Pattern: `^ws_\S+$`. Example: `ws_abc123`.                                                                                                                                                                                                                                                |
| `by_workspace[].name`          | string           | Yes      | Workspace name                                                                                                                                                                                                                                                                                                  |
| `by_workspace[].cost`          | number           | Yes      | Usage charged in USD. At least 0.                                                                                                                                                                                                                                                                               |
| `by_workspace[].runs`          | integer          | Yes      | Charged runs. At least 0.                                                                                                                                                                                                                                                                                       |
| `by_user`                      | array of objects | No       | 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.                           |
| `by_user[].kind`               | string           | Yes      | member: a person with a workspace membership. agent: workspace-pool spend attributed to an agent (for example the FLORA agent) rather than to a member. One of: `member`, `agent`.                                                                                                                              |
| `by_user[].email`              | string or null   | Yes      | Member email; null for agent rows                                                                                                                                                                                                                                                                               |
| `by_user[].name`               | string           | Yes      | Display name                                                                                                                                                                                                                                                                                                    |
| `by_user[].cost`               | number           | Yes      | Usage charged in USD. At least 0.                                                                                                                                                                                                                                                                               |
| `by_model`                     | array of objects | No       | 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.                                                                                            |
| `by_model[].model_id`          | string           | Yes      | Model endpoint ID, or `technique` for every technique run combined. Example: `t2i-flux-2-pro`.                                                                                                                                                                                                                  |
| `by_model[].category`          | string           | Yes      | Output modality of the model. One of: `text`, `image`, `video`, `audio`, `technique`, `unknown`.                                                                                                                                                                                                                |
| `by_model[].cost`              | number           | Yes      | Usage charged in USD. At least 0.                                                                                                                                                                                                                                                                               |
| `by_model[].runs`              | integer          | Yes      | Charged runs. At least 0.                                                                                                                                                                                                                                                                                       |
| `unattributed_cost`            | number           | No       | 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. At least 0. |
| `by_day`                       | array of objects | No       | One row per UTC day in the period, oldest first. Present when group\_by is day.                                                                                                                                                                                                                                 |
| `by_day[].date`                | string           | Yes      | UTC calendar day in YYYY-MM-DD form. Pattern: `^\d{4}-\d{2}-\d{2}$`. Example: `2026-08-01`.                                                                                                                                                                                                                     |
| `by_day[].cost`                | number           | Yes      | Usage charged in USD. At least 0.                                                                                                                                                                                                                                                                               |
| `by_day[].runs`                | integer          | Yes      | Charged runs. At least 0.                                                                                                                                                                                                                                                                                       |
| `coverage`                     | object           | No       | Present only when a model breakdown covered the top workspaces by cost rather than all of them; totals still cover every workspace.                                                                                                                                                                             |
| `coverage.workspaces_included` | integer          | Yes      | Workspaces the model breakdown was read from. At least 0.                                                                                                                                                                                                                                                       |
| `coverage.workspaces_total`    | integer          | Yes      | Active workspaces in the organization. At least 0.                                                                                                                                                                                                                                                              |

## Errors

Every error has the same body: `error.code`, `error.message`, and `error.fields` on validation errors. See [Errors](https://docs.flora.ai/api/platform/errors.md) for how to recover from each code.

| Status | Code                                         | Meaning                                                                             |
| ------ | -------------------------------------------- | ----------------------------------------------------------------------------------- |
| 400    | `invalid_json`, `input_validation_error`     | The body isn't valid JSON, or an input failed validation (`fields` lists each one). |
| 401    | `unauthorized`, `invalid_api_key`            | The API key is missing, invalid or revoked.                                         |
| 402    | `insufficient_credits`                       | The workspace balance is too low for this request.                                  |
| 403    | `forbidden`, `paid_plan_required`            | The key can't do this, or the workspace plan doesn't include it.                    |
| 404    | `not_found`                                  | The resource doesn't exist or isn't visible to this key.                            |
| 409    | `idempotency_duplicate`, `revision_conflict` | Duplicate `Idempotency-Key` or a stale `base_revision`.                             |
| 429    | `rate_limited`                               | Too many requests. Back off and retry.                                              |
| 500    | `unknown_error`, `internal_error`            | Something failed on FLORA's side. Retry with backoff.                               |
| 503    | `temporarily_unavailable`                    | Authorization is temporarily unavailable. Retry later.                              |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flora.ai/api/reference/organizations/getorganizationusage.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
