home / skills / jeremylongshore / claude-code-plugins-plus-skills / perplexity-install-auth

This skill helps you install and authenticate the Perplexity SDK/CLI, configuring API keys and validating the connection.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill perplexity-install-auth

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.3 KB
---
name: perplexity-install-auth
description: |
  Install and configure Perplexity SDK/CLI authentication.
  Use when setting up a new Perplexity integration, configuring API keys,
  or initializing Perplexity in your project.
  Trigger with phrases like "install perplexity", "setup perplexity",
  "perplexity auth", "configure perplexity API key".
allowed-tools: Read, Write, Edit, Bash(npm:*), Bash(pip:*), Grep
version: 1.0.0
license: MIT
author: Jeremy Longshore <[email protected]>
---

# Perplexity Install & Auth

## Overview
Set up Perplexity SDK/CLI and configure authentication credentials.

## Prerequisites
- Node.js 18+ or Python 3.10+
- Package manager (npm, pnpm, or pip)
- Perplexity account with API access
- API key from Perplexity dashboard

## Instructions

### Step 1: Install SDK
```bash
# Node.js
npm install @perplexity/sdk

# Python
pip install perplexity
```

### Step 2: Configure Authentication
```bash
# Set environment variable
export PERPLEXITY_API_KEY="your-api-key"

# Or create .env file
echo 'PERPLEXITY_API_KEY=your-api-key' >> .env
```

### Step 3: Verify Connection
```typescript
// Test connection code here
```

## Output
- Installed SDK package in node_modules or site-packages
- Environment variable or .env file with API key
- Successful connection verification output

## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Invalid API Key | Incorrect or expired key | Verify key in Perplexity dashboard |
| Rate Limited | Exceeded quota | Check quota at https://docs.perplexity.com |
| Network Error | Firewall blocking | Ensure outbound HTTPS allowed |
| Module Not Found | Installation failed | Run `npm install` or `pip install` again |

## Examples

### TypeScript Setup
```typescript
import { PerplexityClient } from '@perplexity/sdk';

const client = new PerplexityClient({
  apiKey: process.env.PERPLEXITY_API_KEY,
});
```

### Python Setup
```python
from perplexity import PerplexityClient

client = PerplexityClient(
    api_key=os.environ.get('PERPLEXITY_API_KEY')
)
```

## Resources
- [Perplexity Documentation](https://docs.perplexity.com)
- [Perplexity Dashboard](https://api.perplexity.com)
- [Perplexity Status](https://status.perplexity.com)

## Next Steps
After successful auth, proceed to `perplexity-hello-world` for your first API call.

Overview

This skill guides you through installing the Perplexity SDK/CLI and configuring authentication so your projects can make authenticated API calls. It covers Node.js and Python installation, setting the PERPLEXITY_API_KEY, and verifying a working connection. Use it to get Perplexity ready for development or CI environments.

How this skill works

The skill installs the official Perplexity package for Node.js or Python and ensures the API key is available to your runtime via an environment variable or .env file. It provides quick verification steps to confirm the client can authenticate and offers troubleshooting for common errors like invalid keys, rate limits, and network issues. Example snippets show how to instantiate the Perplexity client in TypeScript and Python.

When to use it

  • Setting up Perplexity for a new project
  • Adding Perplexity auth to CI/CD or server environments
  • Rotating or updating Perplexity API keys
  • Troubleshooting authentication or connection failures
  • Preparing a developer environment for Perplexity SDK usage

Best practices

  • Use environment variables (PERPLEXITY_API_KEY) rather than committing keys to source control
  • Store secrets in a secure vault for CI/CD and inject them at build/runtime
  • Confirm Node.js >=18 or Python >=3.10 and your package manager is up to date
  • Run a quick verification script after installing to detect permission or network issues early
  • Monitor quota and rate limits via Perplexity dashboard and backoff on 429 responses

Example use cases

  • Install the SDK in a new repo and export PERPLEXITY_API_KEY before running examples
  • Add a .env entry for local development and use dotenv to load credentials in Python/Node
  • Configure a CI job to inject PERPLEXITY_API_KEY from secrets manager for automated tests
  • Rotate a compromised key: generate a new key in the dashboard, update environment variables, and verify connectivity
  • Debug a failing integration by checking error messages for invalid key, rate limit, or network block

FAQ

How do I set the API key for local development?

Create a .env file with PERPLEXITY_API_KEY=your-api-key or export PERPLEXITY_API_KEY="your-api-key" in your shell before running your app.

Which package should I install for Node.js vs Python?

For Node.js install @perplexity/sdk with npm or pnpm. For Python install the perplexity package via pip.

What if I get an Invalid API Key error?

Verify the key in the Perplexity dashboard, ensure there are no extra characters or quotes, and confirm the environment variable is loaded in the process running the client.

How can I avoid hitting rate limits in production?

Monitor usage and quotas, implement exponential backoff on 429 responses, and request a quota increase from Perplexity if needed.