Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cedricziel/leonardoai-php
Leonardo AI SDK for PHP
https://github.com/cedricziel/leonardoai-php
Last synced: 11 days ago
JSON representation
Leonardo AI SDK for PHP
- Host: GitHub
- URL: https://github.com/cedricziel/leonardoai-php
- Owner: cedricziel
- License: mit
- Created: 2024-07-12T16:10:48.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-12T17:19:33.000Z (4 months ago)
- Last Synced: 2024-10-11T20:07:27.277Z (25 days ago)
- Language: PHP
- Size: 147 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# leonardoai-php
Leonardo AI SDK for PHP
## Install
```bash
composer require cedricziel/leonardoai-php
```## Usage
You need an API key from Leonardo
### Client creation
```php
$authenticationRegistry = new AuthenticationRegistry([new ApiKeyAuthentication('my-api-key')]);
$client = Client::create(null, [$authenticationRegistry]);
```### Get current user
```php
$client->getUserSelf();
```### Image Generation: Create
```php
$body = GenerationsPostBody();
$body->setPrompt('A cat on a tree');
$res = $client->createGeneration($body);
```## License
MIT