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

# Usage

> Check credits and rate limits for a single key or for the whole organization.

Anona meters every operation in credits and enforces a per-minute rate limit. These
endpoints report where you stand.

> [!NOTE]
>
> Token counts on [Reason](https://docs.memory.anonalabs.com/api-reference/reason.md) and ask-about-user responses cover the
> whole internal reasoning pass — several LLM calls of retrieval and synthesis — not just
> the answer text you receive. A short answer with a few hundred `output_tokens` is
> normal, and those totals are what credits are charged on.

| Method and path | Auth | Returns |
| - | - | - |
| `GET /v1/usage/me` | API key | Current credit balance and rate limit for the calling key's organization. |
| `GET /v1/usage` | Dashboard session | Credit usage over a period, with a time series. |
| `GET /v1/usage/breakdown` | Dashboard session | Per-operation breakdown across record, retrieve, reason, and chat. |

The organization endpoints back the dashboard and need a signed-in session — an API
key gets `401 session_required` there. `GET /v1/usage/me` is the one to call from
inside your application.

## Key usage

A lightweight balance check to run from inside your application.

```http theme={null}
GET https://api.anonalabs.com/v1/usage/me
Authorization: Bearer anona_live_...
```

```bash cURL theme={null}
curl https://api.anonalabs.com/v1/usage/me \
  -H "Authorization: Bearer anona_live_YOUR_KEY"
```

```python Python theme={null}
usage = client.get_usage()
print(usage["credits_remaining"], usage["rate_limit_per_min"])
```

```typescript TypeScript theme={null}
const usage = await anona.getUsage();
console.log(usage.credits_remaining, usage.rate_limit_per_min);
```

```json theme={null}
{
  "credits_remaining": 1487233,
  "credits_limit": 1500000,
  "credits_used": 12767,
  "rate_limit_per_min": 2000
}
```

## Response headers

Live limits are also returned on every response from a **metered endpoint** — the ones
that spend credits — so you can track them without an extra call. Control-plane
endpoints (spaces, keys, members, usage, billing) are not rate-limited and carry none of
these headers.

| Header | Meaning |
| - | - |
| `X-RateLimit-Limit` | Requests allowed in the current window. |
| `X-RateLimit-Remaining` | Requests left in the current window. |
| `X-RateLimit-Window` | Length of the window. |
| `X-Credits-Remaining` | Credits left on the organization's quota. |

## Organization usage

`GET /v1/usage` and `GET /v1/usage/breakdown` both back the usage views in the
dashboard. The period window is the `days` query parameter: how many days back from
now to count, 1 to 365, defaulting to 30. It is echoed as `period_days` in the
response.

```http theme={null}
GET https://api.anonalabs.com/v1/usage?days=7
Authorization: Bearer $SESSION
```

### Memory context

Both also report what memory injection cost your prompts on the
[drop-in proxy](https://docs.memory.anonalabs.com/api-reference/chat.md), and how much of it your provider had already seen.

```json theme={null}
{
  "total_memories_added": 412,
  "total_searches": 1980,
  "total_insights": 37,
  "period_days": 30,
  "series": [ "…" ],
  "memory_context": {
    "calls": 1204,
    "context_tokens": 386400,
    "cache_prefix_tokens": 271900
  }
}
```

| Field | Meaning |
| - | - |
| `calls` | Proxied chat turns in the period. Direct `retrieve` and `record` calls build no prompt, so they are not counted here. |
| `context_tokens` | What the injected memory block cost those prompts. |
| `cache_prefix_tokens` | How much of it was byte-identical to the previous turn's block for the same space and scope, the part a provider's prompt cache can match on. |

`GET /v1/usage/breakdown` carries the same two totals per space.

Both figures are `len/4` estimates, not tokenizer counts. And `cache_prefix_tokens` is
eligibility rather than a saving: an unchanged prefix is what makes a cache hit possible,
but whether your provider charged the discounted rate also depends on their minimum
cacheable length and their own cache TTL. Raise it with
[`block_order: "stable"`](https://docs.memory.anonalabs.com/api-reference/chat#prompt-caching).

## Next steps

> **[Billing](https://docs.memory.anonalabs.com/api-reference/billing.md)**
>
> Plans, credit costs, and subscription management.

> **[Errors](https://docs.memory.anonalabs.com/api-reference/errors.md)**
>
> What happens when a quota runs out.


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