Start an organization usage CSV export
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const usageExport = await client.organizations.usageExports.create({ organizationId: '<organizationId>', start_date: '2026-08-01', end_date: '2026-08-01',});console.log(usageExport);curl -X POST 'https://app.flora.ai/api/v1/organizations/<organizationId>/usage-exports' \ -H 'Authorization: Bearer $FLORA_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "start_date": "2026-08-01", "end_date": "2026-08-01"}'Queues a CSV export of every charged generation and technique run across the organization’s workspaces for an inclusive UTC day range of at most 366 days. Columns: Workspace, Date, Project ID, Project Name, User Email, Modality, Model, Media URL, Cost, Modifiers, Usage pool. The export builds in the background; poll GET /organizations/{organizationId}/usage-exports/{exportId} until status is completed, then download the listed files. A copy of the download link is also emailed to the credential’s user. One export per user may be in progress at a time; a second request within a few minutes returns rate_limited. 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
Request Body required
Section titled “Request Body required ”object
First UTC day to include (YYYY-MM-DD)
Last UTC day to include (YYYY-MM-DD)
Responses
Section titled “ Responses ”Export queued.
object
Usage export identifier
Organization identifier
Queued and running exports have no files yet; poll until completed or failed
UTC calendar day in YYYY-MM-DD form
UTC calendar day in YYYY-MM-DD form
Workspaces included in the export
When the export was requested (ms since epoch)
CSV parts to download; empty until the export completes
object
1-based part number; large exports are split
CSV filename
Direct download URL for this CSV part
Data rows in this part
Size of this part in bytes
Example
{ "export_id": "export_abc123", "organization_id": "org_abc123", "status": "queued", "start_date": "2026-08-01", "end_date": "2026-08-01"}