perplexity-multi-env-setup

Featured

Configure Perplexity Sonar API across development, staging, and production environments. Use when setting up multi-environment search integrations, managing API keys per environment, or controlling cost through model routing by env. Trigger with phrases like "perplexity environments", "perplexity staging", "perplexity dev prod", "perplexity environment config".

AI & Automation 2,940 stars 439 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Perplexity Multi-Environment Setup ## Overview Configure Perplexity Sonar API across dev/staging/prod. Key decisions per environment: which models are allowed (sonar vs sonar-pro), rate limits, and cost caps. All environments use the same base URL (`https://api.perplexity.ai`) but different API keys with different budget limits. ## Environment Strategy | Environment | Model | Rate Limit | Key Source | Monthly Budget | |-------------|-------|-----------|------------|----------------| | Development | `sonar` only | 5 RPM self-imposed | `.env.local` | $10 | | Staging | `sonar` only | 20 RPM | CI secrets | $50 | | Production | `sonar` + `sonar-pro` | 50 RPM | Secret manager | $500+ | ## Prerequisites - Separate Perplexity API keys per environment - `openai` package installed - Secret management (env files for dev, vault/KMS for prod) ## Instructions ### Step 1: Configuration Structure ``` config/ perplexity/ base.ts # OpenAI client + base URL development.ts # Dev: sonar only, low limits staging.ts # Staging: sonar only, moderate limits production.ts # Prod: full model access index.ts # Environment resolver ``` ### Step 2: Base Configuration ```typescript // config/perplexity/base.ts import OpenAI from "openai"; export const PERPLEXITY_BASE_URL = "https://api.perplexity.ai"; export function createPerplexityClient(apiKey: string): OpenAI { if (!apiKey) throw new Error("Perplexity API key is required"); if (!apiKe...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category