> For the complete documentation index, see [llms.txt](https://docs.meganova.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.meganova.ai/api-reference/platform-api/search/get-search-usage.md). Agents can also search and read this documentation through its [MCP server](https://docs.meganova.ai/~gitbook/mcp).

# Get Search Usage

Today's quota and spend snapshot for the calling user — for both /search and /fetch dimensions.

Returns today's usage snapshot for the calling key's user. UTC day boundary; resets at `00:00 UTC`. Read-only — calling this endpoint never debits credits or consumes quota.

Use it to drive in-product usage meters or to throttle yourself before hitting overage charges.

## HTTP Request

`GET` `{API_URL}/serverless/search/usage`

No request body or query parameters.

## Response

```json
{
  "data": {
    "user_id":                       "358",
    "date":                          "2026-04-29",

    "quota_daily":                   50,
    "quota_used":                    12,
    "quota_remaining":               38,
    "overage_queries":               0,
    "overage_charged_usd":           0.0,
    "overage_price_per_query":       0.002,

    "fetch_quota_daily":             50,
    "fetches_total":                 3,
    "fetch_quota_remaining":         47,
    "fetches_overage":               0,
    "fetches_overage_charged_usd":   0.0,
    "fetch_overage_price_per_call":  0.002,

    "total_cost_usd":                0.0066,
    "quota_reset_at":                "2026-04-30T00:00:00Z",

    "token_plan": null
  },
  "message": "Usage snapshot",
  "status":  "success"
}
```

`/search` and `/fetch` are tracked as **two parallel quota dimensions**: each has its own daily free allotment, its own overage counter, and its own overage charge accumulator.

### Fields

#### Identification

| Field                 | Description                                                   |
| --------------------- | ------------------------------------------------------------- |
| `data.user_id`        | Numeric user ID owning the calling API key                    |
| `data.date`           | UTC calendar day this snapshot is for (`YYYY-MM-DD`)          |
| `data.quota_reset_at` | Next UTC midnight (ISO 8601) — when both quota counters reset |

#### `/search` dimension

| Field                          | Description                                                                                                                   |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| `data.quota_daily`             | Free `/search` quota per day (configurable, default `50`)                                                                     |
| `data.quota_used`              | Distinct **prompt-groups** counted today. With `X-Request-Group-Id`, multiple sub-queries of one prompt only consume one slot |
| `data.quota_remaining`         | `max(0, quota_daily - quota_used)`                                                                                            |
| `data.overage_queries`         | Subset of today's `/search` calls past the free quota                                                                         |
| `data.overage_charged_usd`     | Total $ debited from `credit_balance` today for `/search` overage                                                             |
| `data.overage_price_per_query` | Current per-prompt-group overage rate (default `\$0.002`). Read this field rather than hard-coding — rates may change         |

#### `/fetch` dimension

| Field                               | Description                                                                                                                                 |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `data.token_plan`                   | Present only for accounts holding a [Libra OS Token Plan](https://docs.meganova.ai/enterprise/token-plan.md). `null` otherwise — see below. |
| `data.fetch_quota_daily`            | Free `/fetch` quota per day (configurable, default `50`)                                                                                    |
| `data.fetches_total`                | Successful `/fetch` calls today (raw count — no group dedup)                                                                                |
| `data.fetch_quota_remaining`        | `max(0, fetch_quota_daily - fetches_total)`                                                                                                 |
| `data.fetches_overage`              | Subset of today's `/fetch` calls past the free quota                                                                                        |
| `data.fetches_overage_charged_usd`  | Total $ debited from `credit_balance` today for `/fetch` overage                                                                            |
| `data.fetch_overage_price_per_call` | Current per-call overage rate (default `\$0.002`). Read this field rather than hard-coding — rates may change                               |

#### Shared

| Field                 | Description                                                                                                                 |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `data.total_cost_usd` | Informational only — not what you're billed. See `overage_charged_usd` and `fetches_overage_charged_usd` for actual charges |

## Examples

### curl

```bash
curl -X GET '{API_URL}/serverless/search/usage' \
  -H 'Authorization: Bearer {TOKEN/KEY}'
```

### Python — drive an in-product usage meter

```python
import os
import requests

BASE = "{API_URL}/serverless"
HEADERS = {"Authorization": f"Bearer {os.environ['MEGANOVA_API_KEY']}"}


def usage_summary():
    r = requests.get(f"{BASE}/search/usage", headers=HEADERS, timeout=10)
    r.raise_for_status()
    return r.json()["data"]


u = usage_summary()
print(f"Search:  {u['quota_used']}/{u['quota_daily']}  (overage paid: ${u['overage_charged_usd']:.4f})")
print(f"Fetch:   {u['fetches_total']}/{u['fetch_quota_daily']}  (overage paid: ${u['fetches_overage_charged_usd']:.4f})")
print(f"Resets at: {u['quota_reset_at']}")

# Throttle yourself before hitting overage
if u["quota_remaining"] == 0:
    print("Search quota exhausted; subsequent calls will be billed at",
          f"${u['overage_price_per_query']:.4f}/group")
```

### Pre-flight check before a fan-out search

```python
u = usage_summary()
if u["quota_remaining"] == 0:
    # Already in overage territory — confirm balance covers planned calls
    balance = requests.get(
        f"{API_URL}/users/credits", headers=HEADERS, timeout=10,
    ).json()["data"]["available_balance"]
    planned_calls = 5
    needed = planned_calls * u["overage_price_per_query"]
    assert float(balance) >= needed, "Top up before continuing"
```

## Related

* [Web Search overview](https://docs.meganova.ai/api-reference/platform-api/search.md)
* [Search query](https://docs.meganova.ai/api-reference/platform-api/search/search-query.md) — `POST /serverless/search`
* [Fetch URL](https://docs.meganova.ai/api-reference/platform-api/search/fetch-url.md) — `POST /serverless/fetch`
* [User Credit Balance](https://docs.meganova.ai/api-reference/platform-api/get-credit-balance.md)

## Token Plan accounts

A subscriber's response carries an extra `token_plan` block. It is **additive** — the `quota_*` fields above stay valid and keep describing the daily free pool, because entitlement is per API key: calls made with an ordinary key still draw on that pool, while calls made with a plan member key draw on the monthly allowance instead. Both readings can be non-zero on the same day.

```json
"token_plan": {
  "plan_name":            "Libra OS Token Plan",
  "status":               "active",
  "percent_used":         5.55,
  "allowance_reached":    false,
  "resets_at":            1788618308,

  "overage_enabled":      false,
  "overage_cap":          30.0,
  "overage_used":         0.0,

  "searches_today":       3,
  "fetches_today":        1,
  "overage_charged_usd":  0.0,

  "price_per_search":     0.002,
  "price_per_fetch":      0.002
}
```

| Field                                              | Meaning                                                                                                                                                                                                                                   |
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `plan_name` / `status`                             | The subscription behind the entitlement.                                                                                                                                                                                                  |
| `percent_used`                                     | Included allowance consumed this billing period, `0`-`100`. Reported as a percentage only — the allowance itself is not exposed in dollars.                                                                                               |
| `allowance_reached`                                | `true` once the included allowance is spent. Further calls need Extra Usage enabled, otherwise they return `402`.                                                                                                                         |
| `resets_at`                                        | End of the current billing period, epoch seconds.                                                                                                                                                                                         |
| `overage_enabled` / `overage_cap` / `overage_used` | Opt-in capped Extra Usage, in dollars. This is real wallet spend, so unlike the allowance it is reported as an amount.                                                                                                                    |
| `searches_today` / `fetches_today`                 | Plan-billed calls today (UTC day). `searches_today` counts **billable prompt-groups**, not raw calls — fan-out under one [request group](https://docs.meganova.ai/api-reference/platform-api/search/create-request-group.md) is one unit. |
| `overage_charged_usd`                              | Debited from `credit_balance` today via Extra Usage.                                                                                                                                                                                      |
| `price_per_search` / `price_per_fetch`             | Per-unit rates drawn from the allowance.                                                                                                                                                                                                  |

> **Why `quota_used` reads `0` for a subscriber.** Plan traffic deliberately never touches the daily counters — the quota check reads those, and letting plan calls consume the free pool would bill the same call twice. Read `token_plan.searches_today` for plan consumption.
