AI Image Editor API for Developers
AI Image Editor API
Describe the change you want—remove objects, swap colors, or restyle scenes—without manual masking labor.
Free credits on signup
Transparent per-credit pricing
No watermarks with paid plans or credit packs
Subscriptions, credit packs, or usage-based billing
Auto-scaling
Trusted by teams at
Everything You Need to Ship AI Image Editor
Combine source images, edit prompts, and model selection via HTTPS.
Prompt-Driven Edits
Replace skies, outfits, or props using language instead of painstaking selections.
Creative Iteration
Great for storyboard revisions, ad variant factories, and rapid prototyping.
Guided Transformations
Pair reference images with prompts for controlled restyling.
Fast Processing
Iterate quickly in collaborative design sessions or automated asset pipelines.
Auto-Scaling Infrastructure
Burst through thousands of creative requests during campaign launches.
Commercial-Ready
Ship edits inside paid creative suites with dependable SLAs on higher tiers.
Integrate in 3 Steps
Bring generative Photoshop-style actions to your backend.
1
Get Your API Key
Sign up free and generate an API key from the Developer dashboard. You get free credits to start.
2
Send Image & Edit Prompt
Upload source images, then call /v1/ai-image-editor with assets.image_file_paths, style.prompt, and an optional model.
3
Get Results & Scale
Receive the output via response or webhook. Deploy to production — infrastructure scales automatically.
Code Examples
AI Image Editor in a few lines of code. Install an SDK or use the REST API directly.
from magic_hour import Client
from os import getenv
client = Client(token=getenv("MAGIC_HOUR_API_KEY"))
res = client.v1.ai_image_editor.generate(
assets={"image_file_paths": ["/path/to/1234.png"]},
style={"prompt": "Give me sunglasses"},
name="Ai Image Editor image",
wait_for_completion=True,
download_outputs=True,
download_directory="."
)Edit Images with Leading AI Models
Edit images using Magic Hour's supported image editing models. View each model's API page for inputs, examples, and usage details.

Qwen Edit
Edit images with Qwen Edit — a fast AI image editor for prompt-based inpainting, object removal, background changes, and precise photo edits. Upload an image, describe the change, and get clean, natural results.

Nano Banana Pro
Edit an uploaded image with Nano Banana Pro. Describe changes to objects, backgrounds, lighting, or style for product photos and creative visuals.

Flux 2 Klein
Edit and generate images with Flux 2 Klein — Black Forest Labs' fast model in Magic Hour for sub-second prompt-led edits, quick generations, and low-cost iteration at 640px through 2K.

GPT Image 2
Edit and generate images with GPT Image 2 — OpenAI's image model in Magic Hour for natural-language editing, strict prompt adherence, and premium-resolution output up to 4K.

Seedream
Edit photos with Seedream using text prompts and image references. Refine backgrounds, lighting, and details for portraits, product photos, and marketing assets.

Nano Banana
Use Nano Banana to edit photos with natural-language prompts. Change objects, backgrounds, or visual style and compare the result with your source image.

Nano Banana 2
Edit images with Nano Banana 2. Use a prompt to retouch a photo, replace a background, or explore a new look from your uploaded image.

Seedream 4
Use Seedream 4 for prompt-based photo editing. Upload an image and describe changes to its setting, appearance, or details.
Estimate Your API Costs
Every generation uses credits. Prepay with a subscription or one-time credit packs, or request usage-based billing for monthly invoicing and volume discounts.
Pricing tier options
USD subscription prices. Image allowances use Z-Image Turbo at 1K (5 credits/image); video allowances use LTX-2.5 at 480p. These reference allowances do not describe every endpoint. Choose your tool, model, and settings below for its estimate.
Images Per Month
10 images
images
Recommended plan
Creator Yearly
$144
/year
144,000 credits per year
Up to 1.7 hours of video
Up to 28,800 images
Selected plan: Pro Yearly
PRO YEARLY covers your usage
- 5,000credits / month
- 25,000credits / month
- 20,000credits / month
Estimated usage
Included
Remaining headroom
TOTAL BILL
$300
/year
SDKs for Every Stack
Official open-source SDKs with full TypeScript/type support. Install and start building.
AI Image Editor API Pricing
Subscription plans for standard usage.
Need usage-based billing?
Email us or message us in Intercom for monthly billing with graduated volume discounts.
Built for Builders
See how developers use the AI Image Editor API to power real products.
Ad Variant Factories
Swap backgrounds and props per audience segment automatically.
Catalog Cleanup
Remove distractions or update sets without reshooting products.
Previs & Storyboards
Iterate frames faster than manual paint-overs.
Creator Suites
Offer magic-edit buttons in browser tools.
Games
Let modders retexture screenshots for community events.
Education
Annotate instructional diagrams with generative fixes.
Try before integrating
Try AI Image Editor Free — No Code Required
Test quality first with the free tool, then plug the same output quality into your app with the API when you are ready.
AI Image Editor API — Frequently Asked Questions
Editors start from an existing photo and apply localized or global changes, while generators synthesize from scratch.
No. Provide source images in assets.image_file_paths and describe your edit in style.prompt. This endpoint does not accept a separate mask_file_path.
Pass supported model identifiers to balance quality, speed, and credit usage.
Yes. Pipe outputs into subsequent jobs to build multi-step creative workflows.
Python and Node expose ai_image_editor / aiImageEditor.
Validation errors return 4xx with descriptive messages; retry with adjusted prompts.
Review Magic Hour security docs for retention, encryption, and compliance posture.
docs.magichour.ai includes JSON samples for common edit scenarios.
Magic Hour offers subscription plans starting at $19/month (Creator), $39/month (Pro), and $99/month (Business), each including a monthly credit allotment. Credits are consumed per generation based on output length and model. One-time credit packs add credits without a subscription. Usage-based billing with graduated volume discounts is available by request. A free tier with credits is available on signup — no credit card required.
Sign up at magichour.ai/developer — no credit card required. You'll receive free credits and an API key immediately. The key works across all Magic Hour API endpoints including AI Image Editor. Start making API calls in minutes using our Python, Node.js, Go, or Rust SDKs.
New accounts get free credits to test supported free-tier API endpoints. Some models and resolutions require a paid plan; check the current endpoint page and pricing before integrating.