perplexity-upgrade-migration

Migrate between Perplexity model generations and API parameter changes. Use when upgrading to new Sonar models, handling deprecated parameters, or migrating from legacy pplx-api models. Trigger with phrases like "upgrade perplexity", "perplexity migration", "perplexity model change", "update perplexity", "perplexity deprecated".

1,868 stars

Best use case

perplexity-upgrade-migration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Migrate between Perplexity model generations and API parameter changes. Use when upgrading to new Sonar models, handling deprecated parameters, or migrating from legacy pplx-api models. Trigger with phrases like "upgrade perplexity", "perplexity migration", "perplexity model change", "update perplexity", "perplexity deprecated".

Teams using perplexity-upgrade-migration should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/perplexity-upgrade-migration/SKILL.md --create-dirs "https://raw.githubusercontent.com/jeremylongshore/claude-code-plugins-plus-skills/main/plugins/saas-packs/perplexity-pack/skills/perplexity-upgrade-migration/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/perplexity-upgrade-migration/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How perplexity-upgrade-migration Compares

Feature / Agentperplexity-upgrade-migrationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Migrate between Perplexity model generations and API parameter changes. Use when upgrading to new Sonar models, handling deprecated parameters, or migrating from legacy pplx-api models. Trigger with phrases like "upgrade perplexity", "perplexity migration", "perplexity model change", "update perplexity", "perplexity deprecated".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Perplexity Upgrade & Migration

## Current State
!`npm list openai 2>/dev/null | grep openai || echo 'openai not installed'`
!`pip show openai 2>/dev/null | grep Version || echo 'N/A'`

## Overview
Guide for migrating between Perplexity model generations and API changes. Perplexity has evolved from pplx-api with third-party models to the Sonar family with built-in web search.

## Model Evolution

| Era | Models | Status |
|-----|--------|--------|
| Legacy (pre-2025) | `pplx-7b-online`, `pplx-70b-online`, `llama-3.1-sonar-*` | Deprecated |
| Current (2025) | `sonar`, `sonar-pro` | Active |
| Extended (2025+) | `sonar-reasoning-pro`, `sonar-deep-research` | Active |

## Instructions

### Step 1: Identify Legacy Patterns to Update

```bash
set -euo pipefail
# Find deprecated model names in your codebase
grep -rn "pplx-7b\|pplx-70b\|llama.*sonar\|sonar-small\|sonar-medium\|sonar-huge" \
  --include="*.ts" --include="*.py" --include="*.js" --include="*.json" \
  . 2>/dev/null || echo "No legacy models found"

# Find old base URLs
grep -rn "api.perplexity.com\|pplx.readme.io" \
  --include="*.ts" --include="*.py" --include="*.js" \
  . 2>/dev/null || echo "No legacy URLs found"
```

### Step 2: Model Name Migration Map

```typescript
// Migration map: old model name -> new model name
const MODEL_MIGRATION: Record<string, string> = {
  // Legacy pplx-api models (fully deprecated)
  "pplx-7b-online": "sonar",
  "pplx-70b-online": "sonar-pro",
  "pplx-7b-chat": "sonar",
  "pplx-70b-chat": "sonar",

  // Llama-era Sonar models (deprecated)
  "llama-3.1-sonar-small-128k-online": "sonar",
  "llama-3.1-sonar-large-128k-online": "sonar-pro",
  "llama-3.1-sonar-huge-128k-online": "sonar-pro",
  "sonar-small-online": "sonar",
  "sonar-medium-online": "sonar-pro",

  // Current models (no migration needed)
  "sonar": "sonar",
  "sonar-pro": "sonar-pro",
  "sonar-reasoning-pro": "sonar-reasoning-pro",
  "sonar-deep-research": "sonar-deep-research",
};

function migrateModel(model: string): string {
  const migrated = MODEL_MIGRATION[model];
  if (!migrated) {
    console.warn(`Unknown Perplexity model: ${model}. Defaulting to sonar.`);
    return "sonar";
  }
  if (migrated !== model) {
    console.warn(`Perplexity model ${model} is deprecated. Using ${migrated}.`);
  }
  return migrated;
}
```

### Step 3: URL Migration

```typescript
// Old URLs -> New URL
const BASE_URL_MIGRATION: Record<string, string> = {
  "https://api.perplexity.com": "https://api.perplexity.ai",
  "https://pplx-api.perplexity.ai": "https://api.perplexity.ai",
};

// Current canonical base URL
const PERPLEXITY_BASE_URL = "https://api.perplexity.ai";
```

### Step 4: Parameter Changes

```typescript
// Parameters that changed between API versions
// OLD: return_citations: true
// NEW: Citations are always returned in the response object

// OLD: No search_recency_filter
// NEW: search_recency_filter: "hour" | "day" | "week" | "month"

// OLD: No search_domain_filter
// NEW: search_domain_filter: string[] (max 20, prefix with - to exclude)

// OLD: No return_related_questions
// NEW: return_related_questions: true (closed beta)

// OLD: No return_images
// NEW: return_images: true (Tier-2+ only)

// OLD: No search_after_date_filter / search_before_date_filter
// NEW: search_after_date_filter: "3/1/2025" (mm/dd/yyyy format)
```

