PHPackages                             itzmekhokan/ai-provider-for-perplexity - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. itzmekhokan/ai-provider-for-perplexity

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

itzmekhokan/ai-provider-for-perplexity
======================================

AI Provider for Perplexity for the PHP AI Client SDK. Works as both a Composer package and WordPress plugin.

00

Since Jun 20Compare

[ Source](https://github.com/itzmekhokan/ai-provider-for-perplexity)[ Packagist](https://packagist.org/packages/itzmekhokan/ai-provider-for-perplexity)[ RSS](/packages/itzmekhokan-ai-provider-for-perplexity/feed)WikiDiscussions Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

AI Provider for Perplexity
==========================

[](#ai-provider-for-perplexity)

AI Provider for Perplexity for the [WordPress AI Client](https://github.com/WordPress/php-ai-client). Works as both a Composer package and a WordPress plugin.

This provider registers **Perplexity** with the AI Client, exposing Perplexity's Sonar models (Sonar, Sonar Pro, Sonar Reasoning, Sonar Reasoning Pro, and Sonar Deep Research) for web-grounded text generation through Perplexity's OpenAI-compatible Chat Completions API.

Requirements
------------

[](#requirements)

- PHP 7.4+
- WordPress 6.9+ (when used as a plugin)
- The [`wordpress/php-ai-client`](https://github.com/WordPress/php-ai-client) SDK
- A Perplexity API key from the [Perplexity API settings](https://www.perplexity.ai/account/api/keys)

How it works
------------

[](#how-it-works)

Perplexity exposes an OpenAI-compatible Chat Completions API, so this provider is intentionally thin:

ClassResponsibility`Provider\PerplexityProvider`Registers the provider, base URL (`https://api.perplexity.ai`), API-key auth, and metadata.`Metadata\PerplexityModelMetadataDirectory`Defines the supported Sonar models and maps capabilities/options.`Provider\PerplexityProviderAvailability`Verifies the API key with a minimal text generation request.`Models\PerplexityTextGenerationModel`Sends `POST /chat/completions` via the shared OpenAI-compatible base class.Because Perplexity speaks the Chat Completions format, `PerplexityTextGenerationModel` extends `AbstractOpenAiCompatibleTextGenerationModel` from the SDK and only overrides request construction.

Unlike most providers, Perplexity does not expose a model listing endpoint for its Sonar chat models, so the supported models are defined statically and availability is checked with a minimal text generation request rather than a list-models request.

Supported capabilities
----------------------

[](#supported-capabilities)

- Web-grounded text generation (chat) with the Sonar model family
- Chat history / multi-turn conversations
- JSON / structured output

Installation
------------

[](#installation)

### As a WordPress plugin

[](#as-a-wordpress-plugin)

Copy this directory into `wp-content/plugins/` and activate it alongside the WordPress AI Client.

### As a Composer package

[](#as-a-composer-package)

```
composer require itzmekhokan/ai-provider-for-perplexity
```

Author
------

[](#author)

[Khokan Sardar](https://profiles.wordpress.org/khokansardar/)

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

9

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13062380?v=4)[Khokan Sardar](/maintainers/itzmekhokan)[@itzmekhokan](https://github.com/itzmekhokan)

### Embed Badge

![Health badge](/badges/itzmekhokan-ai-provider-for-perplexity/health.svg)

```
[![Health](https://phpackages.com/badges/itzmekhokan-ai-provider-for-perplexity/health.svg)](https://phpackages.com/packages/itzmekhokan-ai-provider-for-perplexity)
```

###  Alternatives

[badges/poser

Poser, add badges on your readme..

14678.5k13](/packages/badges-poser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
