- PHP 8.1 or newer ๐
- Composer installed on your machine ๐ฆ
- An account on OpenAI for OpenAI's API keys.
<?php
require_once __DIR__ . '/vendor/autoload.php'; // Include Composer's autoload
use PH7\OpenAi\Api\OpenAi as OpenAiApi;
use PH7\OpenAi\Api\PrivateKey as OpenAiKey;
use PH7\OpenAi\Client as AiClient;
$apiKey = new OpenAiKey('YOUR_OPENAI_KEY_HERE');
$openAi = new AiClient( new OpenAiApi($apiKey) );
$openAi->search('Some keywords'); // To search
$openAi->classifications('Some keywords'); // For OpenAI classifications
I'm Pierre-Henry Soria. A passionate, zen & dedicated software engineer ๐
You can keep in touch with me at: hi@ph7.me ๐ฎ
๐ Click here to watch on YouTube
PHP OpenAI SDK is distributed under MIT license ๐ Enjoy! โค๏ธ
Note: This is not an official library published by OpenAI. I just want to help the community by providing a great library layer to be used with OpenAI.