Search by

aisdk / xai

aisdk

Official xAI provider for the PHP AI SDK.

Package info

github.com/phpaisdk/xai

pkg:composer/aisdk/xai

Fund package maintenance!

Open Collective

Statistics

Installs: 24

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

v0.11.0 2026-10-31 02:59 UTC

This package is auto-updated.

Last update: 2026-11-03 18:59:00 UTC


README

Text, image, audio, embedding, and video generation, plus live voice sessions with xAI. Part of the framework-agnostic PHP AI SDK.

Installation

composer require aisdk/xai

Set XAI_API_KEY in your environment.

Usage

use AiSdk\Generate;
use AiSdk\XAI;

$result = Generate::text('Explain closures in PHP in one sentence.')
    ->model(XAI::model('grok-4.3-latest'))
    ->run();

echo $result->text;

Documentation

Read the documentation for configuration, supported features, and more examples.

Contributing ยท Support

License

The MIT License (MIT). See LICENSE for details.