ChatPerplexity features and configurations head to the API reference.
Overview
Integration details
Model features
Setup
To access Perplexity models you’ll need to create a Perplexity account, get an API key, and install thelangchain-perplexity integration package.
Credentials
Head to this page to sign up for Perplexity and generate an API key. Once you’ve done this set thePPLX_API_KEY environment variable:
Agent API support (use_responses_api)
ChatPerplexity can also route requests through Perplexity’s Agent API (the Perplexity-flavored Responses API) by setting use_responses_api. This is the same mental model as ChatOpenAI.use_responses_api: one class, two endpoints, controlled by a single flag.
The Agent API gives
ChatPerplexity access to Perplexity’s built-in tools (live web search, URL fetching, finance and people search) and stateful agent fields (previous_response_id, instructions, include) which are not available on Chat Completions. Existing ChatPerplexity(model="sonar") callers see no behavior change — the Chat Completions path stays the default for plain text requests.
usage_metadatais populated from the Responses-shapedusagepayload (input_tokens,output_tokens,total_tokens).response_metadatacarries transport-level fields:id,model,status, andobject.additional_kwargssurfaces Perplexity-specific outputs when present:citations,images,related_questions,search_results,videos, andreasoning_steps.- Tool calls returned by the model appear in
response.tool_callsexactly as they do forChatOpenAI.
openai/gpt-5.5, anthropic/claude-sonnet-4-6, google/gemini-3-1-pro).
Using perplexity-specific parameters through ChatPerplexity
You can also use Perplexity-specific parameters through the ChatPerplexity class. For example, parameters like search_domain_filter, return_images, return_related_questions or search_recency_filter using the extra_body parameter as shown below:
Accessing the search results metadata
Perplexity often provides a list of the web pages it consulted (“search_results”). You don’t need to pass any special parameter—the list is placed inresponse.additional_kwargs["search_results"].
ChatPerplexity also supports streaming functionality
ChatPerplexity supports structured outputs for tier 3+ users
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

