PE

perplexity-sdk-patterns

Use idiomatic patterns for the Perplexity SDK, including citation handling and OpenAI-compatible client wrappers.

Install

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

Installs to .claude/skills/perplexity-sdk-patterns

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.

Apply production-ready Perplexity Sonar API patterns for TypeScript
67 charsno explicit “when” trigger
Intermediate

Key capabilities

  • →Create a typed client for the Perplexity Sonar API
  • →Parse full responses including citations, search results, and related questions
  • →Implement retry logic with exponential backoff for API calls
  • →Format citations as Markdown or footnotes
  • →Reuse client instances efficiently using caching
  • →Configure search queries with recency and domain filters

How it works

This skill provides patterns for wrapping the OpenAI client to interact with the Perplexity Sonar API, handling Perplexity-specific response elements like citations and search results, and implementing retry logic.

Inputs & outputs

You give it
Perplexity API key, search query, model name, system prompt, search options
You get back
Answer with citations, related questions, and usage statistics

When to use perplexity-sdk-patterns

  • →Wrap OpenAI clients for Perplexity
  • →Handle citations in search responses
  • →Structure search-augmented generation logic
  • →Implement standardized chat completion calls

About perplexity-sdk-patterns

Applies production-ready code patterns for Perplexity's Sonar API. Standardizes response handling for citations, search results, and related queries in TypeScript and Python.

Apply production-ready Perplexity SDK patterns for TypeScript and Python. Use when implementing Perplexity integrations, refactoring SDK usage, or establishing team coding standards for Perplexity. Trigger with phrases like "perplexity SDK patterns", "perplexity best practices", "perplexity code patterns", "idiomatic perplexity".

When not to use it

  • →When not interacting with the Perplexity Sonar API
  • →When not requiring parsing of citations or search results from Perplexity
  • →When not needing retry logic for Perplexity API calls

Prerequisites

`openai` package installedAPI key configured in `PERPLEXITY_API_KEY`Understanding of OpenAI chat completions format

Limitations

  • →The patterns are specific to the Perplexity Sonar API
  • →Search domain filter has a maximum of 20 domains
  • →Retry logic is applied only for rate limit, timeout, or server errors

How it compares

This skill extends the generic OpenAI client usage to specifically handle Perplexity's unique features like citations and search results, providing structured access to these elements.

Compared to similar skills

perplexity-sdk-patterns side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
perplexity-sdk-patterns (this skill)02moReviewIntermediate
similarity-search-patterns34moNo flagsAdvanced
ai-engineer75moNo flagsAdvanced
llm-application-dev36moReviewIntermediate

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

Search skills

Search the agent skills registry