### Step 5: Upgrade OpenAI SDK
```bash
set -euo pipefail
# Create upgrade branch
git checkout -b upgrade/perplexity-sonar-migration

# Upgrade OpenAI SDK to latest
npm install openai@latest
# or
pip install --upgrade openai

# Run tests
npm test

# Verify connection with new models
node -e "
const OpenAI = require('openai');
const c = new OpenAI({apiKey: process.env.PERPLEXITY_API_KEY, baseURL: 'https://api.perplexity.ai'});
c.chat.completions.create({model:'sonar', messages:[{role:'user',content:'test'}], max_tokens:5})
  .then(r => console.log('OK:', r.model))
  .catch(e => console.error('FAIL:', e.message));
"
```

## Rollback
```bash
set -euo pipefail
# If the upgrade breaks things, revert
git checkout main -- package.json package-lock.json
npm install
```

## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| `Invalid model` error | Using deprecated model name | Apply model migration map |
| `Connection refused` | Wrong base URL | Use `https://api.perplexity.ai` |
| Missing citations | Expecting old response format | Citations are in `response.citations` array |
| Parameter rejected | Using old parameter names | Check current parameter list |

## Output
- Updated model names to current Sonar family
- Corrected base URL to `api.perplexity.ai`
- Updated parameters to current API spec
- Passing test suite

## Resources
- [Perplexity Model Cards](https://docs.perplexity.ai/getting-started/models)
- [API Changelog](https://docs.perplexity.ai)
- [Meet New Sonar (Blog)](https://www.perplexity.ai/hub/blog/meet-new-sonar)

## Next Steps
For CI integration during upgrades, see `perplexity-ci-integration`.

Related Skills

workhuman-upgrade-migration

1868
from jeremylongshore/claude-code-plugins-plus-skills

Workhuman upgrade migration for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman upgrade migration".

wispr-upgrade-migration

1868
from jeremylongshore/claude-code-plugins-plus-skills

Wispr Flow upgrade migration for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr upgrade migration".

windsurf-upgrade-migration

1868
from jeremylongshore/claude-code-plugins-plus-skills

Upgrade Windsurf IDE, migrate settings from VS Code or Cursor, and handle breaking changes. Use when upgrading Windsurf versions, migrating from another editor, or handling configuration changes after updates. Trigger with phrases like "upgrade windsurf", "windsurf update", "migrate to windsurf", "windsurf from cursor", "windsurf from vscode".

windsurf-migration-deep-dive

1868
from jeremylongshore/claude-code-plugins-plus-skills

Migrate to Windsurf from VS Code, Cursor, or other AI IDEs with full configuration transfer. Use when migrating a team to Windsurf, transferring Cursor rules, or evaluating Windsurf against other AI editors. Trigger with phrases like "migrate to windsurf", "switch to windsurf", "windsurf from cursor", "windsurf from copilot", "windsurf evaluation".

webflow-upgrade-migration

1868
from jeremylongshore/claude-code-plugins-plus-skills

Analyze, plan, and execute Webflow SDK upgrades (webflow-api v1 to v3) with breaking change detection, API v1-to-v2 migration, and deprecation handling. Trigger with phrases like "upgrade webflow", "webflow migration", "webflow breaking changes", "update webflow SDK", "webflow v1 to v2".

webflow-migration-deep-dive

1868
from jeremylongshore/claude-code-plugins-plus-skills

Execute major Webflow migrations — from other CMS platforms to Webflow CMS, between Webflow sites, or large-scale content re-architecture using the Data API v2 bulk endpoints, strangler fig pattern, and data validation. Trigger with phrases like "migrate to webflow", "webflow migration", "import into webflow", "webflow replatform", "move content to webflow", "webflow bulk import", "wordpress to webflow".

vercel-upgrade-migration

1868
from jeremylongshore/claude-code-plugins-plus-skills

Upgrade Vercel CLI, Node.js runtime, and Next.js framework versions with breaking change detection. Use when upgrading Vercel CLI versions, migrating Node.js runtimes, or updating Next.js between major versions on Vercel. Trigger with phrases like "upgrade vercel", "vercel migration", "vercel breaking changes", "update vercel CLI", "next.js upgrade on vercel".

vercel-migration-deep-dive

1868
from jeremylongshore/claude-code-plugins-plus-skills

Migrate to Vercel from other platforms or re-architecture existing Vercel deployments. Use when migrating from Netlify, AWS, or Cloudflare to Vercel, or when re-platforming an existing Vercel application. Trigger with phrases like "migrate to vercel", "vercel migration", "switch to vercel", "netlify to vercel", "aws to vercel", "vercel replatform".

veeva-upgrade-migration

1868
from jeremylongshore/claude-code-plugins-plus-skills

Veeva Vault upgrade migration for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva upgrade migration".

veeva-migration-deep-dive

1868
from jeremylongshore/claude-code-plugins-plus-skills

Veeva Vault migration deep dive for enterprise operations. Use when implementing advanced Veeva Vault patterns. Trigger: "veeva migration deep dive".

vastai-upgrade-migration

1868
from jeremylongshore/claude-code-plugins-plus-skills

Upgrade Vast.ai CLI, migrate API versions, and handle breaking changes. Use when upgrading vastai CLI, detecting deprecations, or migrating between API versions. Trigger with phrases like "upgrade vastai", "vastai migration", "vastai breaking changes", "update vastai CLI".

vastai-migration-deep-dive

1868
from jeremylongshore/claude-code-plugins-plus-skills

Migrate GPU workloads to or from Vast.ai, or between GPU providers. Use when switching from AWS/GCP/Azure GPU instances to Vast.ai, migrating between GPU types, or re-platforming ML infrastructure. Trigger with phrases like "migrate to vastai", "vastai migration", "switch to vastai", "vastai from aws", "vastai from lambda".