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

# Track your usage and spend

> See how much of your monthly request allowance is used, your PromptGuard spend this cycle, and token volume per model

> [!NOTE]
>
> PromptGuard counts every request against your plan's monthly allowance. You can read that count in the dashboard or from the API, alongside your PromptGuard spend for the billing cycle and the token volume of each model your requests used.

## The Usage page

Open [**Billing**](https://app.promptguard.co/dashboard/billing) (under **Organization** in the sidebar) and choose the **Usage** tab. It shows the Organization you are acting in:

* **Spend this cycle**: **Total this cycle** (subscription plus on-demand), **Included** (your plan's price) and **On-demand** (overage, against your spend cap if you set one). These are PromptGuard charges, not what your LLM providers bill you, and they are shown only to whoever answers for the Organization's billing.
* **Current Usage**: requests used against the monthly limit, the percentage used and the requests remaining.
* **Billing Period**: days remaining in the cycle, and the month's projected requests at the current daily rate, with a note when that projection is over your allowance.
* **Daily Requests**: a chart of requests per day. An Organization's admins see the whole Organization's traffic; everyone else sees their own requests in it.
* **By Model**: for each model, its provider, the number of requests, and tokens in, tokens out and total.

The time range selector applies to the chart, the model table and the spend summary.

## Elsewhere in the dashboard

* **Overview** shows request volume, requests scanned, detected and allowed, requests by threat type, and **Top Sources**: the share of requests from each country, by the client IP's location.
* A project's **Analytics** page (Developer and Enterprise) adds a **Response Times** chart of average latency over the selected range.

## API Usage Tracking

### Current Availability

#### Developer API - Usage Stats

Get current usage statistics via API:

> [tab] Python
>
> ```python theme={"system"}
> import requests
> import os
> from datetime import datetime
>
> api_key = os.environ.get("PROMPTGUARD_API_KEY")
> base_url = "https://api.promptguard.co/api/v1"
>
> headers = {
>     "X-API-Key": api_key
> }
>
> # Get current usage statistics
> def get_usage_stats():
>     response = requests.get(
>         f"{base_url}/usage/stats",
>         headers=headers
>     )
>
>     if response.status_code == 200:
>         stats = response.json()
>         print(f"Requests this month: {stats.get('used_this_month', 0)}")
>         print(f"Monthly limit: {stats.get('monthly_limit', 0)}")
>         print(f"Requests remaining: {stats.get('remaining', 0)}")
>         print(f"Usage percentage: {stats.get('usage_percentage', 0):.1f}%")
>
>         # `remaining` stops at 0, so compare the two counts to see an overrun
>         if stats.get('used_this_month', 0) >= stats.get('monthly_limit', 0):
>             print("Warning: You've used your monthly allowance!")
>
>         return stats
>     elif response.status_code == 401:
>         print("Error: Invalid API key")
>     else:
>         print(f"Error: HTTP {response.status_code}")
>     return None
>
> # Example usage
> if __name__ == "__main__":
>     stats = get_usage_stats()
>     if stats:
>         usage_pct = stats.get('usage_percentage', 0)
>         if usage_pct > 90:
>             print("\nWarning: Consider upgrading your plan or enabling on-demand usage.")
> ```

> [tab] Node.js
>
> ```typescript theme={"system"}
> import fetch from 'node-fetch';
>
> const apiKey = process.env.PROMPTGUARD_API_KEY;
> const baseUrl = 'https://api.promptguard.co/api/v1';
>
> const headers = {
>   'X-API-Key': apiKey
> };
>
> // Get current usage statistics
> async function getUsageStats() {
>   const response = await fetch(`${baseUrl}/usage/stats`, { headers });
>
>   if (response.status === 200) {
>     const stats = await response.json();
>     console.log(`Requests this month: ${stats.used_this_month || 0}`);
>     console.log(`Monthly limit: ${stats.monthly_limit || 0}`);
>     console.log(`Requests remaining: ${stats.remaining || 0}`);
>     console.log(`Usage percentage: ${(stats.usage_percentage || 0).toFixed(1)}%`);
>
>     // `remaining` stops at 0, so compare the two counts to see an overrun
>     if (stats.used_this_month >= stats.monthly_limit) {
>       console.log('Warning: You\'ve used your monthly allowance!');
>     }
>
>     return stats;
>   } else if (response.status === 401) {
>     console.error('Error: Invalid API key');
>   } else {
>     console.error(`Error: HTTP ${response.status}`);
>   }
>   return null;
> }
>
> // Example usage
> getUsageStats().then(stats => {
>   if (stats) {
>     const usagePct = stats.usage_percentage || 0;
>     if (usagePct > 90) {
>       console.log('\nWarning: Consider upgrading your plan or enabling on-demand usage.');
>     }
>   }
> });
> ```

> [tab] cURL
>
> ```bash theme={"system"}
> # Get current usage statistics (developer API - requires API key)
> curl https://api.promptguard.co/api/v1/usage/stats \
>   -H "X-API-Key: $PROMPTGUARD_API_KEY"
> ```

**Response Format:**

```json theme={"system"}
{
  "has_subscription": true,
  "plan": "pro",
  "status": "active",
  "monthly_limit": 100000,
  "used_this_month": 81250,
  "remaining": 18750,
  "usage_percentage": 81.25,
  "credit_usd": null,
  "credit_used_usd": 0.0,
  "credit_remaining_usd": null,
  "billed_tokens_this_month": 4210000,
  "reset_date": "2026-11-03T09:30:00+00:00"
}
```

On a Plan sold in usage credit, `credit_usd` is the month's credit at list
prices, `credit_used_usd` what your Requests have cost so far and
`credit_remaining_usd` what is left, and `usage_percentage` is the share of the
credit used. On a Plan with no credit they are `null` and `0`.

The figures are those of the Plan that covers the key's Organization, which is
the allowance the key's requests are counted against. `remaining` never goes
below 0.

`reset_date` is when `used_this_month` next returns to 0. The allowance is
monthly on every plan, annual ones included, and each month runs from the
day it began: your subscription's renewal day on a paid plan, the day you
signed up on Free. It is not the first of the calendar month.

## Spending and billing

Under **Billing**, the **Spending** tab is where you set the spend cap for usage past your credit, and the **Plan** tab has your subscription. To cap what a project's proxied requests cost at your LLM providers, set an [upstream spend cap](https://docs.promptguard.co/gateway/spend-caps.md) on the project.

## Rate Limiting and Quotas

### Current Limits

Usage limits are based on your subscription plan:

| Plan | Monthly Requests | Additional Features |
| - | - | - |
| **Free** | \$5 of usage a month | The full detector set Developer runs: 28 of 32 threat types, on the same engine, both LLM judges included |
| **Developer** | \$20 of usage a month, then list prices to your spend cap | 28 of 32 threat types, every text / single-call detector, including `gibberish` and `language_violation`, and the three multimodal detectors (image stego, image adversarial, audio stego), plus custom policies, advanced analytics, unlimited projects |
| **Enterprise** | Custom | Developer + the four cross-tenant correlation detectors (sybil, compositional fragment, systemic cascade, tacit collusion), which require opt-in consent |

### Monitoring Quotas

View your current usage in the dashboard:

1. **Navigate**: [app.promptguard.co](https://app.promptguard.co) → Billing → Usage
2. **Check Usage**: See requests used vs. monthly limit
3. **Spend cap**: On Developer, usage past the credit is billed at list prices up to your spend cap; raise or lower it on Billing → Spending
4. **Upgrade**: Upgrade your plan if you need higher base limits

You are also warned as you approach the limit, by email and in the dashboard: see [Reaching your limit](https://docs.promptguard.co/pricing.md#reaching-your-limit).

## Historical Data

### Data Retention

Security events are kept for your plan's log retention period: see the **Log retention** row of [Plans & Limits](https://docs.promptguard.co/pricing.md#feature-comparison). There is no separate retention period for aggregated data.

> [!NOTE]
>
> Need longer retention periods? Contact [sales@promptguard.co](mailto:sales@promptguard.co) for enterprise solutions with custom retention policies.

## Troubleshooting Usage Tracking

> [accordion] Missing Usage Data
>
> **Common Causes:**
>
> * Requests not properly authenticated
> * API key belongs to different project
> * Data outside retention period
>
> **Solutions:**
>
> * Verify API key is correct and active
> * Check that API key belongs to the project you're querying
> * Check request timestamps
> * Contact support for data recovery

> [accordion] Incorrect Usage Counts
>
> **Solutions:**
>
> * Check which Organization you are acting in: the page shows that Organization's allowance
> * Check the time range selector
> * Ensure the API key belongs to that Organization
> * Refresh dashboard to get latest data

## Next Steps

> [card] [Dashboard Analytics](https://docs.promptguard.co/platform/dashboard.md)
>
> Explore the full monitoring dashboard

> [card] [Interactions](https://app.promptguard.co)
>
> View detailed security events and interactions

> [card] [Plans & Limits](https://docs.promptguard.co/pricing.md)
>
> Review plan quotas, rate limits, and how usage is calculated

> [card] [Billing](https://app.promptguard.co/dashboard/billing)
>
> Manage your subscription and billing

> [card] [Best Practices](https://docs.promptguard.co/production/best-practices.md)
>
> Running PromptGuard in production

Need help with usage tracking setup? [Contact support](mailto:support@promptguard.co) for assistance with analytics and reporting.


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