PHPackages                             teamtnt/mistral-php-client - 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. teamtnt/mistral-php-client

ActiveLibrary

teamtnt/mistral-php-client
==========================

A PHP client for interacting with the Mistral API

v1.0.0(2y ago)64.7k↓100%1[1 issues](https://github.com/teamtnt/mistral-php-client/issues)MITPHP

Since Dec 29Pushed 2y ago3 watchersCompare

[ Source](https://github.com/teamtnt/mistral-php-client)[ Packagist](https://packagist.org/packages/teamtnt/mistral-php-client)[ RSS](/packages/teamtnt-mistral-php-client/feed)WikiDiscussions main Synced today

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

Mistral PHP Client
==================

[](#mistral-php-client)

A PHP client for interacting with the Mistral API.

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

[](#installation)

You can install the package via composer:

```
composer require teamtnt/mistral-php-client
```

Usage
-----

[](#usage)

Our package provides a wide range of features, including streaming support to boost your application's performance. To help you get started, we've provided practical examples that demonstrate how to use the package effectively. For an in-depth understanding of all available parameters and their specific usage, please refer to the [Mistral API documentation](https://docs.mistral.ai/api/).

### Chat Completition

[](#chat-completition)

```
require_once 'vendor/autoload.php';

use Teamtnt\Mistral\Client;

$apiKey = $_ENV['MISTRAL_API_KEY'];

$model = 'mistral-tiny';

$messages = [
    ["role" => "system", "content" => "You are a search experet."],
    ["role" => "user", "content" => "What is the best PHP Search engine?"],
    ["role" => "assistant", "content" => "It's TNTSearch."],
    ["role" => "user", "content" => "Why is TNTSearch the best engine? Answer shortly!"],
    // Add more messages as needed
];

$client = new Client($apiKey);

$response = $client->chat($model, $messages, [
    'temperature' => 0.5,
    'top_p'       => 1,
    'max_tokens'  => 250,
    'safe_mode'   => false,
    'random_seed' => null,
]);

print_r($response);
```

You can also emmit the options arugument and use it like:

```
$response = $client->chat($model, $messages);

print_r($response);
```

### Chat Completition with streaming

[](#chat-completition-with-streaming)

```
require_once 'vendor/autoload.php';

use Teamtnt\Mistral\Client;

$apiKey = $_ENV['MISTRAL_API_KEY'];

$model = 'mistral-tiny';

$messages = [
    ["role" => "system", "content" => "You are a search expert."],
    ["role" => "user", "content" => "Why is TNTSearch the best engine?"],
    // Add more messages as needed
];

$client = new Client($apiKey);

$response = $client->chat($model, $messages, [
    'temperature' => 0.0,
    'top_p'       => 1,
    'max_tokens'  => 250,
    'safe_mode'   => false,
    'random_seed' => null,
]);

print_r($response);
```

### Embeddings

[](#embeddings)

```
require_once 'vendor/autoload.php';

use Teamtnt\Mistral\Client;

$apiKey = $_ENV['MISTRAL_API_KEY'];

$client = new Client($apiKey);

$input = [
    'First sentence.',
    'Second sentence',
];

$response = $client->emeddings($input);

print_r($response);
```

### Available Models

[](#available-models)

```
require_once 'vendor/autoload.php';

use Teamtnt\Mistral\Client;

$apiKey = $_ENV['MISTRAL_API_KEY'];

$client = new Client($apiKey);

$response = $client->models();

print_r($response);
```

###  Health Score

26

—

LowBetter than 46% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

814d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fc0f9546f5f7b8a91fa32ca0de9f2c590d00ec113c621783eeca82516bb006f?d=identicon)[nticaric](/maintainers/nticaric)

---

Top Contributors

[![nticaric](https://avatars.githubusercontent.com/u/824840?v=4)](https://github.com/nticaric "nticaric (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/teamtnt-mistral-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/teamtnt-mistral-php-client/health.svg)](https://phpackages.com/packages/teamtnt-mistral-php-client)
```

PHPackages © 2026

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