Skip to content
AnswerWell geo Documentation

Research · 8 min read · Answerwell

API Key Management: Projects, Rotation, Revocation, and Admin Scopes

How to create Perplexity API keys, rotate and revoke them safely, and how Analytics and Audit admin keys differ from platform keys.

This page summarizes Perplexity documentation on API keys for the API Platform: creating keys inside a project, calling /generate_auth_token and /revoke_auth_token, rotation without downtime, and separate Analytics API and Audit API credentials for organization admins.

API keys and projects: what you need before the first key

Section titled “API keys and projects: what you need before the first key”

An API key authenticates every request to the Perplexity API (for example via Authorization: Bearer $PERPLEXITY_API_KEY). Perplexity ties keys to a project in the API Portal—the billing and access boundary for credits, team members, and keys.

Before you can generate any API keys, you must first create a project through the Perplexity web interface.

— Perplexity, API Key Management

A project lets you manage billing, create and revoke keys, invite members, and monitor usage. See Projects & Billing for portal layout (console.perplexity.ai) and credit-based billing.

Key family Who manages it Primary use Cluster docs
Platform API keys Project admins Agent, Search, Embeddings, Orchestrator calls API Key Management, Quickstart
Analytics API key Org admins (Computer settings) Org usage analytics only Analytics API
Audit log API key Org admins (Enterprise APIs) Read organization audit logs Audit API

Platform keys are not interchangeable with Analytics or Audit keys; each authenticates only its own endpoints.

Create an API key in the API Portal: console workflow

Section titled “Create an API key in the API Portal: console workflow”

To mint your first platform key after a project exists, use the API Keys area in the portal (also referenced from Getting started and the SDK overview).

  1. Open Projects & Billing and sign in at the API Portal (console.perplexity.ai).

  2. Create a project if you do not have one yet (for example separate Production and Development projects).

  3. Go to API keys in the sidebar and choose + Generate API Key.

  4. Copy the full key immediately and store it in a secrets manager—Perplexity does not show it again.

API keys are shown only once. When you create an API key — through the console or programmatically — the full token is returned at that moment and cannot be retrieved again. Save it immediately to a secure location before closing the page or response.

— Perplexity, API Key Management

You may create multiple keys per project for different environments or services. Sending a request without credits blocks the key until you top up; enabling auto-reload on the Projects & Billing billing page avoids unexpected cutoffs.

Provision keys via AWS Marketplace or Stripe Projects

Section titled “Provision keys via AWS Marketplace or Stripe Projects”

Enterprise teams sometimes receive an initial platform key through procurement flows rather than manual portal setup.

AWS Marketplace: After purchase, you must complete Marketplace registration; purchase alone does not provision a project or key. Perplexity then creates an API project, applies credits, and generates an initial key for the billing contact email. Those credits land in a new project, not an existing self-service project. Details: AWS Marketplace.

Stripe Projects: Running stripe projects add perplexity/api creates a Perplexity API project, mints a key, and writes PERPLEXITY_API_KEY to the Stripe project .env. See Perplexity on Stripe Projects.

/generate_auth_token and /revoke_auth_token: programmatic key lifecycle

Section titled “/generate_auth_token and /revoke_auth_token: programmatic key lifecycle”

After at least one key exists, Perplexity exposes two management endpoints documented in API Key Management and the Generate Auth Token reference.

Endpoint Method Purpose
https://api.perplexity.ai/generate_auth_token POST Create a new API key
https://api.perplexity.ai/revoke_auth_token POST Revoke an existing key permanently

Both require Authorization: Bearer YOUR_EXISTING_API_KEY and Content-Type: application/json. Optional body field: token_name.

A successful generate response includes auth_token, created_at_epoch_seconds, and optional token_name:

{
"auth_token": "pplx-1234567890abcdef",
"created_at_epoch_seconds": 1735689600,
"token_name": "Production API Key"
}

Store the auth_token immediately and securely. This is the only time the full token value is returned — it cannot be retrieved later from any endpoint or from the console.

— Perplexity, API Key Management

Revocation sends the key to revoke in the JSON body as auth_token. Once revoked, the key cannot be recovered; update all callers before revoking production keys.

API key rotation: zero-downtime steps and tooling

Section titled “API key rotation: zero-downtime steps and tooling”

Rotation means issuing a new key, migrating workloads, then revoking the old credential. Perplexity documents a four-step pattern in API Key Management: generate while the old key is still valid, deploy the new secret, wait for propagation, then revoke.

