maryushenina / ai-client-sdk
Lightweight SDK for using OpenAI Chat Completion API in PHP projects.
v0.1.0
2025-07-03 09:18 UTC
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpunit/phpunit: ^10.0
README
Lightweight SDK for interacting with the OpenAI Chat Completion API using PHP.
Installation
composer require maryushenina/ai-client-sdk
Usage
use GuzzleHttp\Client; use MaryUshenina\AiClientSdk\OpenAIClient; $client = new OpenAIClient(new Client(), 'your-api-key'); $response = $client->complete([ ['role' => 'system', 'content' => 'You are a helpful assistant.'], ['role' => 'user', 'content' => 'What is PHP?'] ]); echo $response;
Testing
./vendor/bin/phpunit
Install dependencies
make install
Rebuild environment (clean + install)
make rebuild
Run tests inside Docker (optional)
make docker-test
License
MIT