AI Image Generator API for Developers

AI Image Generator API

Create illustrations, photos, and concept art from prompts—tuned for apps that need many variants fast.

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 Generator

Model selection, resolutions, and aspect ratios to cover marketing, gaming, and design workflows.

Prompt-to-Image
Describe a scene; receive high-resolution stills ready for download or further editing.
Creative Controls
Pick models and aspect ratios aligned to ads, icons, storyboards, and UI art.
Variant Generation
Great for brainstorming, A/B hero images, and automated template fills.
Fast Generation
Low-latency inference tiers for interactive experiences and batch overnight jobs alike.
Auto-Scaling Infrastructure
No need to deploy diffusion servers—Magic Hour scales with your MAU.
Commercial-Ready
Use paid plans to ship customer-facing generation with appropriate licensing.

Integrate in 3 Steps

Add generative stills to any product surface.

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 Prompts & Parameters
Call /v1/ai-image-generator with prompt text, model, resolution, and aspect ratio 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 Generator 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_generator.generate(
    name="Concept Art",
    image_count=1,
    aspect_ratio="16:9",
    style={
        "prompt": "Futuristic city at dusk, cinematic lighting",
        "tool": "general",
    },
)
API Docs

Generate Images with Leading AI Models

Generate images from text using Magic Hour's supported image models. View each model's API page for inputs, examples, and usage details.

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.
Generate and edit images with Flux 2 Klein — Black Forest Labs' fast model for sub-second generation, prompt-led edits, and low-cost iteration.

Flux 2 Klein

Generate and edit images with Flux 2 Klein — Black Forest Labs' fast model in Magic Hour for sub-second text-to-image runs, prompt-led edits, and low-cost iteration at 640px through 2K.
Create and edit images with GPT Image 2 — OpenAI's image model in Magic Hour for strict prompt adherence, natural-language edits, and high-resolution output up to 4K.

GPT Image 2

Create and edit images with GPT Image 2 — OpenAI's image model in Magic Hour for strict prompt adherence, natural-language edits, marketing comps, and detail-heavy visuals up to 4K.
Make images at high speed with Z-Image Turbo — a turbo AI image generator for rapid iterations, bulk variations, and quick concepting. Ideal when you want volume without long wait times.

Z-Image Turbo

Make images at high speed with Z-Image Turbo — a turbo AI image generator for rapid iterations, bulk variations, and quick concepting. Ideal when you want volume without long wait times.
Try Flux Schnell — a free, ultra-fast AI image generator for quick drafts, style exploration, and rapid creative experiments. Type a prompt, generate multiple options, and refine fast.

Flux Schnell

Try Flux Schnell — a free, ultra-fast AI image generator for quick drafts, style exploration, and rapid creative experiments. Type a prompt, generate multiple options, and refine fast.
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
2,500credits / month
Included
25,000credits / month
Remaining headroom
22,500credits / month
TOTAL BILL
$300
/year

AI Image Generator 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 Generator API to power real products.

Marketing & Ads
Generate endless hooks, backgrounds, and product scenes for paid social.
E-Commerce
Illustrate categories, lookbooks, and email hero art without photoshoots.
Games & Apps
Prototype icons, splash art, and NPC concepts directly from design tools.
Entertainment
Storyboard frames and poster explorations for pitches.
Studios
Augment art departments with AI-first mood boards.
Education
Visualize lesson prompts for interactive courseware.
Try before integrating

Try AI Image Generator 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 Generator API — Frequently Asked Questions

It creates raster images from text prompts with selectable models and output geometry.

Pass the model field documented in the API reference; defaults exist for quick starts.

Yes. Use supported aspect ratio enums to target square, portrait, or landscape outputs.

Fair-use and plan-based limits apply; enterprise customers receive higher ceilings.

Magic Hour applies policy filters—see acceptable use documentation for details.

Python and Node SDKs wrap ai_image_generator / aiImageGenerator.

Poll image project endpoints or rely on webhooks when configured.

docs.magichour.ai includes sample JSON bodies and response shapes.

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 Generator. 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 Generator API

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