Registry / http-client / openai-php-client

openai-php-client

JSON →
library0.20.0phppackagistunverified

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

composer require openai-php/client
INSTALL
IMPORT
SIG · OPENAI-PHP-CLIENT
O
openai-php-client
http-clientphpv0.20.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
use OpenAI\Client;

Sends a completion request to OpenAI.

use OpenAI\Client; $client = new Client('your-api-key'); $response = $client->completions()->create(['model' => 'text-davinci-003', 'prompt' => 'Hello']);
Debug
Known issues
gotchaAPI key required
fix
Set the API key via constructor or environment variable OPENAI_API_KEY
affects: >=0.1.0
Upgrade
Version history
0.20.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
openai-php-client — pip install openai-php-client · libregistry