PHPackages                             softcreatr/php-perplexity-ai-sdk - 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. [API Development](/categories/api)
4. /
5. softcreatr/php-perplexity-ai-sdk

ActiveLibrary[API Development](/categories/api)

softcreatr/php-perplexity-ai-sdk
================================

A powerful and easy-to-use PHP SDK for the pplx (Perplexity) API, allowing seamless integration of advanced AI-powered features into your PHP projects..

2.0.0(1y ago)149.1k↑13.2%3ISCPHPPHP &gt;=8.1

Since Oct 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/SoftCreatR/php-perplexity-ai-sdk)[ Packagist](https://packagist.org/packages/softcreatr/php-perplexity-ai-sdk)[ Fund](https://ecologi.com/softcreatr?r=61212ab3fc69b8eb8a2014f4)[ GitHub Sponsors](https://github.com/softcreatr)[ RSS](/packages/softcreatr-php-perplexity-ai-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

PerplexityAI API Wrapper for PHP
================================

[](#perplexityai-api-wrapper-for-php)

[![Build](https://camo.githubusercontent.com/669ac4c4e83346c711316c2cb309c95f9e07e76e669123007d3466b006ff8e06/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f536f66744372656174522f7068702d706572706c65786974792d61692d73646b2f2e6769746875622f776f726b666c6f77732f6372656174652d72656c656173652e796d6c3f6272616e63683d6d61696e)](https://github.com/SoftCreatR/php-perplexity-ai-sdk/actions/workflows/create-release.yml) [![Latest Release](https://camo.githubusercontent.com/8862ae677f41ee005b8857af386401468c8997a85c6d9fda59cc64eb3bf48598/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f536f66744372656174522f7068702d706572706c65786974792d61692d73646b3f636f6c6f723d626c7565266c6162656c3d4c617465737425323052656c65617365)](https://packagist.org/packages/softcreatr/php-perplexity-ai-sdk) [![ISC licensed](https://camo.githubusercontent.com/95c61c397ca3825757ec835268e50886b2c10ddc4f0676e1222b19037610927f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4953432d626c75652e737667)](./LICENSE.md) [![Plant Tree](https://camo.githubusercontent.com/e751d267acfa70a4be08989f626ff706c90cec4e0ab98940e620250f26a991be/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e3f636f6c6f723d627269676874677265656e266c6162656c3d506c616e74253230547265652671756572793d2532342e746f74616c2675726c3d68747470732533412532462532467075626c69632e65636f6c6f67692e636f6d2532467573657273253246736f66746372656174722532467472656573)](https://ecologi.com/softcreatr?r=61212ab3fc69b8eb8a2014f4) [![Codecov branch](https://camo.githubusercontent.com/f9dc21eaa572a4c450b1fa7590192ca184a45587a124ba100e32c176bf731cba/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f536f66744372656174522f7068702d706572706c65786974792d61692d73646b)](https://codecov.io/gh/SoftCreatR/php-perplexity-ai-sdk) [![Code Climate maintainability](https://camo.githubusercontent.com/9cdd23d648ecee280e439856d0e89d2fe2e75c1ebe4f2dfb59050da77cbad744/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792d70657263656e746167652f536f66744372656174522f7068702d706572706c65786974792d61692d73646b)](https://codeclimate.com/github/SoftCreatR/php-perplexity-ai-sdk)

This PHP library provides a simple wrapper for the PerplexityAI API, allowing you to easily integrate the PerplexityAI API into your PHP projects.

Features
--------

[](#features)

- Easy integration with PerplexityAI API
- Supports all PerplexityAI API endpoints
- Streaming support for real-time responses in chat completions
- Utilizes PSR-17 and PSR-18 compliant HTTP clients and factories for making API requests

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

[](#requirements)

- PHP 8.1 or higher
- A PSR-17 HTTP Factory implementation (e.g., [guzzle/psr7](https://github.com/guzzle/psr7) or [nyholm/psr7](https://github.com/Nyholm/psr7))
- A PSR-18 HTTP Client implementation (e.g., [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) or [symfony/http-client](https://github.com/symfony/http-client))

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

[](#installation)

You can install the library via [Composer](https://getcomposer.org/):

```
composer require softcreatr/php-perplexity-ai-sdk
```

Usage
-----

[](#usage)

First, include the library in your project:

```
