# FLUX.2 Klein 4B > Very fast image generation and editing model. 4 steps distilled, sub-second inference for production and near real-time applications. - **Provider**: replicate - **Model ID**: black-forest-labs/flux-2-klein-4b - **Category**: image_generation - **Credits**: 2 per request - **Pricing Type**: input_based ## API Endpoint Base URL: https://api.core.today/v1 ### Create Prediction POST /predictions ### Get Status GET /predictions/{job_id} ### Cancel DELETE /predictions/{job_id} ## Authentication Header: `X-API-Key: YOUR_API_KEY` ## Input Parameters - `aspect_ratio` (string, optional): Aspect ratio for the generated image. Use 'match_input_image' to match the aspect ratio of the first input image. (Default: `1:1`; Options: `1:1`, `16:9`, `9:16`, `3:2`, `2:3`, `4:3`, `3:4`, `5:4`, `4:5`, `21:9`, `9:21`, `match_input_image`) - `go_fast` (boolean, optional): Run faster predictions with additional optimizations. (Default: `False`) - `output_format` (string, optional): Format of the output images (Default: `jpg`; Options: `webp`, `jpg`, `png`) - `output_quality` (integer, optional): Quality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs. (Default: `95`; Range: min: 0, max: 100) - `seed` (integer, optional): Random seed. Set for reproducible generation - `prompt` (string, **required**): Text prompt for image generation. - `output_megapixels` (string, optional): Resolution of the output image in megapixels (Default: `1`; Options: `0.25`, `0.5`, `1`, `2`, `4`) - `disable_safety_checker` (boolean, optional): Disable safety checker for generated images. (Default: `False`) - `images` (array, optional): List of input images for image-to-image generation. Maximum 5 images. Must be jpeg, png, gif, or webp. (Default: `[]`) ## Example Request ```json { "model": "black-forest-labs/flux-2-klein-4b", "input": { "aspect_ratio": "1:1", "images": [], "output_megapixels": "1", "output_format": "jpg", "go_fast": false, "prompt": "A surreal underwater or cosmic garden scene with bioluminescent flora against a deep navy blue to black background. With large white text in the center \"FLUX.2 [klein] 4B\"", "output_quality": 95 } } ``` ## Response Format ```json { "job_id": "abc123", "status": "pending", "provider": "replicate", "model": "black-forest-labs/flux-schnell", "created_at": "2026-01-01T00:00:00Z", "result": null, "error": null } ``` Status values: `pending`, `processing`, `completed`, `failed`, `cancelled` ## Usage Flow 1. POST /predictions with model and input → receive job_id 2. Poll GET /predictions/{job_id} until status is `completed` or `failed` 3. Result contains output URL(s) or data ## Output Type url ## Tags flux, flux-2, text-to-image, image-generation, image-editing, fast-generation, black-forest-labs ## Documentation https://replicate.com/black-forest-labs/flux-2-klein-4b