PHPackages                             papi-ai/grok - 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. papi-ai/grok

ActiveLibrary

papi-ai/grok
============

Grok (xAI) provider for PapiAI

v0.9.1(2mo ago)00MITPHPPHP ^8.2CI passing

Since Mar 7Pushed 1mo agoCompare

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

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

PapiAI Grok Provider
====================

[](#papiai-grok-provider)

[![CI](https://github.com/papi-ai/grok/workflows/CI/badge.svg)](https://github.com/papi-ai/grok/actions?query=workflow%3ACI) [![Latest Version](https://camo.githubusercontent.com/d5a8ed28bea8224e17062940c56d5e4fb58fdd5a234492931158f943d6f5ee2b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706170692d61692f67726f6b2e737667)](https://packagist.org/packages/papi-ai/grok) [![Total Downloads](https://camo.githubusercontent.com/0a97c624c065eb1dfe4c49796f6822ed6a7a22872fb6622c5915c49402a6fa0e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706170692d61692f67726f6b2e737667)](https://packagist.org/packages/papi-ai/grok) [![PHP Version](https://camo.githubusercontent.com/b87c8eb6de9aa571b00ba7a13653aab8aa8f2171aa02164a48cd8f5354d7f096/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706170692d61692f67726f6b2e737667)](https://packagist.org/packages/papi-ai/grok) [![License](https://camo.githubusercontent.com/1784b3f03f370760dd683ba55fbc00f30498a95e4febc03dc1092399b8434edc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706170692d61692f67726f6b2e737667)](https://packagist.org/packages/papi-ai/grok)

Grok (xAI) provider for [PapiAI](https://github.com/papi-ai/papi-core) - A simple but powerful PHP library for building AI agents.

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

[](#installation)

```
composer require papi-ai/grok
```

Usage
-----

[](#usage)

```
use PapiAI\Core\Agent;
use PapiAI\Grok\GrokProvider;

$provider = new GrokProvider(
    apiKey: $_ENV['XAI_API_KEY'],
);

$agent = new Agent(
    provider: $provider,
    instructions: 'You are a helpful assistant.',
);

$response = $agent->run('Hello!');
echo $response->text;
```

Available Models
----------------

[](#available-models)

```
GrokProvider::MODEL_GROK_3      // 'grok-3' (default)
GrokProvider::MODEL_GROK_3_MINI // 'grok-3-mini' (fast)
GrokProvider::MODEL_GROK_2      // 'grok-2'
```

Features
--------

[](#features)

- Tool/function calling
- Vision/multimodal support
- Structured output (JSON mode)
- Streaming support

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance88

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

Every ~0 days

Total

4

Last Release

62d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/126c34b4dff8d42336ea07ac5297bcc3ec0a0e306fd964a7497f02240da4b142?d=identicon)[md](/maintainers/md)

---

Top Contributors

[![MarcelloDuarte](https://avatars.githubusercontent.com/u/144535?v=4)](https://github.com/MarcelloDuarte "MarcelloDuarte (12 commits)")

###  Code Quality

TestsPest

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/papi-ai-grok/health.svg)

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

PHPackages © 2026

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