Registry / http-client / orhanerday-open-ai

orhanerday-open-ai

JSON →
library4.9.1phppackagistunverified

OpenAI GPT-3 Api Client in PHP

composer require orhanerday/open-ai
INSTALL
IMPORT
SIG · ORHANERDAY-OPEN-AI
O
orhanerday-open-ai
http-clientphpv4.9.1
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.

OpenAi
use Orhanerday\OpenAi\OpenAi;

Send a completion request to OpenAI GPT-3.

use Orhanerday\OpenAi\OpenAi; $open_ai = new OpenAi('your-api-key'); $response = $open_ai->complete([ 'model' => 'text-davinci-003', 'prompt' => 'Hello', 'max_tokens' => 5 ]); echo $response;
Debug
Known issues
gotchaAPI keys must be kept secret; never hardcode them in source code.
fix
Use environment variables or a secure configuration system.
affects: *
Upgrade
Version history
4.9.1latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
20
Resources
orhanerday-open-ai — pip install orhanerday-open-ai · libregistry