Use Flux 2 in OpenClaw.
Flux 2 by Black Forest Labs offers two quality tiers — Pro for fast, affordable generation at 5 cents per image, and Flex for higher-fidelity output. Both support text-to-image and multi-source remix at 1k or 2k resolution. OpenClaw agents call it through the same RunAPI key used for chat.
Use RunAPI to generate an image with Flux 2 Pro.
Requirements:
- Call the RunAPI text_to_image endpoint at https://runapi.ai/v1/text_to_image
- Set model to "flux-2-pro-text-to-image"
- Use the RUNAPI_API_KEY environment variable for authorization
- Optionally set output_resolution to "1k" or "2k" and aspect_ratio to control dimensions
- The response is async — poll the task status endpoint until the task completes, then retrieve the image URL
curl -X POST https://runapi.ai/v1/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-2-pro-text-to-image",
"prompt": "a ceramic vase with dried flowers on a linen tablecloth, natural window light, 35mm film grain",
"aspect_ratio": "3:4",
"output_resolution": "2k"
}'
{
"task_id": "tsk_abc123",
"status": "pending",
"model": "flux-2-pro-text-to-image"
}
Use Flux 2 in OpenClaw in three steps
Configure RunAPI
Set the RUNAPI_API_KEY environment variable. If you already configured RunAPI as an OpenClaw provider for chat, the same key works for Flux 2 image generation — no extra setup needed.
export RUNAPI_API_KEY=runapi_xxx
Call Flux 2
Send a POST request to the text_to_image endpoint with model set to flux-2-pro-text-to-image. Include a prompt, and optionally set aspect_ratio (1:1, 4:3, 16:9, etc.) and output_resolution (1k or 2k). For multi-source remixing, use the remix_image endpoint with source_image_urls instead.
text_to_image
Get the result
The endpoint returns a task ID. Poll the task status endpoint until the status changes to completed, then retrieve the generated image URL from the response. RunAPI SDKs and the CLI handle polling automatically.
task_id: tsk_abc123
Flux 2 API parameters
| Parameter | Type | Description |
|---|---|---|
model |
string |
Required. flux-2-pro-text-to-image, flux-2-flex-text-to-image, flux-2-pro-remix-image, or flux-2-flex-remix-image. |
prompt |
string |
Text description of the image to generate. |
aspect_ratio |
string |
Optional. Output aspect ratio: 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, or 2:3. Remix endpoints also accept auto. |
output_resolution |
string |
Optional. 1k (default) or 2k. Higher resolution costs more per image. |
source_image_urls |
array |
Required for remix_image. Array of source image URLs to blend or transform. |
callback_url |
string |
Optional. Webhook URL for async completion notification. |
What is Flux 2 on OpenClaw?
Flux 2 by Black Forest Labs is the production-grade image model that users say "beats Midjourney on photorealism" with material fidelity that actually passes for real photography. It ships with multi-reference conditioning and 4-megapixel output, so you get brand-consistent results without fine-tuning. OpenClaw agents call it through the RunAPI text_to_image endpoint with the same API key used for chat.
Flux 2 use cases
E-commerce product photography
Generate product photos and background swaps that look like real studio shots, replacing manual photography for catalog pages and listings.
Ad localization across markets
Produce localized ad visuals for 30+ markets from the same prompt structure, swapping text and cultural references while keeping brand consistency.
Magazine covers and editorial images
Create magazine-quality covers with on-image text rendering, where the typography needs to be part of the generated image rather than composited afterward.
Flux 2 + OpenClaw questions
Pro is the faster, more affordable tier at 5 cents per 1k image. Flex produces higher-fidelity output at 14 cents per 1k image. Both share the same API parameters and support text_to_image and remix_image endpoints.
Users report Flux 2 matches or beats Midjourney on photorealism and material fidelity, with the advantage that it runs through a standard API endpoint rather than a Discord bot. It has caught up on text rendering too, though Ideogram V3 still leads on small-point typography.
Yes. Each variant bills per image with resolution-based pricing. For example, Flux 2 Pro costs 5 cents at 1k and 7 cents at 2k. Flux 2 Flex costs 14 cents at 1k and 24 cents at 2k. Check the RunAPI pricing page for current rates.
Flux Kontext specializes in text-guided editing and character consistency with a single input image. Flux 2 focuses on text-to-image generation and multi-source remixing with Pro/Flex quality tiers and selectable output resolution. Both are by Black Forest Labs and available through the same RunAPI key.
Async. The API returns a task ID immediately. Poll the task status endpoint or set a callback_url webhook to receive the completed image URL. RunAPI SDKs and the CLI handle polling automatically.
OpenClaw general setup
Not configured yet? Start with the RunAPI setup guide for OpenClaw.
OpenClaw setup guide →Try Flux 2 in OpenClaw today.
Get a free RunAPI key, paste the prompt into OpenClaw, and start generating images with Flux 2 Pro or Flex.