In short.
Perplexity's OpenAI Compatibility guide shows developers how to connect existing OpenAI SDK code to its Agent API, but changing providers changes some tool-approval defaults. The documented setup uses a Perplexity API key and a different base URL while retaining the Responses API interface. Provider-specific effort and search settings need additional handling, and the page recommends Perplexity's native SDK for full parameter typing. The examples were not executed; comprehensive compatibility, current pricing and model availability are not established.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage comprises the complete documentation page at [https://docs.perplexity.ai/docs/agent-api/openai-compatibility.md], including examples and notices about endpoint aliases, MCP approvals, SDK typing and native SDK migration. Linked documentation, the documentation index and external sites appearing in sample responses are excluded. No code or API requests were executed; runtime compatibility, search-filter enforcement, performance and current costs are not assessed.
The overview
Identity
This is Perplexity's documentation page about using OpenAI client libraries with the Perplexity Agent API [https://docs.perplexity.ai/docs/agent-api/openai-compatibility.md]. A client library, or SDK, provides programming methods for sending requests and reading responses.
The resource is an integration guide, rather than an SDK package or model. Its scope is the Responses API interface, with examples in Python and TypeScript.
Assessment
The guide is useful for developers who already use client.responses.create() and want to direct requests to Perplexity while retaining a familiar client interface. It provides enough configuration detail to prepare an integration, including the required base URL and response-reading methods.
Its main practical qualification is that compatible request formats do not mean identical behavior. MCP approval defaults differ, and some Perplexity parameters need extra request fields or TypeScript type checking to be bypassed.
Intended users
The strongest fit is a Python or TypeScript developer with an existing OpenAI Responses API integration. Beginners receive concrete examples, but still need to understand API keys, environment variables and basic SDK calls; the page does not explain account setup from scratch.
Developers choosing a client library for a new Perplexity application should also consider the native SDK. The page recommends it for simpler configuration and direct support for Perplexity-specific parameters.
Documented capabilities
The page documents response creation and retrieval, streaming text, model discovery, direct model selection, effort presets and built-in web search. Listed request controls include instructions, max_output_tokens, tools, store and previous_response_id for continuing a completed response.
Perplexity-specific search settings include domain filters and user location. The page also names Open WebUI, Cherry Studio and LiteLLM as consumers of OpenAI-format model discovery; it does not establish complete compatibility with every feature of those applications.
Using it
Requirements
The documented SDK route uses an OpenAI Python or TypeScript/JavaScript client, network access to Perplexity and a Perplexity API key. Examples read the key from the PERPLEXITY_API_KEY environment variable rather than using an OpenAI credential.
Minimum SDK and runtime versions, account eligibility, quotas and rate-limit values are not supplied. Model listing is documented as requiring no authentication, although the SDK examples still configure a key.
How compatibility works
With the base URL set to [https://api.perplexity.ai/v1], client.responses.create() sends POST /v1/responses. Perplexity accepts that path as an alias for its canonical POST /v1/agent endpoint. Retrieval similarly accepts /v1/responses/{id} alongside /v1/agent/{id}; model discovery uses GET /v1/models.
Responses contain structured output, model information, usage and response metadata. Streaming examples read response.output_text.delta events. The page describes store as controlling visibility through retrieval; that description does not establish a complete data-retention or deletion policy.
Setup
Configure the OpenAI client with the Perplexity API key and base_url in Python, or baseURL in TypeScript, set to [https://api.perplexity.ai/v1]. The /v1 suffix is explicitly required. Then use the Responses API methods shown on the page.
Python examples pass effort and Perplexity-specific tool settings through extra_body. TypeScript examples pass these settings at the top level and use an any cast to bypass incompatible SDK types. These workarounds reduce the type checking available for those request fields.
Example
The basic Python example asks for a REST-versus-GraphQL explanation using client.responses.create(), sets model to openai/gpt-5.6-sol and reads response.output_text. Its displayed response includes web search results, an assistant message and token and cost information.
The TypeScript example instead names openai/gpt-5.6-luna, while the displayed response names openai/gpt-5.6-sol. Consequently, that response cannot establish the exact result of both snippets. These identifiers are documentation examples; their current availability is unknown.
Assessment & evidence
Limitations
For MCP tools, which connect an agent to external tools through the Model Context Protocol, the page says omitted or null require_approval is treated as never. It contrasts this with OpenAI's approval default. An application that relies on approval prompts must resolve this difference explicitly.
The web-search example restricts domains to techcrunch.com and crunchbase.com, yet its displayed response includes other domains. That response does not demonstrate that the requested filter was applied.
The page does not provide an exhaustive feature-compatibility matrix, supported SDK-version range, latency measurements or reliability benchmarks. Support for every OpenAI endpoint, parameter and tool behavior is not established.
Why it may fit
The shared Responses API interface suggests less client-rewrite work for an existing integration. That benefit is most relevant when preserving familiar request and response handling matters more than having native types for every provider-specific option.
The approval difference and type workarounds make a configuration-only migration insufficient evidence of equivalent application behavior. The guide establishes a documented integration route, without establishing a quality, speed or cost advantage over another provider.
Alternatives
The page's principal alternative is Perplexity's native SDK. It gives the Python package name perplexityai and the TypeScript package name @perplexity-ai/perplexity_ai, and describes direct effort parameters, automatic endpoint configuration and full parameter typing.
The publisher also claims better provider-specific errors and access to enhanced features through that SDK. These are documentation claims rather than comparative test results. The linked SDK guide is outside the supplied scope [https://docs.perplexity.ai/docs/sdk/overview.md].
Evidence
The evidence is the complete captured Perplexity OpenAI Compatibility page [https://docs.perplexity.ai/docs/agent-api/openai-compatibility.md]. It contains provider explanations, code snippets, endpoint tables and illustrative response payloads.
The examples were not executed. Their payloads document the publisher's examples, rather than independent measurements of compatibility, answer accuracy, filtering, availability or cost. Search-result excerpts embedded inside those payloads are not separate evidence about API behavior.
Access & freshness
Costs
Current usage costs are unknown. The page supplies example response accounting rather than a pricing schedule: the illustrated REST-versus-GraphQL response reports USD 0.02665, with fields for input, output, cache reads and tool calls.
That example total is not a quote or a reliable budget for another request. Current model rates, effort-preset costs, free allowances, billing requirements and spending limits are not established by this page.
Rights and terms
The supplied page does not state a redistribution licence for its text or code examples. Permission to redistribute them is therefore unknown.
Service terms, commercial-use conditions, output-use rights and prompt data-use terms are not provided. API compatibility does not establish that Perplexity and OpenAI have equivalent contractual or privacy terms.
Freshness
The page was captured on 24 November 2026. No explicit page publication date, update date or revision history is supplied.
Response timestamps and dates attached to embedded search results do not establish when the compatibility guidance was updated. Current model availability and compatibility with a particular installed SDK version remain unknown.
Practical next steps
Choose between retaining the OpenAI client and adopting the native Perplexity SDK based on how much provider-specific functionality and type checking the application needs. Confirm available model identifiers through [https://api.perplexity.ai/v1/models] rather than assuming the example names remain available.
Before migrating an application that relies on MCP approvals, confirm a supported configuration that preserves its intended approval behavior. The page points to further approval documentation [https://docs.perplexity.ai/docs/agent-api/tools/mcp.md#approvals]; supported explicit approval settings are not explained in this page.
Validate the application's required streaming, retrieval, continuation, search-filter and error behavior with its actual SDK version. Confirm current pricing and service terms separately before relying on the integration.
