PE

perplexity-install-auth

Set up your environment and install the necessary libraries to authenticate with the Perplexity API.

Install

mkdir -p .claude/skills/perplexity-install-auth && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5442" && unzip -o skill.zip -d .claude/skills/perplexity-install-auth && rm skill.zip

Installs to .claude/skills/perplexity-install-auth

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Install and configure Perplexity Sonar API authentication.
58 charsno explicit “when” trigger
Beginner

Key capabilities

  • Install OpenAI client library for Perplexity
  • Configure Perplexity API authentication
  • Verify API connection with sonar models
  • Manage API keys via environment variables

How it works

The skill configures the standard OpenAI client library to point to the Perplexity Sonar API base URL. It validates connectivity by executing a chat completion request.

Inputs & outputs

You give it
API key and model selection
You get back
OpenAI client configured with Perplexity base URL

When to use perplexity-install-auth

  • Initializing new Perplexity projects
  • Managing API keys securely
  • Installing required client SDKs
  • Configuring environment variables

About this skill

Perplexity Install & Auth

Overview

Set up Perplexity Sonar API access using the OpenAI-compatible chat completions endpoint at https://api.perplexity.ai. Perplexity does not have a custom SDK -- you use the standard OpenAI client library pointed at Perplexity's base URL.

Prerequisites

Instructions

Step 1: Install OpenAI Client Library

set -euo pipefail
# Node.js / TypeScript
npm install openai

# Python
pip install openai

There is no @perplexity/sdk package. Perplexity uses the OpenAI wire format, so you use the official openai package with a custom baseURL.

Step 2: Configure API Key

# Set environment variable
export PERPLEXITY_API_KEY="pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Or create .env file (add .env to .gitignore)
echo 'PERPLEXITY_API_KEY=pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' >> .env

API keys start with pplx- and are generated at perplexity.ai/settings/api. You must add credits to your account before making API calls.

Step 3: Verify Connection (TypeScript)

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.PERPLEXITY_API_KEY,
  baseURL: "https://api.perplexity.ai",
});

async function verify() {
  const response = await client.chat.completions.create({
    model: "sonar",
    messages: [{ role: "user", content: "What is 2+2?" }],
    max_tokens: 50,
  });
  console.log("Connected:", response.choices[0].message.content);
  console.log("Model:", response.model);
  console.log("Tokens used:", response.usage?.total_tokens);
}

verify().catch(console.error);

Step 4: Verify Connection (Python)

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["PERPLEXITY_API_KEY"],
    base_url="https://api.perplexity.ai",
)

response = client.chat.completions.create(
    model="sonar",
    messages=[{"role": "user", "content": "What is 2+2?"}],
    max_tokens=50,
)
print("Connected:", response.choices[0].message.content)
print("Model:", response.model)
print("Tokens:", response.usage.total_tokens)

Available Models

ModelUse CaseInput $/M tokensOutput $/M tokens
sonarFast search, simple queries$1$1
sonar-proDeep research, more citations$3$15
sonar-reasoning-proChain-of-thought with search$3$15
sonar-deep-researchMulti-step research synthesis$2$8

Error Handling

ErrorCauseSolution
401 UnauthorizedInvalid or missing API keyVerify key starts with pplx- and has credits
403 ForbiddenKey lacks model accessCheck key permissions at perplexity.ai/settings
Module not found: openaiSDK not installedRun npm install openai or pip install openai
Connection refusedWrong base URLEnsure baseURL is https://api.perplexity.ai

Output

  • OpenAI client configured with Perplexity base URL
  • Successful API response confirming connection
  • Token usage confirming billing is active

Resources

Next Steps

After successful auth, proceed to perplexity-hello-world for your first search query.

Prerequisites

Node.js 18+ or Python 3.10+Perplexity accountPerplexity API key

Limitations

  • No custom Perplexity SDK available
  • Requires account credits for API calls

How it compares

Unlike using a custom SDK, this approach uses the standard OpenAI client library with a custom base URL.

Compared to similar skills

perplexity-install-auth side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
perplexity-install-auth (this skill)127dReviewBeginner
twilio-communications36moReviewIntermediate
lindy-install-auth427dCautionBeginner
clay-install-auth027dCautionBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

twilio-communications

davila7

Build communication features with Twilio: SMS messaging, voice calls, WhatsApp Business API, and user verification (2FA). Covers the full spectrum from simple notifications to complex IVR systems and multi-channel authentication. Critical focus on compliance, rate limits, and error handling. Use when: twilio, send SMS, text message, voice call, phone verification.

324

lindy-install-auth

jeremylongshore

Install and configure Lindy AI SDK/CLI authentication. Use when setting up a new Lindy integration, configuring API keys, or initializing Lindy in your project. Trigger with phrases like "install lindy", "setup lindy", "lindy auth", "configure lindy API key".

410

clay-install-auth

jeremylongshore

Install and configure Clay SDK/CLI authentication. Use when setting up a new Clay integration, configuring API keys, or initializing Clay in your project. Trigger with phrases like "install clay", "setup clay", "clay auth", "configure clay API key".

06

evernote-install-auth

jeremylongshore

Install and configure Evernote SDK and OAuth authentication. Use when setting up a new Evernote integration, configuring API keys, or initializing Evernote in your project. Trigger with phrases like "install evernote", "setup evernote", "evernote auth", "configure evernote API", "evernote oauth".

14

instantly-install-auth

jeremylongshore

Install and configure Instantly SDK/CLI authentication. Use when setting up a new Instantly integration, configuring API keys, or initializing Instantly in your project. Trigger with phrases like "install instantly", "setup instantly", "instantly auth", "configure instantly API key".

12

openrouter-install-auth

jeremylongshore

Execute set up OpenRouter API authentication and configure API keys. Use when starting a new OpenRouter integration or troubleshooting auth issues. Trigger with phrases like 'openrouter setup', 'openrouter api key', 'openrouter authentication', 'configure openrouter'.

03

Search skills

Search the agent skills registry