1. Go to this page and download the library: Download filippo-toso/openai library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
filippo-toso / openai example snippets
use FilippoToso\OpenAI\OpenAI;
use FilippoToso\OpenAI\Options;
ee https://platform.openai.com/account/api-keys
'oprganizationId' => 'your-organization-id', // @see https://platform.openai.com/account/org-settings
]);
$openAi = new OpenAI($options);
$response = $openAi->models()->list();
print_r($response->body());