> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Administration API: Usage

> Read the DinoAI credits and billed Bolt run time of your workspaces for any period of up to 366 days, summed or per workspace, with the Administration API.

Read your account's Bolt and DinoAI usage for a period from code, summed over the workspaces your key can reach or one workspace at a time. Use it to feed usage into your own reports or chargeback.

> [!NOTE]
>
> **Prerequisites:**
>
> * These operations are part of the Enterprise plan. On other plans, they fail with `PLAN_UPGRADE_REQUIRED`.
> * An account API key or a workspace API key. `usage` needs no `X-Paradime-Workspace` header: it covers every workspace the key can reach, or the one you name in `workspaceUid`.
> * The **Usage viewer** capability group.
>
> Keys, errors, and pagination work the same in every area. See [Conventions](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md).

## Operations

| Operation | Type | What it does | Capability group |
| - | - | - | - |
| [`usage`](https://docs.paradime.io/graphql-reference/queries/usage) | Query | Sums Bolt and DinoAI usage over a period, for one workspace or every workspace the key can reach. | Usage viewer |
| [`Usage.workspaces`](https://docs.paradime.io/graphql-reference/types/Usage) | Field | The same period's usage, one workspace at a time, ordered by workspace uid. | Usage viewer |
| [`Workspace.usage`](https://docs.paradime.io/graphql-reference/types/Workspace) | Field | One workspace's usage in a period. | Usage viewer |

## What the numbers count

| Field | What it counts |
| - | - |
| `dinoAi.credits` | The DinoAI credits spent. A call counts in the period it was recorded in. Calls that are not billed are left out. |
| `dinoAi.backgroundAgentCredits` | The part of `credits` that DinoAI agents spent running in the background, rather than a person. |
| `bolt.billedSeconds` | The billed Bolt run time, in seconds. A run counts in the period it ended in. Divide by 60 for minutes. |

The counters are `BigInt` values: read them as 64-bit integers. A recent period can still grow while runs end. Deleted workspaces are left out, so a total for a period with a deleted workspace doesn't include that workspace's usage.

## Read usage for a period

`period` runs from `from`, included, up to `to`, excluded, and is at most 366 days long. A time without an offset is UTC. For a calendar month, send the first instant of the month and the first instant of the next one, in UTC.

Leave out `workspaceUid` to sum every workspace the key can reach: a workspace key's own, or every workspace an account key is granted. Select `workspaces` for the same period one workspace at a time.

```graphql theme={"system"}
query MonthlyUsage($period: UsagePeriodInput!) {
  usage(period: $period) {
    from
    to
    dinoAi {
      credits
      backgroundAgentCredits
    }
    bolt {
      billedSeconds
    }
    workspaces(first: 100) {
      totalCount
      edges {
        node {
          workspace {
            uid
            name
          }
          dinoAi {
            credits
            backgroundAgentCredits
          }
          bolt {
            billedSeconds
          }
        }
      }
    }
  }
}
```

```json theme={"system"}
{
  "period": {
    "from": "2026-10-01T00:00:00Z",
    "to": "2026-11-01T00:00:00Z"
  }
}
```

> [accordion] Example response
>
> ```json theme={"system"}
> {
>   "data": {
>     "usage": {
>       "from": "2026-10-01T00:00:00+00:00",
>       "to": "2026-11-01T00:00:00+00:00",
>       "dinoAi": { "credits": 48210000, "backgroundAgentCredits": 31950000 },
>       "bolt": { "billedSeconds": 912600 },
>       "workspaces": {
>         "totalCount": 2,
>         "edges": [
>           {
>             "node": {
>               "workspace": { "uid": "k2m9xq4w7v1d3h8p", "name": "analytics" },
>               "dinoAi": { "credits": 40100000, "backgroundAgentCredits": 29800000 },
>               "bolt": { "billedSeconds": 802800 }
>             }
>           },
>           {
>             "node": {
>               "workspace": { "uid": "w4kq8m2x9v7d1h3p", "name": "marketing" },
>               "dinoAi": { "credits": 8110000, "backgroundAgentCredits": 2150000 },
>               "bolt": { "billedSeconds": 109800 }
>             }
>           }
>         ]
>       }
>     }
>   }
> }
> ```

To read one workspace, pass its uid in `workspaceUid`, or select `usage` on the workspace:

```graphql theme={"system"}
query WorkspaceUsage($workspaceUid: String, $period: UsagePeriodInput!) {
  workspace(workspaceUid: $workspaceUid) {
    name
    usage(period: $period) {
      dinoAi {
        credits
      }
      bolt {
        billedSeconds
      }
    }
  }
}
```

```json theme={"system"}
{
  "workspaceUid": "k2m9xq4w7v1d3h8p",
  "period": {
    "from": "2026-11-01T00:00:00Z",
    "to": "2026-11-27T00:00:00Z"
  }
}
```

## Errors

These are the cases specific to usage. For the error format and the codes every area shares, see [Errors](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md#errors).

| Code | When |
| - | - |
| `VALIDATION_FAILED` | `to` is not after `from`, or the period is longer than 366 days. `extensions.field` is `["period", "to"]`. |
| `NOT_FOUND` | The key can't reach the `workspaceUid`. |

## Related

* [Python SDK: Usage](https://docs.paradime.io/developers/python-sdk/modules/admin/usage.md): the same reads in `paradime.admin.usage`.
* [Paradime CLI: `paradime admin`](https://docs.paradime.io/developers/paradime-cli/admin-cli): `paradime admin usage`.
* [DinoAI credits](https://docs.paradime.io/products/dino-ai/dinoai-credits.md) and [Budget & Consumption](https://docs.paradime.io/products/dino-ai/budget-and-consumption.md): how DinoAI credits work, and spend in the app.
* [Administration API: DinoAI](https://docs.paradime.io/developers/graphql-api/admin-api/dinoai#set-consumption-budgets): set monthly DinoAI budgets.


## Related topics

- [Administration API](https://docs.paradime.io/developers/graphql-api/admin-api/index.md)
- [Administration API: Conventions](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md)
- [Administration API: API keys](https://docs.paradime.io/developers/graphql-api/admin-api/api-keys.md)
- [Administration API: set up and run workspaces from code](https://docs.paradime.io/changelog/2026-11-26/administration-api.md)
- [Administration API: Notifications](https://docs.paradime.io/developers/graphql-api/admin-api/notifications.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.