FLUX.2-klein-4B · nearai
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. Built for applications that require real-time image generation without sacrificing quality.
Input, $/1M $0.012 / image
Output, $/1M $1.00
Price, $ $0.012 / image
Price alerts
API
OpenAI-compatible API: the official OpenAI SDKs work with this base URL. Replace YOUR_API_KEY with your key from the provider.
| API base URL | |
|---|---|
| Endpoint | |
| Model id | |
curl
curl https://cloud-api.near.ai/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "black-forest-labs/FLUX.2-klein-4B", "prompt": "a lighthouse at sunset", "n": 1, "size": "1024x1024"}'Python
import requests
r = requests.post(
"https://cloud-api.near.ai/v1/images/generations",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"model": "black-forest-labs/FLUX.2-klein-4B",
"prompt": "a lighthouse at sunset",
"n": 1,
"size": "1024x1024"
},
)
print(r.json())JavaScript
const r = await fetch("https://cloud-api.near.ai/v1/images/generations", {
method: "POST",
headers: {Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json"},
body: JSON.stringify({
"model": "black-forest-labs/FLUX.2-klein-4B",
"prompt": "a lighthouse at sunset",
"n": 1,
"size": "1024x1024"
}),
});
console.log(await r.json());Request (JSON)
{
"model": "black-forest-labs/FLUX.2-klein-4B",
"prompt": "a lighthouse at sunset",
"n": 1,
"size": "1024x1024"
}Response (JSON)
{
"created": 1760000000,
"data": [
{
"url": "https://...",
"b64_json": null
}
]
}The address is taken from the provider's model list; check it against the provider's documentation.
Source: AI Rate Card, https://airatecard.com/en/c/offer%3Anearai%7Cblack-forest-labs/FLUX.2-klein-4B, prices checked 2026-11-04; seller's page: https://near.ai/models/black-forest-labs/FLUX.2-klein-4B
Technical details
ID: offer:nearai|black-forest-labs/FLUX.2-klein-4B