Leonardo AI SDK for PHP
composer require cedricziel/leonardoai-php
You need an API key from Leonardo
$authenticationRegistry = new AuthenticationRegistry([new ApiKeyAuthentication('my-api-key')]);
$client = Client::create(null, [$authenticationRegistry]);
$client->getUserSelf();
$body = GenerationsPostBody();
$body->setPrompt('A cat on a tree');
$res = $client->createGeneration($body);
MIT