Perplexity with OpenCode - Perplexity
Summary
Perplexity has integrated its Agent API with OpenCode, an open-source AI coding agent for terminals, IDEs, and desktops. This integration allows developers to access frontier models from OpenAI, Anthropic, Google, xAI, and Perplexity through a single, OpenAI-compatible endpoint. The Perplexity Agent API includes optional `web_search` and `fetch_url` tools, along with Perplexity's research presets for enhanced retrieval. OpenCode supports multi-agent orchestration, enabling configuration of a primary coding agent and specialized subagents. Users can set up the Agent API as a custom provider in OpenCode by exporting their Perplexity API key and configuring `opencode.json` to point to `https://api.perplexity.ai/v1`, making various models like GPT-5.2, Claude Opus 4.7, and Gemini 3.1 Pro available for different coding tasks.
Key takeaway
For AI Engineers building or extending coding agents, integrating the Perplexity Agent API into OpenCode simplifies access to a diverse range of frontier LLMs and web tools. This allows you to easily swap models for specific tasks, such as using `anthropic/claude-opus-4-7` for code review or a `deep-research` preset for a research subagent, without managing multiple provider accounts. Consider configuring multi-agent setups to optimize task-specific model performance and tool utilization.
Key insights
Perplexity's Agent API unifies access to multiple frontier LLMs and web tools for coding agents.
Principles
- Consolidate LLM access via a single API key.
- Utilize specialized subagents for distinct tasks.
Method
Configure OpenCode with Perplexity's Agent API as an OpenAI-compatible provider, specifying `baseURL` and `apiKey`, then declare desired models for use in primary or subagent roles.
In practice
- Use `openai/gpt-5.2` for deep reasoning tasks.
- Employ `anthropic/claude-opus-4-7` for high-quality code review.
- Configure a research subagent with `deep-research` preset.
Topics
- Perplexity Agent API
- OpenCode
- AI Coding Agents
- Multi-Agent Systems
- Frontier LLMs
Best for: AI Engineer, Machine Learning Engineer, Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by perplexity.ai via Google News.