OpenAI PHP SDK : Most downloaded, forked, contributed, huge community supported, and used PHP (Laravel , Symfony, Yii, Cake PHP or any PHP framework) SDK for Op
OpenAI PHP SDK : Most downloaded, forked, contributed, huge community supported, and used PHP (Laravel , Symfony, Yii, Cake PHP or any PHP framework) SDK for Op
ChatGPT API is currently supported, click here for the implementation introductions.
A message from creator,
Thank you for visiting the @orhanerday/open-ai repository! If you find this repository helpful or useful, we encourage you to star it
on GitHub. Starring a repository is a way to show your support for the project. It also helps to increase the visibility
of the project and to let the community know that it is valuable. Thanks again for your support and we hope you find the
repository useful!
Orhan
| Project Name | Required PHP Version (Lower is better) | Description | Type (Official / Community) | Support |
|---|---|---|---|---|
| orhanerday/open-ai | PHP 7.4+ | Most downloaded, forked, contributed, huge community supported, and used PHP SDK for OpenAI GPT-3 and DALL-E. It also supports chatGPT-like streaming. | Community | Available, (Community driven Discord Server or personal mail [email protected]) |
| openai-** /c***t | PHP 8.1+ | OpenAI PHP API client. | Community | - |
Fully open-source and secure community-maintained, PHP SDK for accessing the OpenAI GPT-3 API.
For more information, you can read laravel news blog post.
Free support is available. Join our discord server
To get started with this package, you'll first want to be familiar with the OpenAI API documentation and examples. Also you can get help from our discord channel that called #api-support
Requires PHP 7.4+
Click here to join the Discord server
As you may know, OpenAI PHP is an open-source project wrapping tool for OpenAI. We rely on the support of our community to continue developing and maintaining the project, and one way that you can help is by making a donation.
Donations allow us to cover expenses such as hosting costs(for testing), development tools, and other resources that are necessary to keep the project running smoothly. Every contribution, no matter how small, helps us to continue improving OpenAI PHP for everyone.
If you have benefited from using OpenAI PHP and would like to support its continued development, we would greatly appreciate a donation of any amount. You can make a donation through;
Thank you for considering a donation to Orhanerday/OpenAI PHP SDK. Your support is greatly appreciated and helps to ensure that the project can continue to grow and improve.
Sincerely,
Orhan Erday / Creator.
Please visit https://orhanerday.gitbook.io/openai-php-api-1/
You can install the package via composer:
composer require orhanerday/open-aiBefore you get starting, you should set OPENAI_API_KEY as ENV key, and set OpenAI key as env value with the following commands;
Powershell
$Env:OPENAI_API_KEY = "sk-gjtv....."Cmd
set OPENAI_API_KEY=sk-gjtv.....Linux or macOS
export OPENAI_API_KEY=sk-gjtv.....Getting issues while setting up env? Please read the article or you can check my StackOverflow answer for the Windows® ENV setup.
Create your index.php file and paste the following code part into the file.
…Run the server with the following command
php -S localhost:8000 -t .orhanerday/open-ai supports Nvidia NIM. The below example is MixtralAI. Check https://build.nvidia.com/explore/discover for more examples.
…According to the following code
$open_aiis the base variable for all open-ai operations.
use Orhanerday\OpenAi\OpenAi;
$open_ai = new OpenAi(env('OPEN_AI_API_KEY'));For users who belong to multiple organizations, you can pass a header to specify which organization is used for an API request. Usage from these API requests will count against the specified organization's subscription quota.
$open_ai_key = getenv('OPENAI_API_KEY');
$open_ai = new OpenAi($open_ai_key);
$open_ai->setORG("org-IKN2E1nI3kFYU8ywaqgFRKqi");You can specify Origin URL with setBaseURL() method;
No open issues yet, or sync has not completed.