PHPackages                             droath/edenai - 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. droath/edenai

ActiveLibrary[API Development](/categories/api)

droath/edenai
=============

Modern, type-safe PHP SDK for the EdenAI API with PSR compliance and immutable DTOs

1.0.0(7mo ago)09MITPHPPHP ^8.3CI passing

Since Nov 17Pushed 5mo agoCompare

[ Source](https://github.com/droath/edenai)[ Packagist](https://packagist.org/packages/droath/edenai)[ Docs](https://github.com/droath/edenai)[ GitHub Sponsors](https://github.com/Droath)[ RSS](/packages/droath-edenai/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (15)Versions (2)Used By (0)

EdenAI PHP SDK
==============

[](#edenai-php-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ddf9ac410d73918c52d17fda8f5d553a9d577ecd289dcd1acbbb5427210f37f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64726f6174682f6564656e61692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/droath/edenai)[![GitHub Tests Action Status](https://camo.githubusercontent.com/1d2ad2ae16dfbb443ab7a66d084c3c112597637dc0fd07ea644e5f56e87815d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64726f6174682f6564656e61692f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/droath/edenai/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d71eacc4bbe36eac455a7d6e1e4897ce77070c8151886145a61641dc0dc42921/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64726f6174682f6564656e61692f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/droath/edenai/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/53a69e47243082ec01d612931cd3a3ec10516a8156396e63d778e81be9a04b40/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64726f6174682f6564656e61692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/droath/edenai)

A modern, type-safe PHP SDK for the EdenAI API. Built with strict type safety, immutability, and PSR standards compliance, this SDK provides a robust foundation for integrating AI capabilities into your PHP applications.

**Features:**

- Fully typed with PHP 8.3+ features (readonly properties, enums, strict types)
- PSR-compliant (PSR-7, PSR-17, PSR-18)
- Extensible middleware pipeline architecture
- Automatic retry logic with exponential backoff
- Comprehensive exception handling
- Immutable DTOs for type-safe request/response handling

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

[](#requirements)

- PHP 8.3 or higher
- A PSR-18 HTTP client (e.g., Guzzle)
- PSR-17 HTTP factories

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

[](#installation)

Install the package via Composer:

```
composer require droath/edenai
```

You'll also need a PSR-18 HTTP client. We recommend Guzzle:

```
composer require guzzlehttp/guzzle
```

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

[](#configuration)

Set your EdenAI API credentials as environment variables:

```
# .env file
EDENAI_BASE_URL=https://api.edenai.run
EDENAI_API_KEY=your-api-key-here
```

Or configure them directly when instantiating the client (see Basic Usage below).

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

[](#basic-usage)

### Quick Start

[](#quick-start)

The simplest way to get started is to use environment variables:

```
