Perplexity API Key: How to Get One and Keep It Safe

You generate a Perplexity API key in the Perplexity API Console: create or select a project, open API Keys and click "+ Generate API Key".

The API is pay-as-you-go and needs no subscription, but the project needs API credits before your calls work.

Steps checked against Perplexity's own docs in Nov 2026. Menus change, so if a screen looks different, follow the linked docs.

How to get a Perplexity API key

  1. Sign in to the Perplexity API Console and create or select a project.
  2. Open API Keys and click "+ Generate API Key".
  3. Copy the key before you leave the page. The console shows the full key only once.
  4. Buy API credits under Billing.
  5. Save the key as an environment variable called PERPLEXITY_API_KEY.

Keys belong to a project, so use separate projects to keep test and production keys (and their spend) apart.

Check a key you already have

Not sure which service a key in your config belongs to, or whether you just pasted one somewhere? Paste it below to see what it is and how to revoke it.

Runs only in your browser. The check happens on this page. What you paste isn't sent anywhere, saved or logged, and the checker never contacts the provider. Want proof? Open your browser's network tab, or turn off Wi-Fi, and paste.

What a Perplexity API key looks like

Perplexity keys start with pplx- followed by 48 letters and digits, the shape in the gitleaks rule set.

How to store your Perplexity API key safely

  • Keep it in PERPLEXITY_API_KEY or a secret manager, never in your code.
  • Never put it in website or app code where users can read it. Call Perplexity from your own backend.
  • Keep only the credits you need, so a stolen key can't spend much.

Never paste your Perplexity API key into an AI chat

It usually happens while debugging. The error sits next to a config file, you paste the whole thing into ChatGPT or Claude, and the key goes in with everything else.

Once it's sent, the key is stored on someone else's servers, in the chat history, and possibly in training data, depending on your account settings. Deleting the chat doesn't take it back, so treat any key you pasted as exposed and rotate it.

We wrote a step-by-step guide for that moment: what to do in the first hour after pasting an API key into ChatGPT. And if a tool you installed might have read your keys, see how to check whether your AI keys were exposed.

What to do if your Perplexity API key leaks

Rotate first and investigate second. A key that no longer works can't be misused.

  1. Open API Keys in your project in the Perplexity API Console and remove the exposed key.
  2. Generate a new key and update your apps.
  3. Check the project's usage and credits for calls you didn't make.

Perplexity's quickstart doesn't describe revoking a key, so if you can't find the option, contact Perplexity support with the key name.

How Sequirly catches keys at the paste

We build Sequirly, a browser extension that checks what you're about to send to ChatGPT, Claude, Gemini and other AI tools. When a prompt contains an API key, a password or other sensitive data, Sequirly warns you before it leaves your browser, so you can remove it and send the rest.

Sequirly holds an API key before it reaches ChatGPT, then flags customer data in the next prompt.

The check runs inside your browser, and Sequirly says it never sees, stores or sends the values it finds.

There's plenty it doesn't do, so you know where the gaps are:

  • It doesn't scan your code, repos or servers. Use a secret scanner such as gitleaks for that.
  • It doesn't revoke keys or check whether a key is live. Rotation is still on you.
  • It only knows keys by their shape, so a key with no prefix (like Mistral's) can slip past it, just as it slips past the checker above.
  • It warns before it blocks, so a person can still choose to send.

Curious how to test that claim yourself? Our post on whether Sequirly is safe to install walks through a network test you can run.

Common Questions

Do I need Perplexity Pro to use the API?

No. Perplexity says its API uses pay-as-you-go pricing and you don't need a subscription. You do need API credits on the project.

Where do I get a Perplexity API key?

In the Perplexity API Console: create or select a project, open API Keys and click "+ Generate API Key".

Can I see my Perplexity API key again?

No. The console shows the full key only once, so copy it before you leave the page.

What does a Perplexity API key look like?

A Perplexity API key starts with pplx- followed by 48 letters and digits.

Sources

Guides for other API keys

Catch the key before it leaves

If you'd like a warning the next time a key ends up in a prompt, try Sequirly now. Or if you'd rather talk it through with us first, book a quick demo.