If you use the Perplexity API for search, research, or question answering, you need to monitor your usage and cost. Without tracking, you may exceed your budget or hit rate limits unexpectedly. This article explains how to view your API usage dashboard, check remaining credits, and set spending alerts. You will learn the exact steps to track usage and control costs in the Perplexity developer portal.
Key Takeaways: Track Perplexity API Usage and Cost
- Developer Dashboard > Usage: View total requests, tokens consumed, and cost per billing period.
- Settings > Billing > Alerts: Set a monthly spending cap to avoid surprise charges.
- API Response Headers: Check remaining credits in real time using the
x-ratelimit-remainingheader.
Understanding Perplexity API Usage Metrics and Billing
The Perplexity API charges based on the number of tokens processed. Tokens are units of text input and output. Each query consumes tokens for the question and the generated answer. The billing model uses a pay-as-you-go structure. You prepay for credits that are deducted per request. The dashboard shows three main metrics: total requests, tokens input, and tokens output. Rate limits apply per API key. Free tier keys have lower limits than Pro or Enterprise keys. The usage resets at the start of each billing cycle. You can view all this data in the developer portal under the Usage tab.
What Counts as a Token
A token is roughly 0.75 words for English text. The API counts both prompt tokens and completion tokens. Prompt tokens are the text in your query and any system instructions. Completion tokens are the text in the model response. The total cost is the sum of prompt tokens times the prompt rate plus completion tokens times the completion rate. The rate per token varies by model. For example, the Perplexity Sonar model costs $0.001 per 1,000 prompt tokens and $0.002 per 1,000 completion tokens.
Rate Limits and Throttling
Each API key has a maximum number of requests per minute. Free tier keys allow 10 requests per minute. Pro keys allow 100 requests per minute. Enterprise keys have custom limits. When you exceed the limit, the API returns a 429 status code. The response headers include the time until the limit resets. The dashboard shows your current rate limit usage in real time.
Steps to View API Usage in the Developer Dashboard
The developer dashboard is the primary location for tracking usage and cost. You must log in with the account that owns the API key.
- Open the Perplexity Developer Portal
Go to perplexity.ai/settings/api in your browser. Sign in with your Perplexity account credentials. - Navigate to the Usage tab
In the left sidebar, click Usage. The page displays a summary of your current billing period. You see total requests, tokens used, and estimated cost. - View detailed metrics by API key
If you have multiple API keys, click Filter by Key and select a specific key. The chart updates to show usage for that key only. Each row shows the key name, total requests, prompt tokens, completion tokens, and cost. - Check historical usage
Click the date range picker at the top of the chart. Select a custom range or choose from presets like Last 7 Days or Last 30 Days. The table below the chart lists each day with the same metrics. - Export usage data
Click the Export CSV button above the table. The file contains all metrics for the selected date range. You can open it in Excel or Google Sheets for further analysis.
Setting a Spending Alert or Monthly Cap
To prevent unexpected charges, you can set a monthly spending alert or hard cap. Alerts notify you by email when you reach a threshold. A hard cap stops API requests once the limit is reached.
- Go to Billing settings
In the developer portal, click Settings in the left sidebar. Then click Billing. - Enable spending alerts
Under Spending Alerts, click Add Alert. Enter a name for the alert, for example “Monthly Warning”. Set the threshold amount in USD. Choose the notification method: email only. Click Save. - Set a monthly spending cap
Under Spending Cap, toggle the switch to On. Enter the maximum amount you want to spend per month. Click Save. Once the cap is reached, the API returns a 402 Payment Required error for all subsequent requests until the next billing cycle. - Verify the cap is active
Refresh the Billing page. The Spending Cap section shows the current limit and the amount spent so far this month. The status reads “Active” when the cap is enabled.
Tracking Usage in Real Time via API Response Headers
Every API response includes headers with your current usage and rate limit status. You can parse these headers in your application to monitor usage programmatically.
- Send a test API request
Use any HTTP client like curl or Postman. Send a POST request tohttps://api.perplexity.ai/chat/completionswith your API key in the Authorization header. - Check the response headers
In the response, look for these headers:x-ratelimit-remaining— number of requests left in the current minute.x-ratelimit-reset— Unix timestamp when the rate limit resets.x-tokens-remaining— number of tokens remaining in your current billing period.x-cost-total— total cost incurred so far in the current billing period in USD. - Log the headers in your code
In your application, capture the response object and read these headers. Store them in a variable or log them to a file. Use the values to adjust request frequency or alert your team when tokens are low.
Common Issues with API Usage Tracking
Usage Dashboard Shows Zero Requests
If the dashboard shows zero requests but you have made API calls, check that you are viewing the correct API key. The dashboard filters by key. If you have multiple keys, select the key you used. Also verify the date range includes the time of your requests. The default view is the current billing period.
Spending Cap Not Working
If you set a spending cap but requests continue after the limit, check that the cap is enabled. The toggle must be set to On. Also confirm the cap amount is less than the amount already spent. If the cap is higher than current spending, requests will not stop. The cap applies to the sum of all API keys on your account.
Rate Limit Header Shows Incorrect Value
The x-ratelimit-remaining header decrements by one for each request. If you send multiple requests in parallel, the header may not reflect the true remaining count due to race conditions. Use the x-ratelimit-reset header to know when the limit resets. For accurate rate limiting, implement exponential backoff in your code.
Perplexity API Free vs Pro: Usage Limits and Cost
| Item | Free Tier | Pro Tier |
|---|---|---|
| Monthly requests | 1,000 | Unlimited (pay per token) |
| Rate limit | 10 requests per minute | 100 requests per minute |
| Token cost | Free up to 1,000 requests | $0.001 per 1,000 prompt tokens |
| Model access | Sonar only | Sonar, Sonar Pro, and custom models |
| Spending cap | Not available | Available |
Tracking Perplexity API usage and cost is straightforward when you use the developer dashboard, billing settings, and response headers. The Usage tab gives you a clear view of tokens and spending. Setting a monthly cap prevents overages. Checking the response headers lets you monitor usage in real time from your application. Start by reviewing your current usage in the dashboard, then enable a spending cap to stay within budget.