Skip to content
No models found
OpenRouter
© 2026 OpenRouter, Inc

Product

  • Chat
  • Rankings
  • Apps
  • Models
  • Providers
  • Pricing
  • Enterprise
  • Labs

Company

  • About
  • Announcements
  • CareersHiring
  • Privacy
  • Terms of Service
  • Support
  • State of AI
  • Works With OR
  • Data

Developer

  • Documentation
  • API Reference
  • SDK
  • Status

Connect

  • Discord
  • GitHub
  • LinkedIn
  • X
  • YouTube
Favicon for black-forest-labs

Black Forest Labs: FLUX.2 Klein 4B

black-forest-labs/flux.2-klein-4b

Compare

FLUX.2 [klein] 4B is the fastest and most cost-effective model in the FLUX.2 family, optimized for high-throughput use cases while maintaining excellent image quality.

Pricing is based on the output image. The first generated megapixel is charged $0.014. Each subsequent megapixel is charged $0.001.

Modalities

Price

$0.014/megapixel

Context

41K

Weekly Tokens

381M

Released

Jan 14, 2026

OverviewProvidersPerformancePricingBenchmarksAppsActivityUptimeAPI

Sample code and API for FLUX.2 Klein 4B

OpenRouter normalizes requests and responses across providers for you.

1

Get your API key

Create an API key from your OpenRouter dashboard and set it as an environment variable:

2

Make your first request

Use black-forest-labs/flux.2-klein-4b with the OpenRouter API:

OpenRouter supports image generation models that only output images and not text. These models can create images from text prompts when you specify modalities: ["image"] in your request. The generated images are returned as base64-encoded data URLs in the assistant message. Learn more about image generation.

In the examples below, the OpenRouter-specific headers are optional. Setting them allows your app to appear on the OpenRouter leaderboards.

Using third-party SDKs

For information about using third-party SDKs and frameworks with OpenRouter, please see our frameworks documentation.

3

Enable streaming

Add "stream": true to your request body to receive responses as server-sent events:

Endpoint

Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.

POSThttps://openrouter.ai/api/v1/chat/completions
AuthorizationBearer $OPENROUTER_API_KEY
Content-Typeapplication/json
HTTP-Refereroptional — your site URL, for rankings
X-Titleoptional — your site name, for rankings
Modelblack-forest-labs/flux.2-klein-4b

Creates a streaming or non-streaming response using the OpenAI Responses API format.

Docs
POSThttps://openrouter.ai/api/v1/responses
AuthorizationBearer $OPENROUTER_API_KEY
Content-Typeapplication/json
HTTP-Refereroptional — your site URL, for rankings
X-Titleoptional — your site name, for rankings
Modelblack-forest-labs/flux.2-klein-4b

Parameters

NameTypeDefaultDescription
seedinteger—If specified, the inferencing will sample deterministically, such that repeated requests with the same seed and parameters should return the same result.