rapttor/grok-api-client

A PHP client library for interacting with xAI's GROK API

Installs: 8

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/rapttor/grok-api-client

1.0.0 2025-08-17 17:07 UTC

This package is auto-updated.

Last update: 2025-09-20 16:07:02 UTC


README

A simple PHP client library for interacting with xAI's GROK API - Based on grok-4 curl example

Installation

Install via Composer:

composer require RapTToR/grok-api-client

Usage

<?php
use RapTToR\Grok\Grok;
$XAI_API_KEY = getenv('XAI_API_KEY');
echo  new Grok($XAI_API_KEY)->chat("What is the meaning of life, the universe, and everything?")->result(0);
?>
  • The library is based on Grok Curl example
  • Does not require any other dependencies