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

# usage

> Spend by key, identity, tool or day — client.usage.

Scope `billing:read` (or `tools:read`, held by every key preset). Guide: [Usage and logs](https://vetta.sh/docs/developers/usage-and-logs.md).

## get

```ts theme={"system"}
client.usage.get(query?: { by?: "key" | "identity" | "tool" | "day"; from?: string; to?: string }): Promise<Usage>
```

`GET /v1/usage`. `{ by, from, to, total_micro_usd, rows: [{ key, label, cost_micro_usd, calls }] }`.

```ts theme={"system"}
const byKey = await client.usage.get({ by: "key" });
```


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