PHPackages                             oliverearl/nomiai-php - 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. oliverearl/nomiai-php

ActiveLibrary[API Development](/categories/api)

oliverearl/nomiai-php
=====================

PHP library for interacting with the Nomi.ai API

1.1.0(1mo ago)13001MITPHPPHP ^8.3CI passing

Since Nov 26Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/oliverearl/nomiai-php)[ Packagist](https://packagist.org/packages/oliverearl/nomiai-php)[ Docs](https://github.com/oliverearl/nomiai-php)[ Fund](https://www.buymeacoffee.com/oliverearl)[ Fund](https://ko-fi.com/oliverearl)[ RSS](/packages/oliverearl-nomiai-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (15)Used By (1)

Nomi.ai PHP Library
===================

[](#nomiai-php-library)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fc74cef07f86e8b99df0b4779998ce3696b462b58a8e480cd494e74b72176841/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6c697665726561726c2f6e6f6d6961692d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oliverearl/nomiai-php)[![Tests](https://camo.githubusercontent.com/0b85d50779418462907be4bf978673d82f7bf9e64fe28b5ed7fb4cf6f0e8c670/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f6c697665726561726c2f6e6f6d6961692d7068702f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/oliverearl/nomiai-php/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/6939c19aecb97240d7eaf6975d816d30e80f3e85ee46160e4497d19085d0b091/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6c697665726561726c2f6e6f6d6961692d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oliverearl/nomiai-php)

This is a lightweight, PHP library for interacting with the Nomi.ai REST API. [Nomi AI](https://www.nomi.ai) is a companionship application that uses artificial intelligence.

The only prerequisite is at least PHP 8.3 with the JSON extension. You'll need a HTTP client too, preferably Guzzle. If you're using a popular framework, you should be good to go.

If you're using Laravel, install the [Laravel-specific library](https://github.com/oliverearl/nomiai-php-laravel)instead.

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

[](#installation)

You can install the package via Composer:

```
composer require oliverearl/nomiai-php
```

Usage
-----

[](#usage)

### Quickstart

[](#quickstart)

After installing the library, getting started is easy:

```
$sdk = new \Nomiai\PhpSdk\NomiAI(
    token: $yourNomiAiApiKey, // Find it in the Integrations tab of the Nomi.ai app!
    // You can also provide a custom endpoint and HTTP Client as additional arguments.
);

$nomis = $sdk->getNomis();
$conversation = $sdk->sendMessageToNomi($nomis[0], 'Hello!');
```

### Retrieving Nomis

[](#retrieving-nomis)

A numerically-indexed array of Nomis associated with an account can be returned using the library. If you know your Nomi's UUID, you can also retrieve their data individually.

```
/** @var \Nomiai\PhpSdk\NomiAI $sdk **/

// Get all Nomis:
/** @var array $nomis **/
$nomis = $sdk->getNomis();

// Grab a specific Nomi:
/** @var \Nomiai\PhpSdk\Resources\Nomi $nomi **/
$nomi = $sdk->getNomi(id: 'Your Nomi UUID here');
```

### Chatting with Nomis

[](#chatting-with-nomis)

Once you have a Nomi you want to chat with, or if you know their UUID, sending a message is easy. If all goes well, you will end up with a `MessageSet` object containing both your message and the corresponding reply.

```
/** @var \Nomiai\PhpSdk\NomiAI $sdk **/
/** @var \Nomiai\PhpSdk\Resources\Nomi $nomi **/

// Send a message directly to a Nomi
$conversation = $sdk->sendMessageToNomi($nomi, 'Hello!');

// Or to their UUID!
$conversation = $sdk->sendMessage($nomi->uuid, 'World!');
```

### Retrieving an avatar

[](#retrieving-an-avatar)

You can retrieve the avatar from a Nomi with either a Nomi object, or their corresponding UUID.

```
/** @var \Nomiai\PhpSdk\NomiAI $sdk **/
/** @var \Nomiai\PhpSdk\Resources\Nomi $nomi **/

$avatar = $sdk->getAvatarFromNomi($nomi);

// Or via the UUID:
$avatar = $sdk->getAvatar($nomi->uuid);

/*
 * Avatar is an object that might get more functionality down the line. For now,
 * to get the underlying .webp image, access the avatar property.
 */
$webp = $avatar->avatar;

// You can also retrieve the underlying image by casting the object to a string.
$image = (string) $avatar;
```

### Rooms

[](#rooms)

#### Retrieving rooms

[](#retrieving-rooms)

You can retrieve a numerically-indexed array of rooms associated with your account. Just like with Nomis, if you know the UUID of the room, you can also retrieve this individually.

```
/** @var \Nomiai\PhpSdk\NomiAI $sdk **/

/** @var array $myRooms */
$myRooms = $sdk->getRooms();

/** @var \Nomiai\PhpSdk\Resources\Room $myFavouriteRoom */
$myFavouriteRoom = $sdk->getRoom(id: 'Your room UUID here');
```

#### Creating a room for your Nomis

[](#creating-a-room-for-your-nomis)

Creating a room for Nomis can be done with *either* an array of Nomi objects, or an array containing their respective UUIDs. A `RoomRequest` object exists to help you with this process, or you can use an associative array.

```
/** @var \Nomiai\PhpSdk\NomiAI $sdk **/

// Get all Nomis:
/** @var array $nomis **/
$nomis = $sdk->getNomis();

$request = new RoomRequest(
    name: 'Nomi HQ',
    note: 'The coolest place for Nomis to hang out',
    backchannelingEnabled: true,
    nomiUuids: $nomis,
);

/** @var \Nomiai\PhpSdk\Resources\Room $room */
$room = $sdk->createRoom($request);
```

#### Updating and deleting rooms

[](#updating-and-deleting-rooms)

Updating an existing room can also be done with a `RoomRequest` object, or an associative array containing the values you wish to change. Whatever you choose, it's a good idea not to include fields you don't want to update.

```
/** @var \Nomiai\PhpSdk\NomiAI $sdk **/
/** @var \Nomiai\PhpSdk\Resources\Room $room **/

$request = [
    'name' => 'The New Nomi HQ!',
];

$room = $sdk->updateRoom($room, $request);

// You can also update a room by its UUID, for example if you don't have the full object.
$room = $sdk->updateRoomById($room->uuid, $request);
```

Deleting a room is straightforward. These methods will simply return `true` as they will throw an appropriate exception if something goes wrong.

```
/** @var \Nomiai\PhpSdk\NomiAI $sdk **/
/** @var \Nomiai\PhpSdk\Resources\Room $room **/

$sdk->deleteRoom($room);

// You can also delete it by its UUID
$sdk->deleteRoomById($room->uuid);
```

#### Messaging within rooms

[](#messaging-within-rooms)

Sending a message into a room is easy. Be aware rooms do take time to initialise, so don't send a message to them immediately after creation. The message that was sent is returned as the result.

```
/** @var \Nomiai\PhpSdk\NomiAI $sdk **/
/** @var \Nomiai\PhpSdk\Resources\Room $room **/

$message = 'Hello friends!';
$conversation = $sdk->sendMessageToRoom($room, $message);

// Or via UUID:
$conversation = $sdk->sendMessageToRoomById($room->uuid, $message);
```

Nomis can be prompted to send a message to a room. For more information about this, please check the [Nomi.ai](https://www.nomi.ai) website.

```
/** @var \Nomiai\PhpSdk\NomiAI $sdk **/
/** @var \Nomiai\PhpSdk\Resources\Nomi $nomi **/
/** @var \Nomiai\PhpSdk\Resources\Room $room **/

$message = $sdk->requestNomiToMessageRoom($nomi, $room);

// If you only have the Nomi UUID, and/or the room UUID, you have options:
$message = $sdk->requestNomiByIdToMessageRoom($nomi->uuid, $room);
$message = $sdk->requestNomiByIdToMessageRoomById($nomi->uuid, $room->uuid);
```

Functionality
-------------

[](#functionality)

The library is under active development. Complete feature availability is planned for the first major release.

Nomi.ai API FunctionalityImplementedReleaseRetrieve and view NomisYesv0.1.2-alphaSend and receive messages to NomisYesv0.1.3-alphaRetrieve Nomi avatarsYesv0.1.6-alphaRetrieve roomsYesv0.2.0-alphaCreate roomsYesv0.2.0-alphaSend messages into roomsYesv0.2.0-alphaDelete roomsYesv0.2.0-alphaFor more information regarding the Nomi.ai API, please check the documentation available [here](https://api.nomi.ai/docs/reference).

Testing
-------

[](#testing)

Tests are run using the [Pest](https://pestphp.com/) testing framework. You can run the suite like so:

```
composer test
```

Code Style
----------

[](#code-style)

Laravel Pint is used to maintain the PER coding style. The linter can be run using:

```
composer format
```

PHPStan (level 8) is used for static analysis to catch type errors:

```
composer analyse
```

There are Pest architecture tests that also attempt to maintain certain conventions, including the use of strict typing where possible.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Your contributions are warmly welcomed! Anything from documentation, to optimisations, and additional tests. Pull requests must pass the existing test suite and conform to the required code style.

For new functionality, adequate tests must be included!

Credits
-------

[](#credits)

- [Oliver Earl](https://github.com/oliverearl)
- [Nomi.ai](https://www.nomi.ai)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance89

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 89.9% 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

Every ~39 days

Recently: every ~115 days

Total

13

Last Release

59d ago

Major Versions

v0.2.0-alpha → v1.0.02024-12-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/10ca9d5f46f753e8297ae6cc53c018fa833f9e1bc7785c6397a45e7fbc17f033?d=identicon)[oliverearl](/maintainers/oliverearl)

---

Top Contributors

[![oliverearl](https://avatars.githubusercontent.com/u/14837181?v=4)](https://github.com/oliverearl "oliverearl (89 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")

---

Tags

aiartificial-intelligencenominomi-aiphp-libraryartificial intelligencenomi ainomi

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/oliverearl-nomiai-php/health.svg)

```
[![Health](https://phpackages.com/badges/oliverearl-nomiai-php/health.svg)](https://phpackages.com/packages/oliverearl-nomiai-php)
```

###  Alternatives

[grok-php/laravel

Seamlessly integrate Grok AI into Laravel applications with an elegant, developer-friendly package. Leverage powerful AI models for chat, automation, and NLP while maintaining Laravel's expressive simplicity.

1633.4k](/packages/grok-php-laravel)[clarifai/clarifai-php

Clarifai PHP Client

21133.0k](/packages/clarifai-clarifai-php)[grok-php/client

Grok PHP Client is a robust and community-driven PHP client library for seamless integration with Grok AI API, offering efficient access to advanced AI and data processing capabilities.

325.9k4](/packages/grok-php-client)[softcreatr/php-mistral-ai-sdk

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

1517.9k](/packages/softcreatr-php-mistral-ai-sdk)[clarifai/clarifai-php-grpc

Clarifai PHP gRPC client

1128.3k](/packages/clarifai-clarifai-php-grpc)[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..

149.1k](/packages/softcreatr-php-perplexity-ai-sdk)

PHPackages © 2026

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