Official documentation checked October 14, 2026.
Create a Perplexity API key in the API Console, not in a browser extension or a third-party key generator. The API has its own project, access and billing settings. A personal Pro subscription is not a prerequisite and does not turn API requests into unlimited, included usage.
This guide covers creating a first key and connecting it safely. It does not require you to expose a credential in a terminal transcript or purchase a different consumer subscription.
1. Check the Account, Project and API Budget
Open the official API Console directly and sign in to the intended account. If you are joining an existing team, ask its administrator for an invitation and the correct project rather than creating an unrelated billing workspace.
For a new setup, create a project through the console’s Project settings. API projects organize credentials and billing; they are not the same thing as research Projects in the consumer Perplexity app. Follow the Projects & Billing guide for the current setup screens.
Review the project’s balance and payment settings before making a request. API usage consumes purchased credits according to the selected service and its pricing. Automatic reload can create further charges; enable it only with an approved budget. Consumer plan benefits and API credits are separate, as explained in the plan guide.
2. Generate and Save the Key Securely
- In the intended API project, open API keys.
- Select Generate API Key and give it a descriptive purpose, such as a development integration rather than an ambiguous shared name.
- Save the returned secret directly in your approved password or secrets manager. Perplexity says the complete key is displayed only at creation and cannot be retrieved later.
The key-management documentation describes the console and programmatic workflows. The first key needs the console setup; an automated key-generation request requires an existing credential.
Do not paste the key into a support ticket, screenshot, public repository or browser-side JavaScript. A public web app must keep its service credential on a protected backend. Separate development and production credentials so one test does not require distributing a production secret.
3. Connect the Intended Runtime and Test Carefully
Use the application’s secret configuration or deployment platform to supply the credential to the process that needs it. Perplexity examples use PERPLEXITY_API_KEY. Setting a variable in one terminal does not automatically update an already-running service, container or notebook.
Avoid typing the literal secret into a command that is saved in shell history. Never commit a local secret file; an environment variable is also not safe if your application dumps the entire environment into logs.
Choose the current quickstart for the API you actually intend to use. A minimal request can incur charges. Review the endpoint, payload and cost before running one, use nonsensitive input, and check the returned status and expected output. This editorial review did not create a key or execute a paid request.
4. Diagnose Failures Without Unnecessary Key Deletion
A missing configuration value, authentication failure, rate limit and insufficient balance require different checks. Read the error before generating another credential. The SDK error guide separates authentication, permission, validation, rate-limit and server errors.
If a key was not saved securely at creation, create a replacement deliberately. For planned rotation, update and verify every dependent application before revoking the old key. Revocation is irreversible. If the key has leaked, treat that as an incident: contain access promptly, replace the credential and review unexpected usage with the project administrator.
A working API request proves that specific integration worked at that time; it does not establish unlimited quota or successful deployment to every service. Keep the key’s owner, purpose and deployment locations recorded without recording the secret itself.
Glad it helped. Take a short break with a game:
Sorry about that. Search for the exact error message, or look for a tool that checks your device: