PHP Classes

PHP AI library to Access Different Artificial Intelligence Prompt Services Using the PHP AI Client Class: Call prompt-based artificial intelligence tools

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2026-04-05 (2 days ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
php-ai-client-class 1.0MIT/X Consortium ...8Web services, Chat, Artificial intell..., P...
Description 

Author

This package can call different prompt-based artificial intelligence tools

It provides a PHP class that can send HTTP requests to the web servers of APIs of artificial intelligence that take a prompt as a request parameter and return the response.

The class supports processing errors and trying again on failure.

It provides a generator function to build the request data from the prompt text and options to send to each of the supported artificial intelligence tools.

Currently the class can call the APIs of artificial intelligence tools like:

- Google Gemini

- OpenAI ChatGPT

Picture of The Algoslingers
  Performance   Level  
Name: The Algoslingers is available for providing paid consulting. Contact The Algoslingers .
Classes: 10 packages by
Country: Ghana Ghana
Age: ???
All time rank: 36865 in Ghana Ghana
Week rank: 46 Up1 in Ghana Ghana Up
Innovation award
Innovation award
Nominee: 5x

Winner: 2x

Instructions

Example Usage

<?php
$ai = new AIClient([
    'provider' => 'openai', // or gemini
    'api_key'  => 'YOUR_API_KEY'
]);

$response = $ai->generate("Explain Laravel queues in simple terms");

echo $response;
  Files folder image Files (1)  
File Role Description
Plain text file aiclient.php Class reusable, provider-agnostic AI client

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 0%
Total:0
This week:0