Kavel 0.2.0
dotnet add package Kavel --version 0.2.0
NuGet\Install-Package Kavel -Version 0.2.0
<PackageReference Include="Kavel" Version="0.2.0" />
<PackageVersion Include="Kavel" Version="0.2.0" />
<PackageReference Include="Kavel" />
paket add Kavel --version 0.2.0
#r "nuget: Kavel, 0.2.0"
#:package Kavel@0.2.0
#addin nuget:?package=Kavel&version=0.2.0
#tool nuget:?package=Kavel&version=0.2.0
Kavel for .NET
Generate and edit images from C# with no API key, no account and no card.
dotnet add package Kavel
using Kavel;
var kavel = new KavelClient();
var img = await kavel.GenerateAsync(
"matte black ceramic mug on pale oak, soft window light from the left, shallow depth of field",
aspectRatio: "16:9");
Console.WriteLine(img.Url); // https://cdn.kavel.ai/uploads/kie/image/....webp
var edited = await kavel.EditAsync(img.Url, "place the mug on a white marble surface");
Every other image package wants a key from OpenAI, fal or Replicate before it runs once. This one talks to
the free tier of Kavel — a client id the
library invents rather than an account you register — so a console app, an Azure Function or a Unity
editor script works with nothing configured and no secret in appsettings.json.
Why it is shaped this way
net8.0andnetstandard2.0. Runs on modern .NET and on .NET Framework / Unity via netstandard.- An edit lane.
EditAsynctakes a photo you already have and one sentence describing the change. - One exception with a
Kind.Quotameans wait or sign in,Rejectedmeans reword,SignInmeans the request is off the free shelf. CancellationTokeneverywhere, and it keeps polling through a dropped connection. A free run waits in a queue and only reaches the model at the end of it; giving up on one failed poll would throw away a job about to run. Pass your ownHttpClientto share a pool.
Limits, measured against the running service
- The free grant is 15 credits. An image costs 5, an edit costs 15. The package mints a new client id per call, so a loop is not capped at three.
- 30 credits per IP per day sits on top — about six images from one machine — and surfaces as
KavelErrorKind.Quota. - Free output is 1K and watermarked;
img.Watermarkedtells you instead of leaving you to guess. - Free runs queue 25–80 seconds before the model is called, which is why the default deadline is six minutes.
- Video does not run anonymously — the cheapest clip costs more than the grant. The AI video generator has a browser lane for that.
Signing in removes the watermark and opens the full shelf: Nano Banana 2 for up to 14 reference photos, GPT Image 2 for 4K output, Qwen Image 3 when the picture has to contain correctly spelled text, and Seedream 5.0 Pro for photoreal people. Pricing has every tier.
Past the free tier: an API key
When the free allowance runs out, the error tells you where to go next. Create a key at
kavel.ai/settings/apikeys — the same account
you use on the site — and pass it (or set KAVEL_API_KEY):
var kavel = new KavelClient(apiKey: Environment.GetEnvironmentVariable("KAVEL_API_KEY"), model: "gpt-image-2");
With a key every call runs on your account, exactly as it would on the site: your
credits and plan, no per-IP ceiling, no watermark on a
paid plan, and any image model your plan includes. KavelErrorKind.Auth means the key is wrong; Quota with a key means the account is out of credits.
Prompts that work
Name the light, the material and the composition — that moves the result more than adjectives do. For edits, say what changes and the model keeps the rest; it is the same Nano Banana 2 Lite lane behind the AI hairstyle changer and the AI outfit generator. The free AI image generator runs the same engines in a browser, and the showcase has finished output.
Tests
dotnet test
Offline, with a fake HttpMessageHandler: argument validation, client id uniqueness, the quota wall (an
HTTP 200 recognised only by a field), the sign-in refusal, and polling through a dropped connection.
More languages and recipes: kavel.readthedocs.io.
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Text.Json (>= 8.0.5)
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.