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

# Check your plan and credit usage

> Call GET /usage to see which plan a request runs on and, with a paid key, the credits used and left in the billing period. Warn before you run out, with a short Python check.

`GET /usage` answers two questions: which plan your request is actually running on, and, for a Dev, Pro or Enterprise key on `api-pro.dexpaprika.com`, how many credits the account has used and has left in the current billing period. With a paid key:

```bash theme={null}
curl -s -H "Authorization: $DEXPAPRIKA_API_KEY" "https://api-pro.dexpaprika.com/usage"
```

```json theme={null}
{
  "plan": "pro",
  "email": "you@example.com",
  "requests_used": 633,
  "requests_left": 4999367,
  "period_started_at": "2026-09-24T09:44:17Z",
  "period_ends_at": "2026-10-24T09:44:17Z"
}
```

It is never served from cache, so it reflects the key and host of the call you just made. That makes it the quickest way to confirm a new key is set up right.

***

## Which plan you need

`/usage` answers on every plan, but only a paid key on the paid host gets the credit figures.

| Caller | Host | Response |
| - | - | - |
| No key | `api.dexpaprika.com` | `{"plan": "keyless"}` |
| Free key | `api.dexpaprika.com` | The plan only |
| Dev, Pro, Enterprise | `api-pro.dexpaprika.com` | Plan, account email, credits used and left, period dates |

Without a key:

```bash theme={null}
curl -s "https://api.dexpaprika.com/usage"
```

```json theme={null}
{"plan": "keyless"}
```

On a free key, [console.dexpaprika.com](https://console.dexpaprika.com) shows your usage against the allowance. Allowances for every plan are on [pricing](https://dexpaprika.com/api/pricing).

***

## The fields

| Field | Meaning |
| - | - |
| `plan` | The plan this request was evaluated against: `keyless`, `free`, `dev`, `pro` or `enterprise` |
| `email` | The account the key belongs to |
| `requests_used` | Credits used in the current billing period, across all of the account's keys |
| `requests_left` | Credits left in the period, including purchased packs and overage already charged |
| `period_started_at`, `period_ends_at` | The billing period the figures belong to |

Responses that are not served from cache carry the same value in the `x-api-plan` header.

***

## Warn before you run out, in Python

This script prints the plan and, where the figures are available, how much of the period's credits are gone, and exits with an error above a threshold. Run it from cron or a CI job. One request:

```python theme={null}
import os
import sys
import requests

# No key: leave both variables unset. Free key: set DEXPAPRIKA_API_KEY.
# Dev or Pro key: also set DEXPAPRIKA_API=https://api-pro.dexpaprika.com
API = os.environ.get("DEXPAPRIKA_API", "https://api.dexpaprika.com")
KEY = os.environ.get("DEXPAPRIKA_API_KEY")
HEADERS = {"Authorization": KEY} if KEY else {}
WARN_AT = 0.8  # share of the period's credits

r = requests.get(f"{API}/usage", headers=HEADERS, timeout=30)
r.raise_for_status()
usage = r.json()

print(f"plan: {usage['plan']}")
if "requests_left" not in usage:
    print("No credit figures on this plan and host; see console.dexpaprika.com")
    sys.exit(0)

used, left = usage["requests_used"], usage["requests_left"]
share = used / (used + left)
print(f"{used:,} credits used, {left:,} left ({share:.1%}), period ends {usage['period_ends_at']}")
if share >= WARN_AT:
    sys.exit(f"Over {WARN_AT:.0%} of this period's credits are used")
```

Without a key:

```text theme={null}
plan: keyless
No credit figures on this plan and host; see console.dexpaprika.com
```

With a Pro key:

```text theme={null}
plan: pro
680 credits used, 4,999,320 left (0.0%), period ends 2026-10-24T09:44:17Z
```

***

## Things to know

**No numbers? Check the host.** If `/usage` returns only a plan while you expected credit figures, make sure the call goes to `api-pro.dexpaprika.com`, where paid keys belong. [Upgrading to Pro](/api-pro/upgrading) has the full mapping.

**Treat the figures as a gauge.** Two calls a second apart can return slightly different `requests_used`, and the number can briefly step back. Compare readings minutes apart, not consecutive calls.

**Watch the trend, not only the total.** A share of credits used means more next to the share of the period gone. Half the credits used halfway through the period is on pace; half used in the first week is not. [Plan your credit usage](/knowledge-base/credit-usage) shows what common workloads cost.

**What happens at zero depends on the plan.** Free tiers stop with `402`. On Dev and Pro, autoscaling in the console decides whether you stop or keep going at the overage rate; see [the console](/knowledge-base/console).

***

## Where to go next

* [Credit planning](/knowledge-base/credit-usage): what a workload costs before you build it
* [Rate limits](/knowledge-base/rate-limits) and [response headers](/knowledge-base/response-headers)
* [Usage reference](/api-reference/utils/get-your-plan-and-current-period-credit-usage)
* [Pricing](https://dexpaprika.com/api/pricing), [console.dexpaprika.com](https://console.dexpaprika.com) and [docs home](https://docs.dexpaprika.com)


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