FLUX 2 Klein API for Developers
FLUX 2 Klein API
Generate and edit AI images with FLUX 2 Klein via API. Sub-second generation speed with strong quality — supporting both text-to-image and image editing workflows.
Free to start
No watermarks on paid plans
Subscription or usage-based
Auto-scaling

Character illustration

Surreal still life

Fashion editorial

Anime character

Impressionist painting

Fantasy creature

Cosmic abstract

Surreal wildlife

Street portrait

Outdoor portrait

Pop surrealism
Trusted by teams at














Everything You Need to Ship FLUX 2 Klein
Sub-second image generation and editing with a versatile, fast model.
Sub-Second Generation
One of the fastest image models available — generate and iterate at near-instant speeds.
Text-to-Image & Editing
Supports both text-to-image generation and instruction-based image editing in a single model.
Free Tier Available
Available on the free plan at 640px — test quality before upgrading.
Fast Single-Image Generation
Sub-second output per request — iterate quickly on prompts with separate API calls.
Auto-Scaling Infrastructure
Scales compute to match demand automatically. No GPU provisioning or cold starts.
Commercial-Ready
Paid plans support non-watermarked outputs for commercial delivery.
Integrate in 3 Steps
Add fast AI image generation and editing to your app in minutes.
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 Your Request
Call /v1/ai-image-generator with a text prompt for text-to-image (one image per request). For editing, call /v1/ai-image-editor with reference images in assets.image_file_paths.
3
Get Results & Scale
Receive generated or edited images via response. Deploy to production — infrastructure scales automatically.
Code Examples
FLUX 2 Klein 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("API_TOKEN"))
res = client.v1.ai_image_generator.generate(
image_count=1,
style={
"prompt": "A cozy coffee shop interior with warm lighting and wooden furniture",
"tool": "general",
},
aspect_ratio="16:9",
model="flux-2-klein",
name="FLUX 2 Klein",
resolution="1k",
)SDKs for Every Stack
Official open-source SDKs with full TypeScript/type support. Install and start building.
FLUX 2 Klein 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.
API Calculator
Use our calculator to estimate your API costs.
Tier
Estimated monthly cost
$0.3600
Built for Builders
See how developers use the FLUX 2 Klein API to power real products.
Rapid Iteration
Generate dozens of prompt variations in seconds to find the right visual direction.
Image Editing Workflows
Edit existing images with natural-language instructions — change styles, objects, or backgrounds.
Social Media Content
Produce high-volume social media assets quickly with consistent quality.
Marketing Prototypes
Generate draft creative concepts for stakeholder review at scale.
Game Asset Concepts
Create concept art and visual references rapidly during early development.
E-Commerce Imagery
Generate product images and lifestyle shots quickly for catalog and ads.
Try before integrating
Try FLUX 2 Klein 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.
FLUX 2 Klein API — Frequently Asked Questions
Magic Hour's FLUX 2 Klein API lets developers generate and edit AI images using Black Forest Labs' FLUX 2 Klein model via REST API with SDKs for Python, Node.js, Go, and Rust.
FLUX 2 Klein is designed for sub-second generation — one of the fastest image models available for rapid drafts and real-time applications.
Yes. Use /v1/ai-image-generator for text-to-image, or /v1/ai-image-editor with reference images for instruction-based edits.
One. FLUX 2 Klein supports a single image per request — iterate quickly by sending separate API calls.
FLUX 2 Klein is available on the free plan at 640px resolution. Higher resolutions require a paid plan.
640px, 1K, and 2K resolutions in a wide range of aspect ratios.
FLUX 2 Klein costs 5 credits per image at 640px and 1K, and 10 credits per image at 2K. It is one of the most affordable models on Magic Hour.