# API: API Credits

VitalSentinel uses credits to meter the use of the public API and the MCP server. Credits count against the **workspace**, never against one credential or one user. Every plan includes an allowance that refills each billing cycle.

The short version: a cheap read costs 1, a heavy read costs 5, a job start or a very wide pull costs 25, and **an answer from the cache costs 0**.

In the dashboard, the balance and the spending of a workspace are on the [API credits](/workspace/api-credits) page.

## The four prices [#the-four-prices]

| Price | Class | What it covers |
|---:|---|---|
| **0** | Discovery | Routes with no credential, and the small set of free routes below |
| **1** | Read or write | A normal read, or a change to settings |
| **5** | Heavy read | An analytical read over a time range, on the `heavy-query` [rate-limit bucket](/api/rate-limits) |
| **25** | Dispatch or wide pull | A call that starts a `run:` job, and the routes that start external collection or return very many rows |

The price follows the work, not the HTTP method. The `X-Credits-Cost` header on each response gives the correct number for that request. The [Endpoint reference](/api/endpoints) shows the price of every operation.

### Always free [#always-free]

These routes cost 0. The balance check does not apply to them, so a workspace with no credits left can still find out why:

```
GET /me
GET /crawler
GET /workspaces
GET /domains
GET /credits
GET /credits/log
GET /credits/workspaces
GET /alerts/rules
GET /alerts/history
GET /alerts/metrics
GET /domains/reports/sections-catalog
GET /domains/reports/default-config
```

An agent must read the catalog routes before it can build a valid request. A charge for them would punish correct use.

`GET /credits/workspaces`, `GET /alerts/rules` and `GET /alerts/history` read every workspace that the credential can access, in one call. Thus no single workspace can correctly pay for them. Their `workspace_id` and `domain_id` filters do not change this, because the meter finds the paying workspace from the path only.

Almost every `/notifications` route is also free. Notifications belong to the person behind the credential, not to a workspace, so no workspace can correctly pay for them:

```
GET /notifications
GET /notifications/stats
GET /notifications/facets
GET /notifications/unread-count
GET /notifications/preferences
GET /notifications/domain-subscriptions
PUT /notifications/preferences
PUT /notifications/domain-subscriptions
POST /notifications/read
POST /notifications/{notification_id}/read
POST /notifications/{notification_id}/unread
DELETE /notifications/{notification_id}
```

The one exception is `GET /notifications/{notification_id}/trend`, which costs 1. It answers only for a notification from an alert, which always has a domain. It also calculates the series from live data.

### Export keys [#export-keys]

An export key that our team sets up for a data export costs no credits. Its reads return `X-Credits-Cost: 0` and never get the `402` for spent credits. The rate limits and the daily ceiling still apply. The key must be read-only: if it has a `write:` or `run:` scope, its calls cost credits as usual. On the [API access](/account/api-access) page, the key shows the chip **Export key – no credits**.

### The 25-credit routes [#the-25-credit-routes]

All calls that start a `run:` job cost 25. Two more groups have this price.

**Wide pulls**, whose `limit` parameter accepts up to 100,000 rows (`gsc/performance`) or 50,000 rows (`ecommerce/products`):

```
GET /domains/{domain_id}/gsc/performance
GET /domains/{domain_id}/analytics/ecommerce/products
```

**Dispatches**, which add work to shared external collection pools:

```
POST /domains/{domain_id}/crux/urls/bulk
POST /domains/{domain_id}/synthetic/urls/bulk
POST /domains/{domain_id}/indexing/properties/{property_id}
```

The `run:` endpoints include `POST /domains/{domain_id}/page-monitoring/watches/{watch_id}/check`, which checks a watched page now. A retry of a check, or a check that is already in progress, costs 0.

