Tanvo for Python
The Python client for Tanvo, an AI image, video and music studio. Generate images on Nano Banana, Seedream, GPT Image and Qwen, video on Veo, Kling, Seedance and Wan, and songs on Suno, or run one of 80 ready-made photo apps (pet portraits, figurines, old photo restoration, trend videos) on your own photos.
- No dependencies: only the standard library. Python 3.9+.
- Works without an API key on the free tier (house image engine, watermarked).
- Local files are uploaded for you; results download with one call.
- Retries that never double-charge (every submit carries an idempotency key).
pip install tanvo
Quick start
import tanvo
client = tanvo.Client() # reads TANVO_API_KEY; without one it runs on the free tier
image = client.generate_image("a paper lantern floating over a misty lake at dawn", aspect="16:9")
print(image.url)
client.download(image, "out/")
Create a key under Settings → API keys to use every model, get clean output and have runs land in your history.
client = tanvo.Client("sk_...") # or export TANVO_API_KEY=sk_...
Ready-made apps
Each app has preset looks: a tuned prompt, model and settings with a real example output.
for app in client.apps(kind="image")[:5]:
print(app.slug, "-", app.name, [look.id for look in app.looks])
portrait = client.generate_from_app(
"ai-pet-portrait-generator",
look="royal",
photos=["rex.jpg"], # local path, https URL or bytes, in the order of app.inputs
details="Rex, a very good boy",
)
client.download(portrait, "out/")
Images
# Text to image on any model (see client.models("image") for ids, options and prices)
img = client.generate_image("isometric cutaway of a tiny ramen shop", model="nano-banana-2", resolution="2K")
# Edit or combine photos: describe what to change and what to keep
edit = client.generate_image(
"change the jacket to dark green; keep the face, pose and background exactly as they are",
model="nano-banana-2",
images=["portrait.jpg"],
)
Video
Video takes one to several minutes, so generate_video returns at once by default.
job = client.generate_video(
"slow dolly-in on a lighthouse in a storm, waves crashing, cinematic",
model="kling-3-0", aspect="16:9", resolution="720p", duration=5,
)
clip = client.wait(job.id) # or pass wait=True above
client.download(clip, "out/")
# Image to video, with an optional end frame on models that support it
client.generate_video("the cat turns its head and blinks", model="seedance-2-5", image="cat.jpg", wait=True)
Songs
Two takes per run, each an MP3 with cover art, a title and the lyrics as sung.
song = client.generate_music(
"an upbeat birthday song for my sister Ana: surfing, terrible puns, a big singalong chorus",
style="acoustic pop, hand claps, warm female vocal",
)
for take in song.outputs:
print(take.title, take.seconds, take.url, take.cover)
client.generate_music("[Verse]\n...\n[Chorus]\n...", mode="Lyrics", title="Ana Rides Again", vocal="f")
client.generate_music("mellow lo-fi study beat, vinyl crackle, 75 bpm", mode="Instrumental")
Runs, history and webhooks
g = client.get("cm...") # one run
items, next_before = client.list(limit=20)
# Skip polling: have the result POSTed to you when it finishes
client.generate_video("...", model="veo-3-1", webhook_url="https://example.com/hooks/tanvo")
# In your web handler, verify with the secret from Settings → Webhooks (pass the raw body)
generation = tanvo.verify_webhook(secret, request.headers, request.get_data())
Webhooks can arrive more than once; de-duplicate on the webhook-id header.
Errors
| Exception | When | What to do |
|---|---|---|
InvalidRequest |
Bad option, refused prompt, file too large | Fix the input |
AuthError |
Missing or invalid key | Check the key |
QuotaError |
Out of credits, free tier limit, busy |
Top up, add a key, or wait (wait_for_slot=True waits for a free slot) |
ServiceError |
Upstream model or network failure | Already retried twice with the same request key; try again later |
All carry .code (stable string), .message and .status. Failed runs are refunded automatically.
Settings
TANVO_API_KEY |
API key (or Client(api_key=...)) |
TANVO_BASE_URL |
Another deployment (default https://tanvo.ai) |
Also from Tanvo
- tanvo-mcp: the same apps and models inside Claude, Cursor and other MCP clients.
- tanvo-js: the TypeScript / JavaScript client.
License
MIT
Metadata
Release files for tanvo 0.1.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 | |
|---|---|---|---|
| tanvo-0.1.0.tar.gz | 16.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tanvo-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.5 kB
Release files / tanvo-0.1.0.tar.gz
| Download URL | tanvo-0.1.0.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3aad12c6c69077e187f6b17ae687534b99412459a198f2dfc5f67be5d842aef7
|
|
BLAKE2b-256 checksum How to use checksums |
2b8b404163b2a1c295f6c2019a5c7f2693f108e5efbaa1b9b928d7ecc59966e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency logRelease files / tanvo-0.1.0-py3-none-any.whl
| Download URL | tanvo-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce0a1cd18b08cb24c89e92431e91bd3014c6046134ce9a38009122fac7f9e080
|
|
BLAKE2b-256 checksum How to use checksums |
fdd3657d812c51449881627aeb6e00798eb81ba7013f574d63f63903cd4f20a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.
Transparency log