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 on paid plans
Subscription or usage-based
Auto-scaling

Trusted by teams at

meta
nba
loreal
puma
cisco
deel
shopify
decathlon
dallas-mavericks
pittsburgh-pirates
tala
dyson
dazn
wsc-sports

Everything You Need to Ship AI Image Editor

Combine masks, prompts, and model selection for Photoshop-grade flexibility 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 assets, optionally masks, and call /v1/ai-image-editor with model and prompt fields.
3
Get Results & Scale
Receive the output via response or webhook. Deploy to production — infrastructure scales automatically.
Get Started Free

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(
    name="Edit",
    image_count=1,
    assets={"image_file_paths": ["/path/to/photo.png"]},
    style={"prompt": "Replace background with sunny beach"},
)
API Docs

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.

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.

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.
Generate bold, high-impact images with Nano Banana Pro — a fast AI image generator for stylized art, cinematic scenes, and eye-catching social content. Write a prompt and create standout visuals in seconds.

Nano Banana Pro

Generate bold, high-impact images with Nano Banana Pro — a fast AI image generator for stylized art, cinematic scenes, and eye-catching social content. Write a prompt and create standout visuals in seconds.
Edit and generate images with Flux 2 Klein — Black Forest Labs' fast model for sub-second edits and low-cost iteration.

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.
Edit and generate images with GPT Image 2 — OpenAI's image model for natural-language edits and high-resolution output up to 4K.

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.
Create sharp, photo-realistic images with Seedream — a high-quality AI image generator built for detailed prompts, product-style visuals, and polished marketing creatives. Great prompt adherence and crisp detail.

Seedream

Create sharp, photo-realistic images with Seedream — a high-quality AI image generator built for detailed prompts, product-style visuals, and polished marketing creatives. Great prompt adherence and crisp detail.
Generate expressive, stylized images with Nano Banana — a fast AI image generator for bold compositions, vibrant scenes, and creative prompts. Ideal for social content and concept art.

Nano Banana

Generate expressive, stylized images with Nano Banana — a fast AI image generator for bold compositions, vibrant scenes, and creative prompts. Ideal for social content and concept art.
Create detailed, high-fidelity visuals with Nano Banana 2 — an upgraded AI image generator with improved realism, sharper detail, and stronger prompt adherence for complex subjects.

Nano Banana 2

Create detailed, high-fidelity visuals with Nano Banana 2 — an upgraded AI image generator with improved realism, sharper detail, and stronger prompt adherence for complex subjects.
Produce rich, photo-realistic images with Seedream 4 — a high-quality AI image generator optimized for detailed prompts, product visuals, and polished marketing creatives.

Seedream 4

Produce rich, photo-realistic images with Seedream 4 — a high-quality AI image generator optimized for detailed prompts, product visuals, and polished marketing creatives.

Estimate Your API Costs

Build with model-specific APIs for video, image generation, and image editing. Compare inputs, examples, and capabilities across Magic Hour's supported models.
Images Per Month
10 images
images
Recommended plan
Creator Annual
$120
/year
120,000 credits per year
Up to 1.4 hours of video
Up to 12,000 images
PRO ANNUAL covers your usage
Estimated usage
5,000credits / month
Included
25,000credits / month
Remaining headroom
20,000credits / month
TOTAL BILL
$300
/year

AI Image Editor API Pricing

Subscription plans for standard usage.

Prefer usage-based pricing?

Email us or message us in Intercom and we will set up your usage-based pricing.

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.

Depends on the operation—check docs for mask_file_path and automatic segmentation support.

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 $15/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. You can also contact us to set up usage-based (pay-as-you-go) pricing. 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.

Yes. Every new Magic Hour account gets free credits on signup that work across all API endpoints. No credit card is required to get started. Paid plans unlock higher credit limits, higher concurrency, and commercial use rights.

Start Building with the Magic Hour AI Image Editor API

Free credits on signup. SDKs for Python, Node.js, Go, and Rust. Production-ready in minutes.