cedricziel/leonardoai-php

Leonardo.ai SDK for PHP

v1.0.0 2024-07-12 17:09 UTC

This package is auto-updated.

Last update: 2024-11-12 18:02:06 UTC


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