# Plan and usage

Answers what the presented key is, what plan is behind it, and what has
been spent against that plan's allowance in the current window.


`GET https://api.vpndetection.io/api/v1/entitlement`

## Authorization

Any one of:

- `apikey` in the query
- `X-Api-Key` in the header
- bearer token

## Responses

### 200

The key's entitlements and consumption. On the free plan, Free,
usage is the UTC day's lookups answered with every field, against
its daily limit, and no hard limit, since nothing stops a lookup past
it: the basics have no cap. The daily limit is on the pricing
page, never fixed here.


```json
{
  "org_id": "85bb51e4-2eb6-4a31-8e4d-02ba8b98fe61",
  "apikey": {
    "id": "0ab424cc-7619-4dad-b027-afacdc2cedb0",
    "expires": null,
    "allowed_cidrs": []
  },
  "plan": {
    "key": "data_4",
    "name": "Data",
    "tier": "max"
  },
  "usage": {
    "requests": 580,
    "quota": 1000000,
    "hard_limit": null,
    "window_start": "2026-09-04T07:00:00Z",
    "window_end": "2026-10-04T07:00:00Z"
  }
}
```

### 401

No key was presented, or it is unknown, revoked or expired.

missing:

```json
{
  "error": "an API key is required"
}
```

invalid:

```json
{
  "error": "invalid API key"
}
```

revoked:

```json
{
  "error": "API key revoked"
}
```

expired:

```json
{
  "error": "API key expired"
}
```

### 403

The key restricts which source addresses may use it, and this
request did not come from one of them; or the key was sent over
plain HTTP, which is refused whatever the key.


source:

```json
{
  "error": "source address not allowed for this API key"
}
```

plain_http:

```json
{
  "error": "API key sent over plain HTTP; use https://"
}
```

### 503

The usage counters could not be read. Reported rather than guessed
at: the whole answer is the number, and a confident zero would read
as "you have used nothing".


```json
{
  "error": "usage is temporarily unavailable"
}
```