The changelog describes a rotation mechanism aimed at production: keep the old key active during migration, update applications, then deactivate the old key—with guidance to rotate every 30–90 days, use environment variables, test in staging, and monitor usage.

Recommended order:

  1. Generate a new key (/generate_auth_token or the portal).
  2. Update secrets (environment variables, Kubernetes secrets, etc.) and verify with a low-cost call (docs suggest POST https://api.perplexity.ai/v1/agent with a minimal payload).
  3. Monitor logs until all instances use the new key (docs use a propagation window before revoke).
  4. Revoke the old auth_token via /revoke_auth_token.

Stripe Projects adds a built-in rotate command with a grace period:

Rotate mints a fresh key and updates .env. The old key keeps working for 24 hours so running deployments don’t break mid-rotation.

— Perplexity, Perplexity on Stripe Projects

Use stripe projects rotate perplexity-api for that flow; stripe projects remove perplexity-api revokes immediately (including a key still inside the 24-hour window).

For comparison, other providers in this cluster state the same principle in shorter form:

Regularly rotate your API keys as a security best practice. You can generate new and revoke old keys from the dashboard.

— Brave, Authentication

Common conclusion: generate the replacement first, deploy it everywhere that matters, then revoke the old key—never revoke before all clients have switched.

If a key may have leaked, Perplexity’s API Key Management compromise section says to: generate a new key, update applications, revoke the compromised key, review access logs, and add controls such as IP allowlisting where available.

Never expose platform keys in:

  • Client-side JavaScript
  • Mobile apps distributed to users
  • Public repositories
  • Logs, error messages, URLs, or query parameters

That aligns with Chrome extension guidance to proxy calls through your server rather than embedding keys in extensions (Extensions and AI) and with Cloudflare’s reminder to treat global API credentials like passwords (Wrangler authentication).

Analytics API key: org-scoped usage queries

Section titled “Analytics API key: org-scoped usage queries”

The Analytics API lets admins query organization Perplexity Computer usage programmatically with a free, org-scoped key separate from platform billing keys.

Access steps:

  1. In the Perplexity web app, open organization Computer settings → Analytics.
  2. Turn on Analytics API.
  3. Select Generate key in the row below the toggle.

Important properties:

Org-scoped, admin-managed — the key belongs to your organization, not to the admin who created it. Any org admin can view the current key and regenerate it.

— Perplexity, Analytics API

Property Behavior
Active keys At most one active analytics key; regenerating revokes the previous
Scope Analytics endpoints only; no billing, no other Perplexity APIs
Disable toggle Turning Analytics API off permanently revokes the key

Audit log API key: read-only audit_logs:read

Section titled “Audit log API key: read-only audit_logs:read”

The Audit API supplies read-only access to organization audit events for SIEM or compliance tooling.

  1. In the Perplexity web app, open organization settings → Enterprise APIs.

  2. Under Audit API → Audit log API keys, select Create key, name it (for example SIEM production), and confirm.

  3. Copy the key once; later views show only name and creation date.

Scope. Keys are read-only and limited to the audit_logs:read scope. They cannot change settings, manage members, or call other Perplexity APIs.

— Perplexity, Audit API

Revoked audit keys return 401 immediately. Each successful API read also writes an audit_events_accessed event. If key creation is unavailable, contact your Perplexity account team to enable the Audit API for the organization.

Troubleshooting rotation and auth failures

Section titled “Troubleshooting rotation and auth failures”

Perplexity lists typical issues in API Key Management:

Issue What to check
Authentication failed after rotation New key not deployed on every instance
Cannot revoke Bearer token must be a valid key with permission to manage tokens
Key generation fails Account status and API tier limits
Services still on old key Secret rotation in CI/CD or orchestration

For account or billing problems outside public forums, System Status points to api@perplexity.ai. AWS Marketplace access issues use aws-api@perplexity.ai per AWS Marketplace.

  1. Sign in at the API Portal and confirm your project shows the expected keys under API keys with correct names and creation dates.

  2. From a secure backend (not a browser), call POST https://api.perplexity.ai/v1/agent with Authorization: Bearer and a minimal body as in Quickstart or Stripe Projects integration; expect a successful response when credits and the key are valid.

  3. If you use programmatic rotation, run /generate_auth_token, update one non-production worker, confirm success, then /revoke_auth_token on a disposable test key before touching production—follow API Key Management.

  4. Org admins: verify Analytics or Audit keys only hit their intended APIs per Analytics API and Audit API (wrong key type usually fails auth immediately).

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about so it can be corrected quickly.