Before using these agents, you must have a valid API key from Perplexity AI. This key is required to authenticate requests through OpenCode.
-
Create or log into your account on Perplexity AI.
-
Navigate to Settings → API → API keys and generate an API key.
-
Log in to OpenCode:
opencode auth login
-
When prompted, select
perplexityand paste your Perplexity API key. OpenCode will securely store and use it for all agent requests.
"perplexity": {
"npm": "@ai-sdk/perplexity",
"name": "Perplexity AI",
"options": {
"baseURL": "https://api.perplexity.ai"
},
"models": {
"sonar-deep-research": {
"name": "Perplexity Sonar Deep Research"
}
}
}.opencode/agent/ .md files (https://opencode.ai/docs/agents/)
Model: perplexity/sonar
Purpose: Comprehensive search and analysis capabilities using Perplexity AI's sonar model for real-time information queries, multi-source research requiring synthesis and citation, comparative analysis across products or concepts, topic exploration needing comprehensive background, or fact verification with source attribution.
Key Capabilities:
- Multi-source information gathering with automatic citation
- Query optimization for precise results
- Source credibility assessment
- Real-time data access and processing
- Structured markdown responses with inline citations
- Visual elements (tables, lists, code blocks) for clarity
Usage Examples:
- Real-time information queries (e.g., latest developments in AI safety research)
- Comparative analysis (e.g., React vs Vue.js frameworks)
- Fact verification with citations
Model: perplexity/sonar-pro
Purpose: Complex research requiring deeper analysis, multi-step reasoning, and sophisticated source evaluation for technical, academic, or specialized domain queries needing expert-level analysis, high-stakes decisions, or multi-layered problem solving.
Key Capabilities:
- Multi-step logical analysis and inference
- Cross-domain knowledge synthesis
- Complex pattern recognition and trend analysis
- Enhanced fact-checking with multiple source verification
- Bias detection and balanced perspective presentation
- Technical documentation analysis with code examples
- Academic rigor with methodology evaluation
Usage Examples:
- Technical security analysis (e.g., quantum computing implications for encryption)
- Academic research evaluation (e.g., CRISPR gene editing ethics)
Model: perplexity/sonar-reasoning
Purpose: Research with explicit logical reasoning, step-by-step analysis, and transparent decision-making processes for problems requiring diagnostic thinking, troubleshooting, educational contexts, or verification tasks where understanding the reasoning path is crucial.
Key Capabilities:
- Step-by-step logical progression
- Assumption identification and validation
- Inference rule application and justification
- Alternative path exploration and evaluation
- Transparent analysis with intermediate conclusions
- Reasoning verification with self-consistency checking
Usage Examples:
- Troubleshooting queries (e.g., code compilation errors)
- Decision-making analysis (e.g., microservices vs monolithic architecture)
Model: perplexity/sonar-reasoning-pro
Purpose: Highest level of research and reasoning capabilities for complex decision-making with significant consequences, strategic planning, technical architecture decisions, multi-stakeholder problems, or high-complexity troubleshooting requiring expert-level judgment and sophisticated reasoning chains.
Key Capabilities:
- Hierarchical reasoning with primary and secondary effects
- Cross-domain reasoning and meta-reasoning
- Bayesian reasoning with probability updates
- Decision theory and utility analysis
- Risk assessment and mitigation strategies
- Integration of contradictory evidence
- Confidence interval estimation
Usage Examples:
- Technical architecture decisions (e.g., microservices migration)
- Strategic planning (e.g., AI adoption implications)
Model: perplexity/sonar-deep-research
Purpose: Thorough, exhaustive research requiring extensive multi-source analysis and comprehensive coverage for detailed reports, white papers, literature reviews, in-depth market analysis, or knowledge base articles prioritizing depth and completeness.
Key Capabilities:
- Multi-angle topic exploration with 10+ source synthesis
- Historical context and evolution tracking
- Root cause analysis and underlying mechanism exploration
- Second and third-order effects consideration
- Long-form content with multiple section organization
- Comprehensive reference integration
- Thematic organization and detailed examples
Usage Examples:
- White paper creation (e.g., future of quantum computing)
- In-depth market analysis (e.g., cloud storage competitive landscape)
✅ Quick Reference — File Mapping
| Agent | Model | File |
|---|---|---|
| Perplexity Researcher | perplexity/sonar |
perplexity-researcher.md |
| Perplexity Researcher Pro | perplexity/sonar-pro |
perplexity-researcher-pro.md |
| Perplexity Researcher Reasoning | perplexity/sonar-reasoning |
perplexity-researcher-reasoning.md |
| Perplexity Researcher Reasoning Pro | perplexity/sonar-reasoning-pro |
perplexity-researcher-reasoning-pro.md |
| Perplexity Researcher Deep | perplexity/sonar-deep-research |
perplexity-researcher-deep.md |