Skip to main content

GenMagic for Python and the command line

One API key and one pay-as-you-go balance for 460+ AI models: images, video with sound, speech, music and text. Veo, Kling, Seedance, Wan, Hailuo, Runway, Nano Banana, GPT Image, FLUX, Seedream and more, each with its price shown before you run it.

pip install genmagic
export GENMAGIC_API_KEY=...   # free key, one minute: https://genmagic.co/get-api-key?utm_source=pypi&utm_medium=readme

No dependencies. Python 3.9 or newer.

Images

from genmagic import GenMagic

gm = GenMagic()
image = gm.image("A red fox in snow, 35mm photo", model="google/gemini-nano-banana-2.1", size="1792x1024")
print(image.url, image.cost_cents)
image.save("fox.png")

Video

video starts the job and waits for the clip. Use start_video and get_video to poll yourself.

clip = gm.video("Waves at sunset, slow drone shot", model="alibaba/wan-3.0", aspect_ratio="9:16", duration=5, sound=True)
clip.save("waves.mp4")

Speech, music, text

gm.speech("Welcome to the show").save("welcome.mp3")
gm.music("Calm lo-fi beat, 80 bpm").save("track.mp3")
print(gm.chat("Write a hook for a video about foxes", model="anthropic/claude-haiku-5.5").text)

Tools for AI agents

genmagic.tools holds typed functions with docstrings, which CrewAI, Agno, Pydantic AI, smolagents, Google ADK, Strands and the OpenAI Agents SDK accept as tools:

from genmagic.tools import generate_image, generate_video, text_to_speech, list_models

agent = Agent(tools=[generate_image, generate_video, text_to_speech, list_models])

Models and prices

video_models = gm.models("video")  # needs no key
balance = gm.usage()

A refusal raises GenMagicError with status, code and GenMagic's own message (for example how to top up when the balance is too low).

Command line

genmagic image "A red fox in snow" --out fox.png
genmagic video "Waves at sunset" --aspect 9:16 --duration 5 --out waves.mp4
genmagic speech "Welcome to the show" --out welcome.mp3
genmagic models video
genmagic balance

Also from GenMagic

The same key works in n8n, Zapier, Make, ComfyUI and through MCP in Claude, ChatGPT and Cursor. The REST API is OpenAI-compatible: reference.

Metadata

Release files for genmagic 0.1.0

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

Source distribution (sdist)

Source distribution for genmagic 0.1.0
File Size Uploaded Provenance Actions
genmagic-0.1.0.tar.gz 9.2 kB Without provenance Details for genmagic-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.4 kB

Release files / genmagic-0.1.0.tar.gz

Download URL genmagic-0.1.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c67ead77ac3ceb7f79aad8863e8eaba4b9d7db8327e21f7f8b873828f6ee080a
BLAKE2b-256 checksum
How to use checksums
c639b8ea67c93e6dc5a5790f8b8f21e6305ee3e9b3abc768110f26e29b793044
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / genmagic-0.1.0-py3-none-any.whl

Download URL genmagic-0.1.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f60a5a1392193c3a8fd2529c2460bec55fb46b1ce620d094f5362ad84dc9cfd8
BLAKE2b-256 checksum
How to use checksums
e620f46c45a28fb236626e0bd6ec5ad3f457326f0da9a778432fca68094b7bea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for genmagic 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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