# Aggregate spend / tokens for a window (/docs/reference/management/getUsageAggregate)

> For AI agents, the [documentation index](https://bitrouter-docs-staging.up.railway.app/llms.txt) lists all pages. Append .md to a documentation URL to read its Markdown.

`GET /v1/namespaces/{nsid}/usage`

Uses immutable billing-audit charges when present and legacy request charges only when no audit exists. Billing anomaly counts keep null charges visible. Defaults to the last 30 days.

*Requires the `usage:read` scope.*

## Authentication

header parameter `x-api-key` or `Authorization: Bearer <token>`.

Base URL: `https://api.bitrouter.ai`

## Parameters

* `nsid` (path, required): Id of the target namespace. Must be owned by the caller (or equal a namespace-baked credential's own namespace), else 404.
* `from` (query): Inclusive RFC 3339 timestamp lower bound.
* `to` (query): Exclusive RFC 3339 timestamp upper bound.

## Responses

* `200` Namespace billing and token aggregate. (application/json)
* `401` Credential missing or did not verify. (application/json)
* `403` Credential is valid but lacks the required scope. (application/json)
* `404` Resource not found (or owned by a different account). (application/json)

[Full OpenAPI schema](https://bitrouter-docs-staging.up.railway.app/openapi.json)