In short.
Perplexity with Claude Code is a setup guide for developers combining Claude Code with Perplexity, with the catch that API calls, documentation lookup and model replacement are different capabilities. It recommends the official SDK for application code, offers an OpenAI-compatible route and explains how to register a read-only documentation MCP server without a Perplexity API key. TypeScript examples cover effort settings and explicit web search, with Python equivalents for basic calls. The page does not establish pricing, complete compatibility or runtime reliability. No commands, examples or connections were executed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete captured documentation page at [https://docs.perplexity.ai/docs/getting-started/integrations/claude-code.md], including all three integration paths, credential warnings, the read-only Docs MCP distinction and the unsupported model-replacement notice. Linked pages and the documentation index are excluded. No commands, package installations, API calls or MCP connections were executed. Runtime behavior, complete compatibility, pricing and licensing remain unverified or unknown where the page supplies no evidence.
The overview
Identity
This Perplexity documentation page teaches three ways to use Perplexity alongside Anthropic's Claude Code: application calls through the official SDK, calls through an OpenAI-compatible client and documentation lookup through a hosted Model Context Protocol server. It is a guide, rather than an installable integration package.
The original page is [https://docs.perplexity.ai/docs/getting-started/integrations/claude-code.md]. Its central distinction is that adding Perplexity capabilities to a project does not replace the model operating Claude Code.
Assessment
The guide provides concrete starting points for developers who want their application to call Perplexity or want Claude Code to consult Perplexity documentation. Installation commands, environment-variable names, request examples and MCP configuration make the intended setup understandable.
Its usefulness is narrower for readers seeking a complete application architecture, operating-cost estimate or verified compatibility matrix. The page recommends the official SDK as the most reliable route, but supplies no comparative tests supporting that claim.
Users
The main audience is developers already using Claude Code who want to add web-grounded responses, search or research features to project code. Developers with an existing OpenAI client receive a separate configuration example, while those who only need documentation lookup can use the Docs MCP.
Beginners get package commands and basic examples, but the guide assumes familiarity with a terminal, project dependencies and environment variables. Experienced developers will need additional documentation for complete parameter support and production operation.
Capabilities
The official SDK examples demonstrate creating Agent API responses with effort set to low, reading response.model and response.output_text, and explicitly enabling the web_search tool. Python equivalents are provided for the basic SDK and OpenAI-compatible calls.
The hosted Docs MCP lets Claude Code search and read Perplexity documentation. It is read-only and requires no Perplexity API key. The page distinguishes it from the separate Perplexity MCP Server, which offers search and reasoning tools and requires a key.
Using it
Requirements
For the TypeScript API examples, the guide lists Claude Code, Node.js 18 or later and a Perplexity API key. The official route installs @perplexity-ai/perplexity_ai; the compatibility route installs openai. The Python examples do not specify a minimum Python version or provide Python installation commands.
Documentation lookup requires Claude Code and access to the hosted MCP endpoint, but no Perplexity API key. Exact supported Claude Code and SDK versions, account requirements and service limits are not established.
Mechanism
In the application routes, Claude Code helps write the project code, and that code sends requests to Perplexity. The official client reads PERPLEXITY_API_KEY from the environment. The compatibility example supplies that key to an OpenAI client and changes its baseURL to [https://api.perplexity.ai/v1]. The page identifies POST /v1/responses as an Agent API alias.
The MCP route works differently: Claude Code connects over HTTP to [https://docs.perplexity.ai/mcp] for documentation lookup. This connection serves documentation rather than general Perplexity search or reasoning.
Setup
For the recommended TypeScript route, install the package with npm install @perplexity-ai/perplexity_ai, provide PERPLEXITY_API_KEY through the environment and create a Perplexity client. The page also shows a project-local .env approach loaded with dotenv. It warns against hardcoding, committing or pasting keys into prompts and says to exclude .env from source control.
For documentation lookup, use claude mcp add with --transport http, --scope project, the name perplexity-docs and endpoint [https://docs.perplexity.ai/mcp]. Project scope writes .mcp.json; --scope user makes the registration available across projects. The guide then directs readers to check claude mcp list and restart Claude Code or use /mcp to load the server.
Example
A representative example creates a Perplexity client and calls client.responses.create with effort set to low and an input asking for recent Agent API changes. It then prints the returned model identifier and output text. This illustrates a small research script that Claude Code could help create.
A separate example explicitly enables web_search, names the model openai/gpt-5.6-terra and prints output when response.status equals completed. These are source examples only: the model's availability, returned answers and execution behavior were not verified.
Assessment & evidence
Limitations
The page explicitly says that pointing Claude Code at Perplexity as its underlying model provider is not officially supported. The Docs MCP cannot supply general search or reasoning tools; the page directs readers to a different MCP server for those capabilities.
The complete OpenAI-compatible parameter set is deferred to another page. The examples do not cover retries, rate-limit handling, deployment or comprehensive failure handling. No installation, API request, MCP connection, latency measurement or answer-quality evaluation was performed.
Choosing an approach
The practical choice depends on where the capability is needed. An application feature needs API calls in project code; documentation assistance needs the Docs MCP. Readers wanting Claude Code itself to invoke broader Perplexity research tools are directed to the separate Perplexity MCP Server.
The official SDK is the page's recommended starting point for new application code because it advertises type safety, effort settings and full API feature access. The OpenAI-compatible route may suit existing client code, but full feature parity is not established here.
Alternatives
Within this guide, the official SDK and OpenAI-compatible client are alternative ways to call the API. Documentation MCP lookup serves a different purpose and can accompany either route.
For broader tools inside Claude Code, the page points to @perplexity-ai/mcp-server and [https://docs.perplexity.ai/docs/getting-started/integrations/mcp-server.md]. That linked guide was outside the available evidence, so its installation, full capabilities and operating requirements were not assessed beyond the description on this page. No competing providers are compared.
Evidence
The evidence is the complete captured page at [https://docs.perplexity.ai/docs/getting-started/integrations/claude-code.md], retained as selected-page.txt. It contains the integration descriptions, code examples, credential warnings and unsupported-model-replacement notice discussed here.
This is provider documentation, not independent performance evidence. Linked quickstarts, SDK references, compatibility documentation and Claude Code documentation were not included. No runtime results support claims about reliability, speed or answer quality.
Access & freshness
Costs
The page provides no API prices, billing units, free allowances, spending limits or Claude Code pricing. Per-request and total operating costs are unknown.
The Docs MCP is described as requiring no API key. That establishes an authentication difference, but the page does not state a price for the endpoint.
Rights
The page does not state a license for its documentation or code examples, or licenses for the referenced SDK packages. Permission to redistribute those materials is not established by this evidence.
Commercial-use terms, rights concerning API outputs and service data-handling terms are also absent. The package names and installation instructions do not establish those permissions.
Freshness
The page was captured on 23 November 2026 at 09:23:50.339 UTC. Its text supplies no publication date, last-update date or pinned SDK versions.
The package names, CLI flags, example model identifier and endpoint behavior describe that captured page. Their continued availability and compatibility are unverified; the capture date alone does not establish when the instructions were last validated.
Next actions
Choose the capability first: application API access, documentation lookup or broader MCP research tools. For new application code, start with the official SDK example; for an existing OpenAI client, confirm supported parameters before adapting the base URL.
Before adopting the integration, confirm current package and model availability, pricing and usage terms. Keep the API key out of source control and prompts. Validate a minimal request or documentation lookup in the intended environment, then assess failure handling and output quality for the actual task.
