https://github.com/tryagi/leonardo
Generated C# SDK based on Leonardo AI OpenAPI specification
https://github.com/tryagi/leonardo
ai csharp dotnet generated image-gen image-generation langchain langchain-dotnet leonardo leonardoai nswag openapi sdk specification
Last synced: 5 months ago
JSON representation
Generated C# SDK based on Leonardo AI OpenAPI specification
- Host: GitHub
- URL: https://github.com/tryagi/leonardo
- Owner: tryAGI
- License: mit
- Created: 2023-08-05T06:02:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-22T06:21:48.000Z (6 months ago)
- Last Synced: 2025-05-13T01:15:36.850Z (5 months ago)
- Topics: ai, csharp, dotnet, generated, image-gen, image-generation, langchain, langchain-dotnet, leonardo, leonardoai, nswag, openapi, sdk, specification
- Language: C#
- Homepage: https://tryagi.github.io/Leonardo/
- Size: 737 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Leonardo
[
[](https://github.com/tryAGI/Leonardo/actions/workflows/dotnet.yml)
[](https://github.com/tryAGI/Leonardo/blob/main/LICENSE.txt)
[](https://discord.gg/Ca2xhfBf3v)## Features 🔥
- Fully generated C# SDK based on [official OpenAPI specification](https://api-docs-nine-delta.vercel.app/cloud/openapi.json) using [OpenApiGenerator](https://github.com/HavenDV/OpenApiGenerator)
- Same day update to support new features
- Updated and supported automatically if there are no breaking changes
- All modern .NET features - nullability, trimming, NativeAOT, etc.
- Support .Net Framework/.Net Standard 2.0### Usage
```csharp
using Leonardo;using var api = new LeonardoApi(apiKey);
var createResponse = await api.Image.CreateGenerationAsync(
prompt: "Generate cat");createResponse.SdGenerationJob.Should().NotBeNull();
await Task.Delay(TimeSpan.FromSeconds(15));
var response = await api.Image.GetGenerationByIdAsync(createResponse.SdGenerationJob?.GenerationId ?? throw new InvalidOperationException("GenerationId is null"));
var url = response.GenerationsByPk?.GeneratedImages?.ElementAtOrDefault(0)?.Url;
```## Support
Priority place for bugs: https://github.com/tryAGI/Leonardo/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Leonardo/discussions
Discord: https://discord.gg/Ca2xhfBf3v## Acknowledgments

This project is supported by JetBrains through the [Open Source Support Program](https://jb.gg/OpenSourceSupport).

This project is supported by CodeRabbit through the [Open Source Support Program](https://github.com/marketplace/coderabbitai).