PHPackages                             modelflow-ai/mistral - 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. modelflow-ai/mistral

ActiveLibrary[API Development](/categories/api)

modelflow-ai/mistral
====================

Client for mistral API.

0.3.0(1y ago)12.5k↓45.2%11MITPHPPHP ^8.2

Since Apr 7Pushed 3mo agoCompare

[ Source](https://github.com/modelflow-ai/mistral)[ Packagist](https://packagist.org/packages/modelflow-ai/mistral)[ RSS](/packages/modelflow-ai-mistral/feed)WikiDiscussions 0.2 Synced 1mo ago

READMEChangelogDependencies (12)Versions (9)Used By (1)

 [![Mistral Logo](https://avatars.githubusercontent.com/u/152068817?s=768&v=4)](https://avatars.githubusercontent.com/u/152068817?s=768&v=4)

Modelflow AI
Mistral

======================

[](#modelflow-aimistral)

The Mistral package is a comprehensive API client for [Mistral AI](), developed using PHP. It provides a robust and efficient interface for interacting with the Mistral AI model, enabling developers to seamlessly integrate AI capabilities into their PHP applications. This package is designed with a focus on ease of use, performance, and flexibility. It allows developers to leverage the full potential of the Mistral AI model, from creating chat conversations to getting chat completions, all through a simple and intuitive API.

While the Mistral package can be used in conjunction with other packages, it is important to note that it operates independently and is not directly connected to any other package or system. This independence ensures that developers can integrate the Mistral package into their projects without any dependencies or conflicts.

> **Note**: This is part of the `modelflow-ai` project create issues in the [main repository](https://github.com/modelflow-ai/.github).

> **Note**: This project is heavily under development and any feedback is greatly appreciated.

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

[](#installation)

To install the Mistral package, you need to have PHP 8.2 or higher and Composer installed on your machine. Then, you can add the package to your project by running the following command:

```
composer require modelflow-ai/mistral
```

Examples
--------

[](#examples)

Here are some examples of how you can use the Mistral in your PHP applications. You can find more detailed examples in the [examples directory](examples).

Usage
-----

[](#usage)

### Creating a Client

[](#creating-a-client)

First, you need to create a client. The client is the main entry point to interact with the Mistral AI model. You can create a client using the `Mistral` class:

```
use ModelflowAi\Mistral\Mistral;

$client = Mistral::client('your-api-key');
```

### Using the Chat Resource

[](#using-the-chat-resource)

The Chat resource allows you to create chat conversations and get chat completions.

```
$chat = $client->chat();

// Create a chat conversation
$parameters = [
    'model' => 'mistral-medium',
    'messages' => [
        [
            'role' => 'system',
            'content' => 'You are a helpful assistant.'
        ],
        [
            'role' => 'user',
            'content' => 'Who won the world series in 2020?'
        ]
    ]
];
$response = $chat->create($parameters);

// The response is an instance of CreateResponse
echo $response->id;
```

### Using the Embeddings Resource

[](#using-the-embeddings-resource)

The Embeddings resource allows you to generate and manipulate embeddings for your data.

```
$embeddings = $client->embeddings();

// Generate embeddings for your data
$parameters = [
    'model' => 'mistral-medium',
    'texts' => ['text1', 'text2']
];
$response = $embeddings->create($parameters);

// The response is an instance of CreateResponse
echo $response->id;
```

API Documentation
-----------------

[](#api-documentation)

For more detailed information about the Mistral API, please refer to the [official API documentation](https://docs.mistral.ai/api).

Open Points
-----------

[](#open-points)

### Model API

[](#model-api)

The Model API is another area that we are actively working on. Once completed, this will provide users with the ability to manage and interact with their AI models directly from the Mistral package.

Testing
-------

[](#testing)

To run the tests, use PHPUnit:

```
composer test
```

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

[](#contributing)

Contributions are welcome. Please open an issue or submit a pull request in the main repository at .

License
-------

[](#license)

This project is licensed under the MIT License. For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance63

Regular maintenance activity

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.4% 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 ~94 days

Recently: every ~106 days

Total

8

Last Release

109d ago

### Community

Maintainers

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

---

Top Contributors

[![wachterjohannes](https://avatars.githubusercontent.com/u/1464615?v=4)](https://github.com/wachterjohannes "wachterjohannes (37 commits)")[![alexander-schranz](https://avatars.githubusercontent.com/u/1698337?v=4)](https://github.com/alexander-schranz "alexander-schranz (1 commits)")

---

Tags

apiclientaimistral

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/modelflow-ai-mistral/health.svg)

```
[![Health](https://phpackages.com/badges/modelflow-ai-mistral/health.svg)](https://phpackages.com/packages/modelflow-ai-mistral)
```

###  Alternatives

[deepseek-php/deepseek-php-client

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

47073.9k5](/packages/deepseek-php-deepseek-php-client)[gemini-api-php/client

API client for Google's Gemini API

216221.4k5](/packages/gemini-api-php-client)[chriskonnertz/deeply

DeepLy is a PHP client for the DeepL.com translation API

230116.2k8](/packages/chriskonnertz-deeply)[gemini-api-php/laravel

Gemini API client for Laravel

8915.7k](/packages/gemini-api-php-laravel)[modelflow-ai/ollama

Client for ollama API.

131.3k4](/packages/modelflow-ai-ollama)[smnandre/pagespeed-api

PageSpeed Insight PHP Api Client 🚀 Analyse web pages for performances metrics, core web vitals...

1511.5k](/packages/smnandre-pagespeed-api)

PHPackages © 2026

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