Skip to main content

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 spent
  • RejectedError — the content filter refused the prompt; rewrite it rather than retrying
  • SignInError — the request needs an account or a plan that includes that model
  • AuthError — 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kavel 0.2.1
File Size Uploaded
kavel-0.2.1.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kavel 0.2.1
File Interpreter ABI Platform
kavel-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / kavel-0.2.1.tar.gz

Download URL kavel-0.2.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3b9af79865f29c4923ae8ebb8e176acb2487e99e78d7dfc3bee1811ab9ffbc29
BLAKE2b-256 checksum
How to use checksums
82b9cdc22a493561cd91e8beaa990e4dcbcb0e15e38242e317098a99fa1f6311
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.1-py3-none-any.whl

Download URL kavel-0.2.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
168474423c85ba54e9edb9a98922a99b1388531ed8f77d5040430e88ccf71c90
BLAKE2b-256 checksum
How to use checksums
73a96c788fcf650bd948dceaf827832322444b1c3b9ca50b35bbf4d11e5a3f0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page