New to Rust? Grab our free Rust for Beginners eBook Get it free →
Free Perplexity API Key Tester: Validate Your Perplexity API Key Here
Perplexity API Key Tester
Send one small request directly from your browser to Perplexity. The request uses your API account and can incur the normal API charge.
Ready
A free Perplexity API key tester should answer one narrow question without hiding the security tradeoff, so the browser check above sends a small request straight to Perplexity and the local cURL method keeps a production key out of the page.
Choose the safer test for your key
Perplexity’s key-management guide says API keys are sensitive credentials and should never be exposed in client-side code, so use the browser button only with a disposable development key.
| Method | Use it when | Key handling |
|---|---|---|
| Browser tester | You need a quick check with a disposable development key | The page sends the key directly to Perplexity, then clears the input after the response |
| Local cURL | You are checking a production or shared key | Your shell reads the key from PERPLEXITY_API_KEY |
| Application test | You need to verify the complete integration | Your server reads the key from its secret store |
Test a Perplexity API key in your browser
The tester calls the Sonar endpoint with the model and prompt you select. API usage follows Perplexity’s normal pay-as-you-go billing, so the tool itself is free but the request is not a free API credit.
- Create a disposable key in the Perplexity API console.
- Paste the development key into the tester.
- Keep sonar selected for the smallest validation request.
- Click Test key and read the Hypertext Transfer Protocol (HTTP) status.
- Revoke the disposable key after the check if you do not need it again.
Run the local cURL check
Perplexity recommends the Agent API for new integrations, but the Sonar endpoint remains available for Sonar models and can validate the same API account from your terminal.
export PERPLEXITY_API_KEY="paste_your_key_here"
curl https://api.perplexity.ai/v1/sonar \
-H "Authorization: Bearer $PERPLEXITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sonar",
"messages": [{"role": "user", "content": "Reply with OK"}]
}'
A successful response contains a choices array and usage data.
Remove the export command from your shell history when you paste a key directly, or load the variable from your project’s secret store instead.
Read the response code before changing your code
| HTTP status | What it tells you | Next move |
|---|---|---|
| 200 | The key authenticated and the selected model accepted the request | Check your application payload, endpoint, and environment-variable loading |
| 401 | Perplexity rejected the credential | Copy the key again, confirm it was not revoked, or create a new key |
| 402 | The request reached the API account but billing or credits need attention | Check API billing in the Perplexity console |
| 429 | The account or model hit a rate limit | Wait for the limit window or inspect the account’s usage tier |
| Other 4xx | Authentication may have worked, but the payload or model can be wrong | Read the response body before rotating the key |
I sent a deliberately invalid credential to the Sonar endpoint and received HTTP 401 with an invalid_api_key response, which confirms that status isolates authentication.
Other status codes can indicate billing, rate limits, or request validation.
Pick a supported Sonar model
Perplexity’s model catalog lists four Sonar API choices and omits the old sonar-reasoning model, so the tester offers sonar-reasoning-pro instead.
- Use sonar for a low-cost search-grounded check.
- Use sonar-pro for more complex searches and follow-up questions.
- Use sonar-reasoning-pro when the task needs multi-step reasoning.
- Use sonar-deep-research for long research reports, not routine key validation.
Perplexity places Sonar in maintenance mode and recommends the Agent API as the default for new integrations.
Protect the key after validation
- Store the key in an environment variable or secret manager.
- Never commit the key to a repository or include it in browser code.
- Create separate keys for development and production API groups.
- Rotate a key before revoking the old one so deployed services keep working.
- Revoke any key that appeared in a public page, screenshot, log, or chat.
The Gemini API setup guide shows another environment-variable workflow if you are building with more than one provider.
The Perplexity overview explains where the search product and API fit.
Frequently asked questions
Does the tester store my Perplexity API key?
The widget does not save the key in WordPress or local storage. The browser sends it to Perplexity for the request and clears the input afterward, but page scripts can access a client-side field, so use a disposable development key.
Is the Perplexity API request free?
The page does not charge for the tester. Perplexity applies its normal API pricing to the request, and its documentation describes the APIs as pay-as-you-go with no subscription required.
Which model should I use to validate a key?
Use sonar for a small authentication check. A successful request proves the key and API account work without paying for a deep-research request.
Why does a working key fail in my application?
Check whether the application loads PERPLEXITY_API_KEY, sends the Bearer header, uses the correct endpoint, and supplies a supported model. Compare the application response body with the local cURL result.
Should I use Sonar API for a new application?
Perplexity recommends Agent API as the default for new integrations. Sonar remains useful when you specifically need Sonar models through the OpenAI-compatible chat-completions interface.
Start with the local cURL request when the key controls a shared workload. One successful call separates credential trouble from the rest of your integration and gives you a response body worth debugging.
