cedricziel / leonardoai-php
Leonardo.ai SDK for PHP
Fund package maintenance!
cedricziel
v1.0.0
2024-07-12 17:09 UTC
Requires
- php: ^8.3
- jane-php/open-api-runtime: ^7.8
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.59
- jane-php/open-api-3: ^7.8
README
Leonardo AI SDK for PHP
Install
composer require cedricziel/leonardoai-php
Usage
You need an API key from Leonardo
Client creation
$authenticationRegistry = new AuthenticationRegistry([new ApiKeyAuthentication('my-api-key')]); $client = Client::create(null, [$authenticationRegistry]);
Get current user
$client->getUserSelf();
Image Generation: Create
$body = GenerationsPostBody(); $body->setPrompt('A cat on a tree'); $res = $client->createGeneration($body);
License
MIT