PHPackages                             aisdk/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. aisdk/perplexity

ActiveLibrary

aisdk/perplexity
================

Official Perplexity provider for the PHP AI SDK.

v0.8.0(1mo ago)01MITPHPPHP ^8.3CI passing

Since Jul 15Pushed 1mo agoCompare

[ Source](https://github.com/phpaisdk/perplexity)[ Packagist](https://packagist.org/packages/aisdk/perplexity)[ Docs](https://github.com/phpaisdk/perplexity)[ RSS](/packages/aisdk-perplexity/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

aisdk/perplexity
================

[](#aisdkperplexity)

[![GitHub Workflow Status](https://camo.githubusercontent.com/8204296bbe70b09b145db1a1f86a289f53c659476cdc52e170391c088c371149/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706870616973646b2f706572706c65786974792f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d5465737473)](https://github.com/phpaisdk/perplexity/actions)[![Total Downloads](https://camo.githubusercontent.com/060e6353ec83812974ddcf5123c3f60f7a7a6cee94ffc87824ceb726dc15f276/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616973646b2f706572706c6578697479)](https://packagist.org/packages/aisdk/perplexity)[![Latest Version](https://camo.githubusercontent.com/4dea93eec27330be713ecf75c9ce575f4703a464890a140df8d947e1336d5949/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616973646b2f706572706c6578697479)](https://packagist.org/packages/aisdk/perplexity)[![License](https://camo.githubusercontent.com/51b7881bf176ceb22460f23a202060b535551a91a446642e17c4d333bfe9ce5c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616973646b2f706572706c6578697479)](https://packagist.org/packages/aisdk/perplexity)[![Why PHP in 2026](https://camo.githubusercontent.com/d2b9305e630caf7daae4ca023de39ece0b885c37461629d42961533f00868b76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5768795f5048502d696e5f323032362d3741383645383f7374796c653d666c61742d737175617265266c6162656c436f6c6f723d313831383162)](https://whyphp.dev)

---

Official Perplexity provider for the PHP AI SDK. Uses Perplexity's Chat Completions API.

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

[](#installation)

```
composer require aisdk/perplexity
```

Basic Usage
-----------

[](#basic-usage)

```
use AiSdk\Generate;
use AiSdk\Perplexity;

$result = Generate::text('What happened in technology today?')
    ->model(Perplexity::model('sonar-pro'))
    ->run();

echo $result->text;
```

Configuration
-------------

[](#configuration)

VariableDescriptionDefault`PERPLEXITY_API_KEY`API key for authenticationRequired`PERPLEXITY_BASE_URL`Base URL for API requests`https://api.perplexity.ai`Supported Capabilities
----------------------

[](#supported-capabilities)

CapabilitySupportText generationNativeStreamingNativeTool callingNativeStructured outputAdapted (`json_object` with an explicit JSON instruction)Text inputNativeProvider-specific fields can be passed through `providerOptions('perplexity', [...])`. Model IDs are opaque strings and Perplexity remains the authority on model availability.

Testing
-------

[](#testing)

```
composer test:all
```

Documentation
-------------

[](#documentation)

- [PHP AI SDK documentation](https://phpaisdk.com/docs)
- [Perplexity documentation](https://phpaisdk.com/docs/perplexity)

Community
---------

[](#community)

- [Contributing](https://github.com/phpaisdk/.github/blob/main/CONTRIBUTING.md)
- [Support](https://github.com/phpaisdk/.github/blob/main/SUPPORT.md)
- For private security reports, email .

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

47d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef29d1962da41e7526023f215cf844494e209b2fd163742084cb919a3b508021?d=identicon)[aisdk](/maintainers/aisdk)

---

Top Contributors

[![RanaMoizHaider](https://avatars.githubusercontent.com/u/58527494?v=4)](https://github.com/RanaMoizHaider "RanaMoizHaider (3 commits)")

---

Tags

aillmperplexityopenai-compatibleaisdk

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aisdk-perplexity/health.svg)

```
[![Health](https://phpackages.com/badges/aisdk-perplexity/health.svg)](https://phpackages.com/packages/aisdk-perplexity)
```

PHPackages © 2026

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