> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kymaapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FLUX.1 Kontext Pro

> FLUX.1 Kontext Pro is an image-to-image editing and refinement model built by BFL. Reach for it when you need precise inpainting, masked edits, or iterative refinement of existing images at a low cost.

## Overview

FLUX.1 Kontext Pro accepts text and image inputs to produce edited image outputs. It specializes in mask-based inpainting and targeted refinement, allowing you to modify specific regions while preserving the rest of the frame.

On Kyma, the model runs on the cheap tier with medium speed. Prompt caching applies to repeated instruction prefixes, and every request benefits from automatic failover if a serving path degrades. Response metadata includes exact costs in usage.cost and the active model in the X-Kyma-Model header.

This model does not support text generation, logical reasoning, or structured outputs. It is optimized for guided edits rather than generating images entirely from scratch, and token limits do not apply to its image-based workflow.

## Specs

| Field              | Value                           |
| ------------------ | ------------------------------- |
| Model ID           | `flux-kontext-pro`              |
| Best for           | Image edit, inpaint, refinement |
| Context window     | 0                               |
| Input modalities   | Text, Image                     |
| Output modalities  | Image                           |
| Tool calling       | Yes                             |
| Structured outputs | Yes                             |
| Prompt caching     | Yes                             |
| Speed              | Medium                          |
| Cost band          | Cheap                           |
| Release stage      | Stable                          |

## Pricing

|        | Per 1M tokens |
| ------ | :-----------: |
| Input  |     \$0.20    |
| Output |     \$0.60    |

## Use this when

* **Masked Object Replacement** — Swap specific regions of an image using a binary mask and a text prompt.
* **Iterative Image Refinement** — Improve composition or details in an existing image through guided edits.
* **Targeted Detail Enhancement** — Sharpen or adjust specific areas without altering the full frame.
* **Batch Asset Editing** — Apply consistent text-guided modifications across multiple source images.

## Not ideal for

Do not use this model for generating images from scratch, text generation, or tasks requiring logical reasoning or structured JSON outputs.

## Pick something else when

* You need high-fidelity generation from text prompts: use [`flux-2-pro`](/models/flux-2-pro) or [`flux-1.1-ultra`](/models/flux-1.1-ultra).
* You require vector graphics or scalable design assets: use [`recraft-v4-vector`](/models/recraft-v4-vector) or [`recraft-v4-vector-pro`](/models/recraft-v4-vector-pro).
* You need fast, low-latency image generation: use [`imagen-4-fast`](/models/imagen-4-fast) or [`nano-banana-3-flash`](/models/nano-banana-3-flash).

## Example

```python theme={null}
from openai import OpenAI

client = OpenAI(base_url="https://kymaapi.com/v1", api_key="ky-...")

response = client.chat.completions.create(
    model="flux-kontext-pro",
    messages=[{"role": "user", "content": "..."}],
)
```

## Agent query example

Ask the API which models fit, instead of hardcoding an id:

```bash theme={null}
curl "https://kymaapi.com/v1/models?recommended_for=generate-images&tools=true&quality_tier=strong"
```

## FAQ

**Does this model accept text-only prompts?**

No. It requires an input image alongside a text prompt to perform edits or refinements.

**How does prompt caching work with this model?**

Repeated prompt prefixes are billed at this model's cached input rate, reducing costs for workflows with consistent instructions.

**How do I verify which model processed my request?**

Kyma returns the exact model identifier in the X-Kyma-Model header and reports precise costs in the usage.cost field.
