> ## Documentation Index
> Fetch the complete documentation index at: https://metacognition-fdc534de-master.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage, quotas, and billing

> What Tex meters, how daily caps work, and how to keep memory costs predictable.

Tex tracks two numbers: **`tokens_in`** and **`tokens_out`**. It counts them with **`tiktoken`** and the **`cl100k_base`** vocabulary.

On the free tier, each org gets **1M** tokens in and **5M** tokens out per UTC day. If either limit is exceeded, the API returns **`429`**. Every **`remember`** and **`recall`** response includes a **`usage`** object. The SDK helpers **`tex.usage.today()`** and **`tex.usage.summary()`** show the same totals as the dashboard.

## Free tier

<CardGroup cols={2}>
  <Card title="tokens_in" icon="upload">
    **1,000,000 / day**
  </Card>

  <Card title="tokens_out" icon="download">
    **5,000,000 / day**
  </Card>
</CardGroup>

Both reset at **00:00 UTC**. Crossing either limit raises **`RateLimitError`** (`HTTP 429`).

## Usage in code

### Per response

Every **`remember`** and **`recall`** returns usage for that call:

```python theme={null}
hits = tex.recall(q="...", session_id=sid)
print(hits.usage.tokens_in, hits.usage.tokens_out)
```

### Per org (dashboards, cron jobs)

```python theme={null}
today = tex.usage.today()         # daily totals + quota headroom
month = tex.usage.summary()       # current calendar month
march = tex.usage.summary("2026-03")
```

The [Dashboard Usage page](https://app.getmetacognition.com/dashboard/usage) shows the same numbers.

## Cost knobs

| Lever                   | Why it helps                                                               |
| ----------------------- | -------------------------------------------------------------------------- |
| **Lower `top_k`**       | Defaults are 15 / 25. Live chat often needs only 5-8.                      |
| **Stay on `active`**    | `deep` mode costs more time and tokens than `active`.                      |
| **Trim noisy writes**   | Skip one-word acks and redundant system spam in `remember`.                |
| **Batch turns**         | Send many turns in one `remember` instead of dozens of calls.              |
| **Quota-aware routing** | Fall back to “no memory” for non-critical paths when you are near the cap. |

```python theme={null}
if tex.usage.today().tokens_in_used / 1_000_000 > 0.9:
    return generate_without_memory(query)
```

## Alerting

There is no hosted email alert yet. Poll **`tex.usage.today()`** from your own monitor. Page your team when either usage column crosses **\~90%** of quota. Server-side emails near **80%** are on the [roadmap](/changelog).

## Pricing (later)

Billing will be pay-as-you-go once pricing is published. Daily caps stay in place as safety rails. Until the billing docs change, treat today's **`429`** behavior as the source of truth.

<Card title="Install SDK" icon="download" href="/sdk/installation" horizontal>
  `pip install tex-sdk`
</Card>
