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

# Usage

> What a project's workflows and webhooks used over a period, in raw units.

```ts theme={null}
const usage = await client.usage.get({
  from: new Date("2026-11-01T00:00:00Z"),
  to: new Date("2026-12-01T00:00:00Z"),
});
usage.totals["workflows.runs"];
```

`GET /usage?from=<instant>&to=<instant>` answers the project's total for each
meter over the window: from `from`, included, to `to`, excluded. Both are
required RFC 3339 instants, and `from` must be before `to` (else `422
unprocessable`). Every meter is in the answer, `0` when nothing was used.

```json theme={null}
{
  "from": "2026-11-01T00:00:00.000Z",
  "to": "2026-12-01T00:00:00.000Z",
  "totals": {
    "workflows.runs": 12480,
    "workflows.steps": 58302,
    "workflows.events": 31077,
    "workflows.state_byte_hours": 2254857830400,
    "webhooks.deliveries": 4210,
    "webhooks.egress_bytes": 18400000
  }
}
```

| Meter | Counts |
| - | - |
| `workflows.runs` | Runs created |
| `workflows.steps` | Step attempts that finished, succeeded or failed |
| `workflows.events` | Events received |
| `workflows.state_byte_hours` | The project's stored run state at its sampled peak in each hour, in bytes, times one hour |
| `webhooks.deliveries` | Webhook delivery attempts that sent a request |
| `webhooks.egress_bytes` | The request body bytes of those attempts |

Totals update every few minutes; the current hour is not in them yet. These
are raw units, not a bill.

The route takes a secret key (`dtn_sk_`); any other key is `403
api_key_kind_not_allowed`.

## Console and management

The console reads the same totals at `GET /workflow_usage?projectId=<id>&from=<instant>&to=<instant>`
on its own address, signed in or with an OAuth token, for a member who may
read runs (admins and developers). The MCP tool `workflows_get_usage` takes
`projectId`, `from` and `to` ([MCP tools](https://docs.duraton.dev/workflows/mcp-tools.md)).
Every other meter of the project, the gateway's and the database's included,
is in [Project usage](https://docs.duraton.dev/projects/usage.md).


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