Keys / Perplexity

PERPLEXITY_API_KEY

The Perplexity API key your app calls Perplexity's APIs with. Each key belongs to a project.

Starts with
pplx-
Expires
the docs don't say
API
generate and revoke, with an existing API key

Get it

Create one on console.perplexity.ai/project/keys. The steps aren't recorded yet.

Set it

PERPLEXITY_API_KEY=pplx-...

The Python and TypeScript SDKs read it from this variable when you don't pass a key. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Generate a new key in the console or with /generate_auth_token. Keep the old one active.
  2. Deploy it everywhere that reads PERPLEXITY_API_KEY.
  3. Check that requests succeed with the new key, then revoke the old one. A revoked key can't be recovered.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16