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 tokens
- $1
- Output / image
- $0.012
- Cache read / 1M tokens
- —
- Context window
- 128K tokens
Privacy & execution
This model supports private inference inside a hardware-isolated Trusted Execution Environment (TEE), protecting data while it is processed. HTTPS protects data in transit; client-to-model end-to-end encryption depends on the model and integration.
Attestation provides cryptographic evidence of the execution environment’s identity and configuration. Where response signatures are available, you can also verify the integrity of the request and response.
Verification documentationMake your first request
Call /v1/images/generations over HTTPS.
Get an API key and replace the API key placeholder below.
Use the API
Use the dedicated endpoint for this model’s modality.
Example
FLUX.2-klein-4B API FAQ
- How much does the FLUX.2-klein-4B API cost?
- $0.012 per generated image on NEAR AI Cloud.
- What is the context window of FLUX.2-klein-4B?
- 128K tokens.
- How do I call the FLUX.2-klein-4B API?
- Create an API key on NEAR AI Cloud, then send requests to https://cloud-api.near.ai/v1/images/generations with the model ID black-forest-labs/FLUX.2-klein-4B. The endpoint is OpenAI-compatible, so OpenAI SDKs work by setting the base URL to https://cloud-api.near.ai/v1.
- Is FLUX.2-klein-4B private on NEAR AI?
- Yes. It runs inside a hardware-isolated Trusted Execution Environment (TEE) on NEAR AI's infrastructure, which protects data while it is processed. Attestation provides cryptographic evidence of the execution environment, which you can verify.