`POST /domains/{domain_id}/page-monitoring/watches/bulk-check` checks up to 500 pages. It costs 25 credits for each check that it starts, and 0 for a page that it skips or that is already in progress. It never starts more checks than the balance pays for. See [Page Monitoring](/api/endpoints#page-monitoring).

A request for the status of a job costs the price of a normal read. It never costs more to watch a job than to start it.

A dispatch is about the external quota that a call spends, not about background work. `POST /domains/{domain_id}/robots/sitemap-conflicts/recompute` also starts a job. It uses only data that VitalSentinel already has, so it costs the normal write price.

## A cached answer costs zero [#a-cached-answer-costs-zero]

The price of a cached answer is 0, not a minimum of 1.

The `X-Cache` header on every response tells you what occurred:

| Value | Meaning |
|---|---|
| `HIT` | The answer came from the cache. This request cost 0. |
| `MISS` | The work ran. Full price. |
| `UNAVAILABLE` | VitalSentinel could not read the cache. The price is the same as a hit, because a cache problem is not your fault. |

Four details are important:

- **One miss in a request that reads many modules removes the discount for the full request.** `GET /domains/{domain_id}/overview` reads many modules. If one of them misses, you pay the full price.
- **URL Overview costs 5, and a cached answer costs 0.** A credential that holds only `read:overview` always pays 0 for `GET /domains/{domain_id}/url-overview`, because it gets only the `url` section.
- **The stored HTML of a page version costs 5 for the first part.** More parts of the same version within 10 minutes cost 0.
- **The two wide-pull routes never get the discount.** They always cost 25, also on a cache hit. Without this rule, a second request for the largest possible answer would be free.

## A call that costs more than the balance [#a-call-that-costs-more-than-the-balance]

VitalSentinel refuses a 25-credit call before it runs if the remaining balance, or your remaining cap, is less than 25. The answer is the usual `402` with `quota-exhausted`, and the call costs nothing. A replay of an earlier answer with the same `Idempotency-Key` is free, so this check does not apply to it.

VitalSentinel does not refuse a heavy read (5 credits) in this way, because an answer from the cache costs 0. Thus a heavy read can make `used` a few credits higher than `granted`.

## A rejected request is never charged [#a-rejected-request-is-never-charged]

VitalSentinel charges only a `2xx` response. A `402`, a `403` or a `429` costs nothing. Thus an agent that retries after a refusal does not increase the number in the error body.

## Which workspace is charged [#which-workspace-is-charged]

**VitalSentinel charges a request to the workspace whose data it read.** It finds that workspace from the `workspace_id` or the `domain_id` in the request path.

A route that covers every workspace of the credential names no workspace in its path, so there is no payer. These routes are free. This is why the account-wide lists under [Always free](#always-free) cost 0, also with a filter.

For an API key, this changes nothing. A key belongs to one workspace, which always reads and pays.

For an OAuth or MCP connection that covers several workspaces, it is important. Such a connection spends from a separate allowance for each workspace, and **one allowance can run out while the others stay full**. A `402` on one domain tells you nothing about the next domain.

`X-Credits-Remaining` on a billed response always shows the balance of the workspace that paid for that response. Trust this number when a connection covers more than one workspace.

## Plan allowances [#plan-allowances]

The number of credits in each billing cycle depends on your plan. See [Plans and limits](/workspace/plans-and-limits).

Credits that you do not use do **not** move to the next cycle.

The allowance refills on the billing anniversary of your workspace. A Free workspace has no subscription, so VitalSentinel uses the date when the workspace was created.

A plan change in the middle of a cycle does not start a new cycle. The open cycle keeps its dates, and the new anniversary starts with the next cycle.

## Reading your balance [#reading-your-balance]

```bash
curl -sS https://app.vitalsentinel.com/api/public/v1/credits \
  -H "Authorization: Bearer $VITALSENTINEL_API_KEY"
```

```json
{
  "workspace_id": "e0d4a2c8-1b77-4f39-9c52-6a8d3e0f4b21",
  "granted": 100000,
  "used": 34211,
  "remaining": 65789,
  "cycle_start": "2026-07-14",
  "cycle_end": "2026-08-13",
  "enabled": true,
  "member": { "limit": null, "used": 8420, "remaining": null }
}
```

| Field | Meaning |
|---|---|
| `granted` | The allowance of your plan for one cycle |
| `remaining` | `granted` minus `used`, with a minimum of 0. Many requests at the same time can go a little over, reported as 0 and not as a negative number |
| `cycle_end` | The last day of the cycle, inclusive. The allowance refills the next day |
| `enabled` | Whether VitalSentinel enforces the charges. `false` means that the numbers are counted but nothing is refused |
| `member` | Your own cap, if the workspace owner set one |

This endpoint needs no scope and costs nothing. A credential with only `read:rum` can still read the balance that stopped it.

It reports the default workspace of the connection. For an API key, that is the only workspace. To ask about a different workspace that the credential can reach, send `workspace_id`:

```bash
curl -sS "https://app.vitalsentinel.com/api/public/v1/credits?workspace_id=$WORKSPACE_ID" \
  -H "Authorization: Bearer $VITALSENTINEL_API_KEY"
```

A workspace that the credential cannot reach returns `404`, like any other resource that it cannot reach. When VitalSentinel refuses a call, ask about the workspace that owns the domain. That is the allowance that ran out.

### The spending log [#the-spending-log]

`GET /credits/log` returns the spending of this cycle request by request, newest first, with cursor pagination.

The rows are the requests that **this workspace paid for**. A connection that covers several workspaces has a separate log for each one. Send `workspace_id` to read a different log, or leave it out for the default workspace of the connection.

An owner or an admin sees the requests of **every member**. A member sees only the requests made with their own credentials. An OAuth credential also needs the `read:credits` scope.

The log includes rows with the price 0 on purpose. A 0 on a route that usually costs 5 means a cache hit. A 0 on a `4xx` means that VitalSentinel did not charge a rejected request.

The log keeps rows for 90 days. If you need older spending data, export it before then.

In the dashboard, the same data is on the [API credits](/workspace/api-credits) page. Owners and admins see the **Spending log** card. Members see the **Your spending** card with only their own requests.

The **Spending log** and the workspace's [Data access log](/workspace/data-access-log) answer different questions. The Spending log shows who paid. The Data access log shows whose data was read.

## Per-member caps [#per-member-caps]

A workspace **owner** can limit how much of the shared allowance one member can spend. Set the cap on the [Members](/workspace/members) page of the workspace. A cap belongs to one workspace, so a member of several workspaces has a separate cap in each one.

![The credit cap dialog for one member. It has a Cap per cycle field and a note that the member can now spend 82,670 credits.](/images/api/member-credit-cap.webp)

| `limit` value | Effect |
|---|---|
| `null` | No cap. This is the default for every member. |
| A number | The member can spend up to this number of credits in each cycle |
| `0` | The member cannot use the API and the MCP server. The rest of the workspace continues to work |

<Callout type="warn">
  **A cap is not a grant.** The workspace balance is always the outer limit. If you give a member a cap of 20,000 in a workspace with 500 credits left, the member can spend 500.
</Callout>

When a cap stopped you, the `402` names `member_credits` and not `credits`. When you investigate a `402`, check the workspace balance first, because it limits both.

## Running out [#running-out]

VitalSentinel returns a `402` with `quota-exhausted`. A retry later on the same day does not help. A retry in the next cycle does.

```json
{
  "type": "https://docs.vitalsentinel.com/api/errors/quota-exhausted",
  "title": "Plan quota exhausted",
  "status": 402,
  "detail": "This workspace has used 100000 of 100000 credits for the period. The quota resets on 2026-08-13. Answers served from cache cost 0 credits, but a workspace at zero balance is refused before the request runs. Wait for the allowance to refill, or move to a plan with a larger one.",
  "resource": "credits",
  "used": 100000,
  "limit": 100000,
  "resets_on": "2026-08-13"
}
```

The free routes continue to work. Your client can still read `GET /credits` and report the reset date to the person who must act.

## Spending less [#spending-less]

1. **Use `GET /domains/{domain_id}/overview`.** One heavy read for many modules costs less than one read for each module.
2. **Do not poll faster than the data changes.** A cache hit costs nothing, but it still counts against your [daily ceiling](/api/rate-limits).
3. **Make your windows narrower.** A wide pull costs 25 credits for 200 rows or for 100,000 rows.
4. **Watch `X-Credits-Cost` during development.** It shows immediately which of your calls costs the most.
5. **Keep report results on your side.** Every `run:` call costs 25 credits, and the result seldom changes between two calls some minutes apart.

## Related [#related]

- [API introduction](/api/introduction) - what the API covers
- [Rate limits](/api/rate-limits) - previous step: the buckets and daily ceilings
- [Versioning and stability](/api/versioning) - next step: the v1 contract
- [API credits](/workspace/api-credits) - your balance and spending in the app
- [Plans and limits](/workspace/plans-and-limits) - the credit allowance of each plan
- [MCP introduction](/mcp/introduction) - MCP usage uses the same credits
