> ## 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 and logs

> Where your balance went, by key, identity, tool or day, and every call your keys made.

## Usage

`GET /v1/usage` — scope `billing:read` (a key with `tools:read`, which every preset holds, also works).

**by** `string`

`key`, `identity`, `tool` or `day`.

**from** `string`

Start of the window (ISO 8601).

**to** `string`

End of the window (ISO 8601).

```json theme={"system"}
{
  "object": "usage",
  "by": "tool",
  "from": "2026-12-01T00:00:00Z",
  "to": "2026-12-08T00:00:00Z",
  "total_micro_usd": 4182000,
  "rows": [
    { "key": "tiktok.profile", "label": "TikTok · Get profile", "cost_micro_usd": 1240000, "calls": 620 },
    { "key": "image.generate", "label": "Image generation", "cost_micro_usd": 2942000, "calls": 74 }
  ]
}
```

`total_micro_usd` is the sum of your ledger debits in the window, so it matches your charges, including computer time
and media billed after the call. Per key and per day split those debits by who was charged and when. Per tool and per
identity use each call's own cost, and whatever the ledger charged beyond that (computer time, media renders, resource
fees) is on the row with `key: null`, so the rows always add up to the total. `calls` leaves out the console's own page
reads.
Your balance, top-ups and ledger are on the existing [credits](https://vetta.sh/docs/api/credits.md) routes.

### Balance and top-ups

Developer workspaces are prepaid. Top up in the console (**Usage → Top up**, $10 to $1,000 per top-up). The
first qualifying top-up marks the workspace **funded**. Before it, a gated call answers `402 funding_required` even
with credit left on the balance:

* Free credit covers: data, search and social data tools, image generation, model routing, stock media search, identities and inboxes, email to your own team, domain checks, paper trades, vaults and webhooks.
* Needs a first \$10 top-up: AI video, voice, music, sound effects, 3D, edits, clips and transcription; email to people outside your workspace; phone numbers and texts; live trades and buying domains (72 hours after your first top-up); computers, browsers and phone sandboxes; social posting; connected apps; hosted apps; identity verification; character training.

You can set a low-balance alert in **Settings**. Subscriptions and trials are a
studio feature and are not offered to developer workspaces.

## Logs

Every call a key or MCP connection makes in a developer workspace is logged, with its cost. Rows are kept 90 days; the
redacted arguments 30 days. Arguments never include message bodies: recipient lists become a count, subjects a length.

`GET /v1/logs` — scope `audit:read` (a key with `tools:read` also works).

**credential** `string`

A key or MCP connection id.

**tool** `string`

A tool slug.

**identity** `string`

An `idn_…` id.

**resource\_id** `string`

Any resource id.

**status** `string`

`2xx`, `4xx`, `5xx` or `held`.

**surface** `string`

`api`, `mcp`, `developers`, `developers/playground` or `cli`.

**request\_id** `string`

One `req_…` id.

**from** `string`

Start time.

**to** `string`

End time.

### The log entry

**id** `string`

The request id, `req_…`. It is the same id as a tool run's `id` and the `request_id` in an error.

**method** `string`

HTTP method.

**path** `string`

The route called.

**tool** `string | null`

The tool slug, for tool runs.

**status** `integer`

The HTTP status answered.

**error\_code** `string | null`

The error `code`, when it failed. See [Errors](https://vetta.sh/docs/api/errors.md).

**cost\_micro\_usd** `integer`

What the call was debited.

**duration\_ms** `integer`

How long it took.

**credential** `object`

`{ kind: "key" | "mcp" | "session", id, name }`.

**identity\_id** `string | null`

The identity the call acted for.

**resource\_id** `string | null`

The resource it touched.

**surface** `string`

Where it came from.

**approval\_id** `string | null`

The approval, if the call was held.

**args\_redacted** `object | null`

The arguments, redacted.

`GET /v1/logs/{request_id}` reads one entry and adds `audit`, the audit-log rows written by that request.

## From the SDK and CLI

```ts theme={"system"}
const byTool = await client.usage.get({ by: "tool" });
const failures = await client.logs.list({ status: "4xx" });
const one = await client.logs.get("req_01JD7S2N4Q6S8U0W2Y4A6C8E0G");
```

```bash theme={"system"}
naive usage show --by key
naive logs list --status 4xx --limit 50
naive logs show req_01JD7S2N4Q6S8U0W2Y4A6C8E0G
```


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