• featured
flux2-klein-4b Robot

FLUX[klein]

The FLUX.2 [klein] model family are our fastest image models to date. FLUX.2 [klein] unifies generation and editing in a single compact architecture, delivering state-of-the-art quality with end-to-end inference in as low as under a second.

Starting from $0.003 per image

Input

quick start
The Neon Monk
Desert Solitude
The Lunar Moth
Translucent Ocean
The Midnight Witness
World Tree Portal
The Golden Veil
The Floating Museum
Micro Medieval Battle
The Porcelain Android

Output

Klein

Klein provides synchronous image generation and editing from text prompts and reference images. A single endpoint handles all workflows — the API automatically selects the right one based on the number of images you provide.

Quick Start

  1. Get an API key.
  2. Submit a generation request: POST /v1/generate with Authorization: Bearer YOUR_API_KEY.
  3. Receive the generated image as raw PNG bytes in the response body.

Endpoint

Method Path Description
POST /v1/generate Generate or edit an image (workflow auto-selected by image count)

See API: Image Generation for full endpoint documentation.

Workflow Selection

The workflow is determined by the number of reference images provided:

Reference Images Workflow Description
0 Text-to-image Generates from text prompt only
1 Image-to-image Edits a single reference image
2–4 Multi-reference Generates using multiple reference images

Parameters

Parameter Required Default Description
prompt Yes - Text description of the image to generate
model No flux2-klein-4b Model identifier. Use flux2-klein-4b
images No [] Uploaded image files (priority over image_uris)
image_uris No - JSON array of URLs or base64 data URIs
aspect_ratio No landscape Output aspect ratio

Error Responses

Errors are returned in a unified JSON format:

json Copy
{
  "detail": "Error message description"
}
Status Code Description
401 Authentication failed due to a missing or invalid API key
422 Request parameters failed validation
504 Generation exceeded the allowed time limit
500 Unexpected server error

Limits

Limit Value
Maximum Reference Images 4

Available aspect ratios and their corresponding resolutions:

Aspect Ratio Resolution
square 1024 x 1024
landscape 1344 x 768
portrait 768 x 1344
photo 1248 x 832
photo_v 832 x 1248
standard 1184 x 896
standard_v 896 x 1184
wide 1568 x 672

Unlock the most affordable AI hosting

Run models at scale with our fully managed GPU infrastructure, delivering enterprise-grade uptime at the industry's best rates.

Contact Sales