Reference01 · Background replacement
Keep the model, move to a limestone colonnade
Load the reference image and replace only the backdrop while keeping the silhouette, pose and outfit details. See the edited result in the output area.
FLUX.1 Kontext Pro is a context-aware image model for editing and text-to-image generation, with predictable per-image pricing and asynchronous task processing.

Transparent pricing with no hidden fees. Pay only for what you use.
Featured examples
Pick an example to load the model, prompt and full settings, then adjust it your way.
Reference01 · Background replacement
Load the reference image and replace only the backdrop while keeping the silhouette, pose and outfit details. See the edited result in the output area.
Reference02 · Add or remove objects
Load the reference image and remove exactly one object and its shadow, rebuilding the wood grain and notebook edge while the rest stays untouched. See the edited result in the output area.
Reference03 · Style transfer
Load the reference image and keep the street layout, doors, windows and distant harbor while switching to fine ink linework with transparent watercolor. See the edited result in the output area.
Call flux-kontext-pro with one POST request. Generation is asynchronous: submit a task, then poll the task endpoint for the image URL.
Save your APIMart key in the APIMART_API_KEY environment variable and send it as Authorization: Bearer <key> on every request.
POST /v1/images/generations with model flux-kontext-pro, your prompt and size. Add image_urls to edit up to four references. The example.com URLs are placeholders: replace them with your own publicly accessible images or Base64 data. The task ID is in data[0].task_id.
Poll GET /v1/tasks/{task_id} until status is completed, then read the image URL from data.result.images[0].url[0]. APIMart keeps results for 72 hours, so download the images you want to keep.
See the FLUX.1 Kontext API reference for every parameter, output size and response field.
curl -X POST https://api.apimart.ai/v1/images/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-kontext-pro",
"prompt": "A cozy reading nook with a green armchair, warm lamplight and rain on the window",
"size": "4:3",
"output_format": "png"
}'import os
import time
import requests
API_BASE = "https://api.apimart.ai"
headers = {"Authorization": f"Bearer {os.environ['APIMART_API_KEY']}"}
# 1. Submit the generation task
payload = {
"model": "flux-kontext-pro",
"prompt": "A cozy reading nook with a green armchair, warm lamplight and rain on the window",
"size": "4:3",
"output_format": "png"
}
resp = requests.post(f"{API_BASE}/v1/images/generations", headers=headers, json=payload, timeout=60)
resp.raise_for_status()
task_id = resp.json()["data"][0]["task_id"]
# 2. Poll the task until it finishes
for _ in range(200):
task_resp = requests.get(f"{API_BASE}/v1/tasks/{task_id}", headers=headers, timeout=30)
task_resp.raise_for_status()
task = task_resp.json()["data"]
if task["status"] == "completed":
print(task["result"]["images"][0]["url"][0])
break
if task["status"] == "failed":
raise RuntimeError(task.get("error", {}).get("message", "generation failed"))
time.sleep(3)
else:
raise TimeoutError(f"task {task_id} did not finish in time; continue GET polling with this task ID")curl -X POST https://api.apimart.ai/v1/images/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-kontext-pro",
"prompt": "Change the jacket to dark red leather and keep the person'\''s face, pose and background unchanged",
"size": "auto",
"output_format": "png",
"image_urls": [
"https://example.com/portrait.jpg"
]
}'TASK_ID="task_xxx" # replace with the task_id returned by the POST request
curl "https://api.apimart.ai/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $APIMART_API_KEY"| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Required | Default: flux-kontext-pro | Use flux-kontext-pro. |
prompt | string | Required | Default: — | Describe the image to create, or the edit to apply to the reference images. |
image_urls | string[] | Optional | Default: — | Up to 4 reference images as public URLs or Base64. Omit for text-to-image. |
size | string | Optional | Default: 1:1 | 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, 9:21 or auto. Output stays about 1 MP: width and height make the task fail, and resolution has no effect. |
output_format | string | Optional | Default: png | png, jpeg or webp. |
seed | integer | Optional | Default: — | Reuse the same seed and inputs to help reproduce a result; omit for a random seed. |
prompt_upsampling | boolean | Optional | Default: false | Let the model expand and rewrite the prompt before generation. |
safety_tolerance | integer | Optional | Default: 2 | 0 (strictest) to 6. |
nsfw_check | boolean | Optional | Default: false | Review the prompt and input images with omni-moderation-latest before submission. |
One APIMart API key calls every FLUX model below. Image models are billed per image and FLUX 3 Video per second of video.
| Model | Best for | Output |
|---|---|---|
| FLUX 3 Image API | The FLUX 3 API for images: generation and editing with up to 10 references, search grounding and output up to 4K | 768sq to 4K (about 16 MP) |
| FLUX 3 Image Klein API | Lower-cost FLUX 3 images with seed, 1–16 steps and PNG or JPEG output | 768sq to 4K (about 16 MP) |
| FLUX 3 Video API | Text to video, 1–10 keyframes, video continuation and drafts, with synced audio | HD or FHD, 5–20 s |
| FLUX.2 API | Choosing between FLUX.2 Pro, Max and Flex on one page | 1–4 MP |
| FLUX.2 Pro API | Balanced quality and cost for production images, up to 8 references | 1–4 MP |
| FLUX.2 Max API | The highest-quality FLUX.2 output, up to 8 references | 1–4 MP |
| FLUX.2 Flex API | Adjustable steps and guidance for typography and layout-heavy designs | 1–4 MP |
| FLUX.1 Kontext API | Choosing between FLUX.1 Kontext Pro and Max on one page | About 1 MP |
| FLUX.1 Kontext Pro APIThis page | Context-aware edits at a fixed price per image, up to 4 references | About 1 MP |
| FLUX.1 Kontext Max API | Higher-quality Kontext edits with stronger prompt adherence | About 1 MP |
Editing-first capabilities with predictable controls and one asynchronous workflow
Use natural-language instructions to change a background, object, color, or visual treatment while the model considers the supplied image context.
Supply as many as four public image URLs for composition and identity cues. Multi-reference input is an experimental capability.
Choose 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, or 9:21 with the size field.
Choose PNG, JPEG, or WebP output and set safety_tolerance from 0 to 6.
Submit with POST /v1/images/generations, then poll GET /v1/tasks/{task_id} until the task completes or fails.
Each request returns one image at a fixed model price regardless of aspect ratio or reference count. Failed tasks are refunded automatically.
Use flux-kontext-pro for everyday image editing and text-to-image generation. Each request produces one image, with current prices shown in this page’s pricing details.
Enable prompt_upsampling to expand instructions, or reuse a fixed seed with the same inputs to help reproduce a result.
Use a reference when visual context matters, or omit it for text-to-image generation
Create product variants, replace scenes, or modify selected objects through concise editing instructions.
Use an existing image as context to help carry character traits or visual style across new edits; results can vary by prompt and source image.
Combine cues from up to four images for compositions such as placing a subject into another scene or blending visual references.
Send a prompt without image_urls to generate a new image with Kontext Pro.
Edit a core visual into campaign or social-media variations, then select a supported aspect ratio for each placement.
Start from an existing image, refine individual elements through text instructions, and explore controlled visual directions across iterations.
Create an account, authenticate, then submit and poll one unified image task
Sign in to APIMart and fund your balance. The same balance can be used across supported models.
Create a key in the dashboard and send it as a Bearer token in the Authorization header.
POST the request to /v1/images/generations, read data[0].task_id, and poll /v1/tasks/{task_id} until completed or failed.
Model choice, inputs, controls, billing, and task behavior
FLUX.1 Kontext Pro is a context-aware image model from Black Forest Labs. It is designed primarily for image editing from text instructions and can also generate images from text alone.
flux-kontext-pro and flux-kontext-max both support text-to-image generation and reference-image editing; Max targets higher output quality. Both output approximately 1MP with up to four references. Completion time varies by task and load. See this page’s pricing details for current Pro prices.
Black Forest Labs released FLUX.1 Kontext, including the [pro] and [max] models, on May 29, 2025. On APIMart you call them with flux-kontext-pro and flux-kontext-max.
You can pass up to four URLs in image_urls. The output and all reference images must stay within 9MP in total. Multiple references are experimental, and every URL must be publicly accessible.
Kontext outputs approximately 1MP, and resolution has no effect. width and height are rejected. Use size with one of the nine supported ratios or a WIDTHxHEIGHT pixel string; pixel strings are converted to the nearest supported ratio. Actual 16:9 and 9:16 outputs may differ from the requested ratio by about 4%.
Use output_format to select png, jpeg, or webp. seed is optional and random by default; reusing a fixed seed with the same inputs can help reproduce a result.
Use prompt_upsampling to control prompt enhancement. Set it to true to enable enhancement or explicitly set it to false to disable prompt rewriting. Review outputs when wording must remain strict.
Submit a generation request and poll the returned task_id until completed or failed. Failed tasks are refunded automatically. Reference URLs must be publicly reachable; hosts that block data-center traffic can cause fetching to fail, so use a reliable public URL.
The FLUX.1 Kontext Pro API is billed per generated image. Original prices on APIMart (October 2026): FLUX.1 Kontext Pro costs $0.04 per image, with no surcharge for aspect ratio or reference count. Gold members pay $0.032, and Platinum and Diamond members save up to 28%. Failed tasks are refunded, and the completed task's cost is the final charge.
Sign up for APIMart, open the API Keys page in your dashboard, and create a key. The same key works for the Black Forest Labs FLUX.1 Kontext Pro API and every other model on the platform, with pay-as-you-go billing and no subscription.
Send your APIMart API key as a Bearer token and POST the request to /v1/images/generations with model set to flux-kontext-pro, plus your prompt and optional image_urls. Read data[0].task_id from the response and poll /v1/tasks/{task_id} until the task is completed or failed. Full parameters and code examples for the Flux Kontext API are in the APIMart docs (docs.apimart.ai).
No. The FLUX.1 Kontext Pro API has no free quota on APIMart. It is pay-as-you-go and billed per generated image, failed tasks are refunded automatically, and Gold members get 20% off, with Platinum and Diamond members saving up to 28%. See this page's live pricing table for current Kontext Pro prices.
APIMart offers three Black Forest Labs model families with one API key. FLUX 3 Image (flux-3-image) and FLUX 3 Image Klein (flux-3-image-klein) generate and edit images with up to 10 references; FLUX.2 (flux-2-pro, flux-2-max and flux-2-flex) covers generation and editing with up to 8 references; FLUX.1 Kontext (flux-kontext-pro and flux-kontext-max) focuses on context-aware editing. All image models use POST /v1/images/generations, and FLUX 3 Video (flux-3-video) uses POST /v1/videos/generations.
Use FLUX.1 Kontext for quick context-aware edits at a fixed price per image: about 1 MP output and up to 4 references. FLUX.2 Pro, Max and Flex go up to 4 MP with up to 8 references and are priced by megapixels. FLUX 3 Image accepts up to 10 references and outputs up to 4K, priced by resolution. All three run on the same APIMart key; the comparison table on this page links to each model.
Explore more models in the same category.
GPT Image 2.6
Generate and edit images with GPT Image 2.6 Flare and Sunburst.

Kling V4 Long Image
Kling V4 Long Image gives your visual stories room to unfold. Explore expansive scenes, flowing compositions, and rich details to shape long-format images that guide the viewer’s eye from one moment to the next.

Mai Image 2.7 Flash
MAI-Image-2.7-Flash is the faster, more cost-efficient version of Microsoft’s MAI-Image-2.7 image editing model, built for quick responses and high-volume image workflows.

Mai Image 2.7
Text to Image,Image to Image