In short.
Perplexity with LiteLLM is a guide for developers accessing Perplexity through a shared interface for AI services, but pricing and production deployment details are unspecified. It demonstrates the Python responses function and a self-hosted proxy, with examples for effort-based routing, web search, URL fetching and schema-constrained JSON. The examples were not executed, so compatibility, output quality and performance remain unassessed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete supplied page at [https://docs.perplexity.ai/docs/getting-started/integrations/litellm.md], including its opening documentation-index notice, examples, resource links and support references. The notice points to [https://docs.perplexity.ai/llms.txt]; that index and every other linked page are excluded. No installation, code, API request or proxy was executed. Compatibility, current model availability, output quality, performance and production behavior remain unassessed.
The overview
Identity
This Perplexity documentation page explains how to access its Agent API through LiteLLM, a Python SDK and proxy server that provides a common interface across model providers. The resource is an integration guide rather than a downloadable application or model.
The original page is [https://docs.perplexity.ai/docs/getting-started/integrations/litellm.md]. Its scope includes both application-level Python calls and a self-hosted gateway.
Assessment
The guide gives developers concrete starting points for connecting an existing LiteLLM application to Perplexity or exposing Perplexity through a shared endpoint. It includes request parameters and configuration examples, so readers can understand the integration beyond a feature overview.
Its usefulness is strongest for initial implementation. It does not establish supported package versions, operating costs, production security configuration or successful execution of the examples.
Users
Python developers can use the SDK examples to add Perplexity calls inside an application. Developers managing access for several applications may find the proxy configuration more relevant because it exposes a shared OpenAI-compatible endpoint.
Beginners receive installation and credential instructions, but the page assumes familiarity with environment variables, Python function calls and JSON. The proxy instructions also assume readers can create a YAML configuration and operate a server process.
Capabilities
The page demonstrates Agent API requests through litellm.responses, model selection through effort levels, explicit model identifiers, web_search and fetch_url tools, and structured outputs defined with a strict JSON schema.
It also demonstrates a named model configuration in LiteLLM Proxy. The overview describes broader LiteLLM features such as provider switching and tracking spend, latency and errors, but this page does not show how to configure or validate that tracking.
Using it
Requirements
The Python route requires a Python environment with LiteLLM installed and a Perplexity API key. The page instructs readers to place the key in the PERPLEXITY_API_KEY environment variable and links the key portal at [https://console.perplexity.ai/project/keys].
The proxy route additionally requires a YAML configuration and a running LiteLLM server. Supported Python versions, minimum LiteLLM release, operating-system requirements and hosting capacity are unspecified.
Mechanism
LiteLLM acts as an adapter between application requests and Perplexity. The Python examples set custom_llm_provider to perplexity. With model set to perplexity/ and effort supplied through extra_body, Perplexity selects the model, prompt, tools and limits. The documented effort values are fast, low, medium, high and xhigh.
For explicit model selection, the guide prefixes an Agent API model identifier with perplexity/. In proxy mode, an application sends a configured alias such as perplexity-low, which maps to the provider configuration. Self-hosting covers the gateway; Agent API inference is routed through Perplexity to third-party models.
Setup
The documented SDK setup starts with pip install litellm, followed by setting PERPLEXITY_API_KEY. The Python examples import responses from litellm and pass the input, provider and routing parameters to that function.
For the proxy, config.yaml defines a model_list entry named perplexity-low. Its litellm_params use model perplexity/, read the key through os.environ/PERPLEXITY_API_KEY and set effort to low through extra_body. The documented startup command is litellm --config /path/to/config.yaml, after which clients call the /v1/responses endpoint using the configured alias.
Example
The simplest Python example asks about recent AI developments. It sets model to perplexity/, custom_llm_provider to perplexity and extra_body to an object containing effort set to low, then prints response.output. This illustrates delegating model and tool selection to an effort preset.
A separate research example names perplexity/openai/gpt-5.6-sol, enables web_search and fetch_url, requests citations, and sets max_output_tokens to 1000 and temperature to 0.7. The structured-output example requests an object containing name, height_meters and year_built through extra_body.text.format with type json_schema and strict set to true. No returned outputs are shown, and none of these examples were executed.
Assessment & evidence
Limitations
The page supplies no measured latency, quality comparisons, compatibility matrix or execution results. It does not establish which tools and structured-output features work with every model, nor does it document effort-specific limits, rate limits, retry behavior or error handling.
The proxy request uses plain HTTP and an illustrative Authorization: Bearer anything header. That example does not establish authentication enforcement or a production security configuration. The supplied page also contains no streaming or asynchronous-call examples.
Reasoning
For an application already using LiteLLM, this integration offers a way to add Perplexity while retaining a familiar calling interface. How much application code would need to change depends on its existing assumptions and required features; the page does not demonstrate a complete migration.
Effort-based routing delegates model, prompt, tool and limit choices to Perplexity, while explicit model identifiers give the application a named model target. This distinction matters when deciding how much selection control to delegate. Neither route has demonstrated quality, speed or cost advantages in this evidence.
Alternatives
The guide presents two implementation options: call the Python SDK within an application, or operate LiteLLM Proxy as a shared endpoint. The SDK avoids operating a separate gateway process; the proxy centralizes provider configuration for clients using that endpoint.
The page also links the direct Agent API documentation at [https://docs.perplexity.ai/docs/agent-api/quickstart.md] and describes LiteLLM as supporting other providers. Those linked resources are outside this assessment, and the page supplies no comparison of their prices, quality or feature coverage.
Evidence
The evidence is the complete Perplexity documentation page at [https://docs.perplexity.ai/docs/getting-started/integrations/litellm.md]. It contains the overview, installation and key instructions, Agent API examples, proxy configuration, resource links and support references.
The page documents intended usage but provides no returned responses, benchmark results or integration-test results. Its linked documentation does not supply additional evidence here. Installation, API calls and proxy operation were not tested.
Access & freshness
Costs
Costs are unknown from this page. It supplies no API prices, effort-level charges, tool fees, free allowance or worked request-cost example. The effort labels do not establish a particular price or spending limit.
The overview says LiteLLM can track spend, but it provides no accounting configuration or billing results. Hosting costs for the self-hosted proxy are also unspecified.
Rights
The page provides no explicit licence or reuse grant for its documentation or example code. It also does not establish LiteLLM's software licence, API commercial-use terms or rights in generated outputs.
Data retention, use of submitted data for training and contractual responsibilities across Perplexity and third-party model providers are not described. Those permissions and terms remain unknown from this evidence.
Freshness
The supplied page was captured on 23 November 2026. It states no publication date, last-update date or compatible LiteLLM version, so the capture date does not establish when the instructions were written or validated.
The page directs readers to [https://docs.perplexity.ai/docs/agent-api/models.md] for the current model catalogue. That linked page was not assessed. The named model in the example therefore does not establish present availability or the complete supported model set.
Actions
Before implementation, confirm compatible LiteLLM and Python versions, current model availability, API pricing and the terms relevant to your data. Choose the in-application SDK or shared proxy according to how clients will access the service.
Use the documented low-effort request as an initial compatibility check, then separately verify any required web tools and schema-constrained output. For a deployed proxy, establish authentication, transport security and operating limits beyond the sample configuration. These are suggested next steps; no execution results are available.
