DOCS-BASED · UI checked 2026-10-10
Perplexity API for beginners: your first web-grounded answer
Perplexity's API quickstart covers creating a key and making a first call. Perplexity describes its Agent API as giving web-grounded answers with citations, priced pay-as-you-go.
- Generate an API key on the API Keys page in the API Console.
- Set it as an environment variable named PERPLEXITY_API_KEY. Never paste the key into shared code.
- Install the SDK: pip install perplexityai (Python) or npm install @perplexity-ai/perplexity_ai (Node).
- Make a first Agent API call with a preset (the docs use preset="low") and your question as input.
- Read the citations in the response and open the sources yourself before relying on the answer.
API use is billed per call with no subscription needed, according to Perplexity. Check the pricing page before running many requests.
Docs-based guide. TaskVerdict has not tested this tool yet. Labels and menus can change, and may appear in another language in your app.
Sources
- Quickstart, Perplexity API Docs · checked 2026-10-10