---
title: "Usage · intentic sandbox API"
description: "What has been spent, grouped. Every route in the usage group of the intentic sandbox API, with its input, its answer and a playground."
url: "https://intentic.dev/api/usage/"
---

Models and accounts

# Usage

What has been spent, grouped

One read: the spending record over a range of days, grouped finely enough that every cost screen is a rearrangement of it rather than a second call.

**GET`/usage/rollup` What was spent, grouped**

The spending record over a range of days, grouped by day, provider, account and model. Everything a cost screen shows is a rearrangement of this one answer, so nothing needs a second call. Read-only: rows are written by the sandbox as turns end, which is what makes it worth trusting.

### What you send

| Field | Type | Where |
| --- | --- | --- |
| `from` First day to include, as YYYY-MM-DD… | string | query |
| `to` Last day to include, as YYYY-MM-DD… | string | query |

### What comes back

| Field | Type |
| --- | --- |
| `rows` Spending grouped by day, provider, account,… | object[] |
| `day` The day, as YYYY-MM-DD in UTC | string |
| `provider` Which model provider | string |
| `account` Which account | string |
| `model` Which model | string |
| `harness` Which agentic loop | string |
| `conversationId` Which conversation | string |
| `turns` Turns in this group | number |
| `inputTokens` Tokens sent | number |
| `outputTokens` Tokens received | number |
| `cacheReadTokens` Tokens served from cache | number |
| `cacheCreationTokens` Tokens written to cache | number |
| `costUsd` What the group cost, in dollars | number |
| `durationMs` Time spent, in milliseconds | number |

Try it answered in this tab

curl

```bash
curl "$SANDBOX/usage/rollup" \
 -H "x-intentic-control: $INTENTIC_TOKEN"
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.usage.rollup();
```

More in Models and accounts

[Previous ← Providers](https://intentic.dev/api/providers/)
