
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.
Template










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.
POST /v1/generate with Authorization: Bearer YOUR_API_KEY.| 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.
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 |
| 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 |
Errors are returned in a unified JSON format:
{
"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 |
| 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 |
Run models at scale with our fully managed GPU infrastructure, delivering enterprise-grade uptime at the industry's best rates.