kavel
Generate images from a prompt with no API key and no account.
from kavel import generate
url = generate("a paper-cut layered mountain range at dusk, warm rim light")
That is the whole setup. No key to fetch, no config file, no dependencies — standard library only. It calls the anonymous endpoint on Kavel, an online AI image and video studio.
Editing a photo
Pass image_url and the prompt describes the change rather than the picture:
url = generate(
"restyle the hair into a shoulder-length layered cut, "
"keep the same face, skin and lighting",
image_url="https://example.com/portrait.jpg",
)
Naming what must stay is what holds the likeness. Prompts that only name the edit tend to drift the whole face.
What the free tier actually covers
| Anonymous grant | 15 credits |
| Text-to-image | 5 credits — so the grant covers three |
Photo edit (nano-banana-2-lite) |
15 credits — exactly one |
| Per-IP ceiling | 30 credits a day |
Anonymous output is 1K and watermarked. Signing in on kavel.ai removes the watermark and opens the larger models.
Video is deliberately not exposed here. The cheapest clip is 40 credits against a 15-credit anonymous wallet, so a signed-out call cannot succeed at any setting. Signed-out video on the site runs on a browser-side engine instead — see the video tools.
Errors worth catching
Each failure is its own subclass of KavelError, so you can branch on what to do next:
QuotaError— the free allowance (or, with a key, your account's credits) is spentRejectedError— the content filter refused the prompt; rewrite it rather than retryingSignInError— the request needs an account or a plan that includes that modelAuthError— the API key is wrong or deleted
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):
url = generate(prompt, api_key=os.environ["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. AuthError means the key is wrong; QuotaError with a key means the account is out of credits.
Prompts that work
Kavel keeps a page per edit, each preloaded with a prompt for that specific job — hairstyle, outfit, and the rest under image tools.
MIT licensed.
Metadata
Release files for kavel 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kavel-0.2.0.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kavel-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / kavel-0.2.0.tar.gz
| Download URL | kavel-0.2.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36e52d473b8fbaefa11b5815b59bc921a786a20cc78f16fd64ca30d415706919
|
|
BLAKE2b-256 checksum How to use checksums |
11686648764ec073c4b4bed126e63c9da85894bfd6422ff3b880fd13c4867ab4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / kavel-0.2.0-py3-none-any.whl
| Download URL | kavel-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
443221d14cb90c8d10be092d6064c6cafe4cb75beec077bf827299d35a7a531b
|
|
BLAKE2b-256 checksum How to use checksums |
695a44c8da4881b0dd947acd8e5550f289052044f28f588480a12bc9df1fbb69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|