# GET /api/v1/usage

**Preview.** Ships with the next server release.

what the coding agents on the contour's machines used, per
machine, agent and UTC hour.

**In short:** `GET https://<contour>.cmdop.ai/api/v1/usage` with `Authorization: Bearer $CMDOP_TOKEN` (owner token).

## Query parameters

| Name | Type | Required | Meaning |
| --- | --- | --- | --- |
| `from` | `integer` | no | Start, unix seconds (default: seven days before `to`). |
| `to` | `integer` | no | End, unix seconds, not included (default: now). |

## Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | Agent usage per machine, agent and UTC hour | `application/json` `object[]` |
| `400` | A period that is empty, reversed or longer than 400 days | `application/json` |
| `401` | Unauthorized | `application/json` |
| `503` | Store unavailable | `application/json` |

## Response fields

| Field | Type | Always | Meaning |
| --- | --- | --- | --- |
| `agent` | `string` | yes | The agent's catalog id (`claude-code`, `codex`). |
| `agent_version` | `string` | no |  |
| `cache_read` | `integer` | yes |  |
| `cache_write` | `integer` | yes |  |
| `cost_amount` | `integer` | no | What the agent itself stated, in `cost_unit`; none when it stated nothing. |
| `cost_unit` | `string` | no |  |
| `hour` | `integer` | yes | Unix seconds, start of the UTC hour. |
| `input_uncached` | `integer` | yes | Input tokens without the cached part. |
| `machine` | `string` | yes |  |
| `machine_name` | `string` | yes |  |
| `model` | `string` | no |  |
| `output` | `integer` | yes | Output tokens, reasoning included. |
| `project` | `string` | no | The agent's working folder on that machine. |
| `reasoning` | `integer` | yes |  |
| `requests` | `integer` | yes |  |
| `sessions` | `integer` | yes | Distinct sessions in this hour; never add it across hours. |
| `token_quality` | `string` | yes | `reported`, `derived`, `estimated`, `absent` or `unknown`. |

## Example

```bash
curl -sS "https://<contour>.cmdop.ai/api/v1/usage" \
  -H "Authorization: Bearer $CMDOP_TOKEN"
```
