Flux Kontext
In-context image editing — local edits, style transfer, and character-consistent generation.
# Works with Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents
npx skills add runapi-ai/flux-kontext -g
Install the Flux Kontext skill for me: 1. Clone https://github.com/runapi-ai/flux-kontext 2. Copy the skills/flux-kontext/ directory into your user-level skills directory (e.g. ~/.claude/skills/ for Claude Code, ~/.codex/skills/ for Codex). 3. Verify that SKILL.md is present. 4. Confirm the install path when done.
Flux Kontext is Black Forest Labs' in-context image editing model that applies targeted edits while preserving style, character identity, and scene composition. It excels at style transfer and maintaining visual consistency.
- Installable agent skill
- Unified API key
- SDK examples included
- 失敗した生成は課金されません
バリアント
Use this model from your agent
# User prompt to the agent
"Edit this product photo: change the background to a tropical beach while keeping the product exactly the same."
// Code generated by the agent via @runapi.ai/flux-kontext
import { FluxKontextClient } from '@runapi.ai/flux-kontext';
const client = new FluxKontextClient();
const result = await client.textToImage.run({
model: 'flux-kontext-max',
prompt: 'Edit this product photo: change the background to a tropical beach while keeping the product exactly the same.',
});
How to call this model
Install the skill
Add the model skill to your agent or install the SDK package.
Authenticate once
Use your RunAPI key for every supported model.
Send a request
Use the unified schema for the endpoint you need.
Receive output
Poll by task ID or handle the callback when the generation completes.
SDK quickstart
curl -X POST https://runapi.ai/api/v1/flux_kontext/text_to_image \
-H "Authorization: Bearer $RUNAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-kontext-max",
"prompt": "Edit this product photo: change the background to a tropical beach while keeping the product exactly the same."
}'
import { FluxKontextClient } from "@runapi.ai/flux-kontext";
const client = new FluxKontextClient();
const result = await client.textToImage.run({
model: "flux-kontext-max",
prompt: "Edit this product photo: change the background to a tropical beach while keeping the product exactly the same.",
});
require "runapi/flux_kontext"
client = RunApi::FluxKontext::Client.new
result = client.text_to_image.run(
model: "flux-kontext-max",
prompt: "Edit this product photo: change the background to a tropical beach while keeping the product exactly the same."
)
Where Flux Kontext fits
Flux Kontext is Black Forest Labs' context-aware editing model, built on the 12B-parameter Flux architecture. Through RunAPI, both Kontext Pro and Max variants share a single key.
Why use Flux Kontext through RunAPI
One API key
Use the same credentials across models and providers.
Agent-ready
Installable skills include docs and schema for tool calls.
Predictable billing
Usage-based pricing is visible before you call.
Frequently asked questions
How do I call this model?
Use the RunAPI SDK, CLI, or REST endpoint shown on this page.
Do failed generations cost money?
失敗した生成は課金されません
Can agents use it directly?
Yes. Install the model skill and your agent gets the docs, schema, and examples.