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 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 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(
    image_count=1,
    style={"prompt": "Cool image", "tool": "ai-anime-generator"},
    aspect_ratio="1:1",
    model="z-image-turbo",
    name="My Ai Image image",
    resolution="640px",
    wait_for_completion=True,
    download_outputs=True,
    download_directory="."
)
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.

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.
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
$180
/year
180,000 credits per year
Up to 2.1 hours of video
Up to 36,000 images
Selected plan: Creator Yearly
CREATOR YEARLY covers your usage
Estimated usage
2,500credits / month
Included
15,000credits / month
Remaining headroom
12,500credits / month
TOTAL BILL
$180
/year

AI Image Generator 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 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 $24/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 Generator. 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.

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.