---
title: "Usage and billing API"
description: "Read storage and usage, and manage prepaid balances and invoices."
canonical_url: "https://docs.flashdrive.space/reference/usage-and-billing-api"
---
# Usage and billing API

> Read storage and usage, and manage prepaid balances and invoices.

Free, Personal and Team plans include pooled storage and activity; data transfer is free. Current prices are on the [pricing page](https://flashdrive.space/pricing/). See [usage](https://docs.flashdrive.space/platform/usage), [billing](https://docs.flashdrive.space/platform/billing) and [storage and upgrades](https://docs.flashdrive.space/platform/storage-and-upgrades) for how they work in the Console.

These routes require a signed-in user's access token; API keys cannot use them (`billing_session_required` or `human_session_required`). Organization owners and admins manage billing and storage. Other workspace members can read their workspace's storage. Amounts in US dollars are strings with six decimal places, such as `"12.500000"`, and byte counts are decimal strings.

See [authentication](https://docs.flashdrive.space/reference/authentication) for request headers, and [errors and recovery](https://docs.flashdrive.space/reference/errors) for failed requests.

## Usage

### GET `/v1/organizations/{organization_id}/usage`

Read the organization's metered usage for a period. Requires organization owner or admin.

<table>
<thead>
  <tr>
    <th>
      Query
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        from
      </code>
    </td>
    
    <td>
      First UTC date, <code>
        YYYY-MM-DD
      </code>
      
      , inclusive.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        to
      </code>
    </td>
    
    <td>
      Last UTC date, <code>
        YYYY-MM-DD
      </code>
      
      , exclusive. The period is 1 to 90 days; the default is the last 30 days including today. Other ranges return 400 <code>
        invalid_reporting_period
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        workspace_id
      </code>
      
      , <code>
        key_id
      </code>
    </td>
    
    <td>
      Optional filters: a workspace, and an API key UUID or <code>
        session
      </code>
      
       for signed-in activity.
    </td>
  </tr>
</tbody>
</table>

**200**: `period` (`from` and `to`) and `lines`, one per metered item:

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        line
      </code>
    </td>
    
    <td>
      What was metered, such as <code>
        storage
      </code>
      
      , <code>
        reads
      </code>
      
       or <code>
        writes
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        quantity
      </code>
    </td>
    
    <td>
      How much: operations counted, or GB-months for storage.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        unit
      </code>
    </td>
    
    <td>
      The unit of <code>
        quantity
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        unit_price_usd
      </code>
    </td>
    
    <td>
      The price per <code>
        price_per
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        price_per
      </code>
    </td>
    
    <td>
      What one price covers, such as <code>
        GB-month
      </code>
      
      , <code>
        read
      </code>
      
       or <code>
        1,000 reads
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cost_usd
      </code>
    </td>
    
    <td>
      The metered cost for the period, at each day's price.
    </td>
  </tr>
</tbody>
</table>

`filter_options` lists the workspaces and API keys you can filter by. The response can carry other fields; ignore those you do not use.

### GET `/v1/workspaces/{workspace_id}/overview`

Read a workspace's drives and stored bytes. **200**: `workspace_id`, `drives_count`, `documents_count` (files), `source_bytes` (bytes stored) and `drives`, each with `id`, `name`, `status` (`creating`, `ready` or `failed`), `documents_count` and `source_bytes`. Organization and workspace totals are batched and may lag recent changes.

## Credits

### GET `/v1/organizations/{organization_id}/billing/wallet`

Read the organization's prepaid balance. Historical credit-source fields may remain for compatibility; they do not describe current plan allowances.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        currency
      </code>
    </td>
    
    <td>
      <code>
        usd
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        balance_usd
      </code>
    </td>
    
    <td>
      Total balance.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reserved_usd
      </code>
    </td>
    
    <td>
      Credits held for work in progress.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        available_usd
      </code>
    </td>
    
    <td>
      Credits you can spend now.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        purchased_credits_usd
      </code>
    </td>
    
    <td>
      Credits from purchases.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        auto_topup_credits_usd
      </code>
    </td>
    
    <td>
      Credits from auto-topup, available until used.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subscription_credits_usd
      </code>
    </td>
    
    <td>
      All subscription-sourced credits.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expiring_subscription_credits_usd
      </code>
    </td>
    
    <td>
      Credits left from earlier plans that expire.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subscription_credits_expire_at
      </code>
    </td>
    
    <td>
      When those expire, or null.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        promotional_credits_usd
      </code>
    </td>
    
    <td>
      Available promotional credits.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        promotional_grants
      </code>
    </td>
    
    <td>
      Each grant's <code>
        id
      </code>
      
      , <code>
        amount_usd
      </code>
      
      , <code>
        description
      </code>
      
      , <code>
        created_at
      </code>
      
       and <code>
        expires_at
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        storage_allowance
      </code>
    </td>
    
    <td>
      <code>
        effective_storage_bytes
      </code>
      
      , <code>
        used_storage_bytes
      </code>
      
       and <code>
        reserved_storage_bytes
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      Billing state.
    </td>
  </tr>
</tbody>
</table>

### POST `/v1/organizations/{organization_id}/billing/purchases`

Buy credits. Requires `Idempotency-Key`. Body: `amount_usd`, a whole number of dollars, at least $10, within the amounts the Console offers; another amount returns 400 `invalid_credit_amount`. **200**: `id`, `state` and `checkout_url`.

Open `checkout_url` to pay, then read the purchase. A browser redirect alone does not confirm payment. Reuse the same key to retry the same purchase.

### GET `/v1/organizations/{organization_id}/billing/purchases/{purchase_id}`

Read a purchase: `id`, `state` (`pending`, `paid`, `expired` or `failed`) and `amount_usd`.

### GET `/v1/organizations/{organization_id}/billing/activity`

List credit activity, newest first. Requires organization owner or admin.

<table>
<thead>
  <tr>
    <th>
      Query
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        limit
      </code>
      
      , <code>
        cursor
      </code>
    </td>
    
    <td>
      1 to 100, default 50. Keep the same filter while you page.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        activity_type
      </code>
    </td>
    
    <td>
      Optional filter, such as <code>
        purchase
      </code>
      
      , <code>
        subscription
      </code>
      
      , <code>
        storage
      </code>
      
      , <code>
        promotional
      </code>
      
      , <code>
        refund
      </code>
      
      , <code>
        dispute
      </code>
      
       or <code>
        expiration
      </code>
      
      .
    </td>
  </tr>
</tbody>
</table>

Each entry has `id`, `type`, `description`, `amount_usd` (positive adds credit, negative uses it), `occurred_at` and `ongoing` (true while a daily entry is still adding up).

## Automatic top-up

Automatic top-up is not available at launch. Add prepaid credit with a one-time purchase when needed.

## Invoices and payment methods

### GET `/v1/organizations/{organization_id}/billing/invoices`

List invoices, newest first. Requires organization owner or admin. Query: `limit` (1 to 100, default 50) and `cursor` (it works only for the user who received it). Each entry has `id`, `number`, `issued_at`, `description`, `currency` (such as `usd`), `total_cents` (a decimal string), `status` (such as `paid` or `open`), `hosted_url` and `pdf_url`.

### POST `/v1/organizations/{organization_id}/billing/portal`

Open the payment portal to manage payment methods. Requires `Idempotency-Key`; send `{}`. **200**: `portal_url`.

## Storage allowances

Storage pools across the organization. Free includes 10 GB, Personal 500 GB, and Team 1 TB per paid seat. Add storage in 500 GB blocks in Billing. A drive still has its own 1 TB and 500,000-file ceilings. See [billing](https://docs.flashdrive.space/platform/billing) and [limits](https://docs.flashdrive.space/reference/limits).

Paid plans include guaranteed activity capacity, then unlimited activity subject to platform capacity. We will not bill you extra without contacting you first.


## Sitemap

See the full [sitemap](https://docs.flashdrive.space/sitemap.md) for all pages.
