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. [API Development](/categories/api)
4. /
5. teamtnt/mistral-php-client

ActiveLibrary[API Development](/categories/api)

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

A PHP client for interacting with the Mistral API

v1.0.0(2y ago)65.2k1[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 3w ago

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

27

—

LowBetter than 47% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

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

907d 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)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.3M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1772.4k4](/packages/aimeos-prisma)

PHPackages © 2026

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