Skip to content

FLUX Kontext Max API — Access via an AI API Gateway

Edit images with FLUX.1 Kontext [max] (Black Forest Labs) through byesu — an AI API gateway with OpenAI-compatible and Anthropic-native endpoints, one key for Claude / GPT-5.6 / Grok / Gemini plus image and video models, billed pay-as-you-go with no subscription. Kontext Max is an instruction-based image editing model: give it a source image and a plain-language instruction, and it makes the change while keeping everything else consistent — ideal for background swaps, object edits, product retouching and style changes. It also does text-to-image. It is billed per image at $0.025, so you only pay for what you use, and failed media tasks are refunded automatically.

byesu uses official routing (no reverse-engineering, no mirrors, no cracked clients), so models are not degraded and pricing is transparent. flux-kontext-max speaks the standard OpenAI image interface, so your existing image code needs almost no changes — just a new base URL and key.

Pricing

ModelBillingPrice
flux-kontext-maxPer image$0.025 / image
  • Billed per image: you're charged for each image generated, and nothing when none is generated.
  • The console shows a live comparison of the actual billed price against the official list price, so the multiplier is transparent and price changes are tracked automatically.
  • If a media task (image / video) fails, you're refunded automatically — no wasted charges.

See how it stacks up against other image models on the Image & Video API pricing comparison, and the full media price shelf on the Wholesale media API page.

How to Call

Base URL: https://byesu.com/v1 · Auth header: Authorization: Bearer sk-your-token

Your token must use the media group

Image models are only available under the media / media-gen group. Go to Console → Tokens and create a new token with that group, otherwise you'll get a "no available channel" error.

Instruction editing (background swap) · curl

Call POST /v1/images/edits with multipart/form-data. The source image goes in the image file field; describe the edit in prompt:

bash
curl https://byesu.com/v1/images/edits \
  -H "Authorization: Bearer sk-YOUR_TOKEN" \
  -F model="flux-kontext-max" \
  -F prompt="Replace the background with a clean white studio backdrop, keep the product unchanged" \
  -F image=@product.png

Response (base64 in data[0].b64_json):

json
{ "data": [ { "b64_json": "<base64 string>" } ] }

Instruction editing · Python

python
import base64, requests

resp = requests.post(
    "https://byesu.com/v1/images/edits",
    headers={"Authorization": "Bearer sk-YOUR_TOKEN"},
    data={
        "model": "flux-kontext-max",
        "prompt": "Put this sneaker on a marble surface with soft daylight, keep the sneaker identical",
    },
    files=[("image", ("product.png", open("product.png", "rb"), "image/png"))],
).json()

open("edited.png", "wb").write(base64.b64decode(resp["data"][0]["b64_json"]))

Text-to-image · curl

Call POST /v1/images/generations when you want to generate from a prompt alone:

bash
curl https://byesu.com/v1/images/generations \
  -H "Authorization: Bearer sk-YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-kontext-max",
    "prompt": "A minimalist skincare bottle on a pastel gradient background, soft studio light, e-commerce hero shot",
    "size": "1024x1024"
  }'

Key Parameters

FieldEndpointRequiredNotes
modelBothAlways flux-kontext-max; case and hyphens must match the console exactly
promptBothThe instruction (for edits) or the scene description (for text-to-image); be specific
imageEdits✅ (for editing)The source image file to edit; upload via the image file field
sizeText-to-imageWidth×height in pixels, e.g. "1024x1024"

Real parameters are authoritative in the docs

Exact fields, limits and response shapes are in Calling via API (Image / Video) — copy from there rather than a second-hand tutorial.

Why Use byesu for FLUX Kontext Max

  • Official routing, no quality degradation — requests reach the real FLUX Kontext Max, not a reverse-engineered or mirrored stand-in.
  • Instruction editing for e-commerce — background swaps and product retouching from a plain-language prompt, keeping the product consistent across a batch.
  • Transparent per-image billing$0.025/image, pay-as-you-go; the console shows the actual billed price against the official list price in real time.
  • Auto-refund on failure — failed media tasks aren't charged.
  • OpenAI-compatible — standard interface; existing OpenAI image code just needs a new base_url and key.
  • One key, whole platform — the same token also works with text models (/v1/chat/completions; Claude also supports Anthropic-native /v1/messages), video models, and other image models.

FAQ

How do I get FLUX Kontext Max API access?

Sign up at the byesu console, create a token in the media / media-gen group, and call flux-kontext-max through the OpenAI-compatible /v1/images/edits (instruction editing) and /v1/images/generations (text-to-image) endpoints. One key also covers Claude, GPT-5.6, Grok, Gemini and other media models, billed pay-as-you-go with no subscription.

How much does the FLUX Kontext Max API cost per image?

On byesu, flux-kontext-max is billed per image at $0.025 per image. You're charged for each image generated and nothing when none is; the console shows your live billed price next to the official list price, and failed media tasks are refunded automatically.

What is FLUX Kontext Max good for?

It's an instruction-based image editing model: describe the change in words and it edits an input image while keeping the rest consistent. It's strong at background swaps, object edits, product retouching and style changes, which makes it useful for e-commerce product photos and consistent multi-image edits.

How do I call flux-kontext-max, and which endpoints does it use?

Two OpenAI-compatible endpoints: instruction editing uses POST /v1/images/edits (multipart, the source image goes in the image file field); text-to-image uses POST /v1/images/generations (JSON). Both return the image as base64. See Calling via API for the full parameter reference.

Is flux-kontext-max on byesu the official model?

Yes. byesu uses official routing — not reverse-engineered, not a mirror, not a cracked client — so output quality matches the official service. The same token can also call other image, video and text models, all billed transparently by usage.

Got a problem? Contact support or join our group.