FLUX.2 Flex Edit API: AI Image Editing

Edit images with FLUX.2 Flex Edit via the Muapi REST API. Pay per generation — no subscription needed.

FLUX.2 Flex Edit API Reference

Endpoint

POST https://api.muapi.ai/api/v1/flux-2-flex-edit

Submit a job with your MuApi API key in the x-api-key header, then poll https://api.muapi.ai/api/v1/predictions/{request_id}/result until status is completed.

Parameters

NameTypeRequiredDescription
promptstringYesText prompt describing the image.
images_listarrayYesUpload or provide reference images. Used for image-to-image generation.
aspect_ratiostringNoAspect ratio of the output image.Options: auto, 16:9, 9:16, 1:1, 4:3, 3:4, 2:3, 3:2Default: "1:1"
resolutionstringNoThe target resolution of the generated image.Options: 1k, 2kDefault: "1k"

cURL example

REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/flux-2-flex-edit \
  -H "x-api-key: $MUAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"<prompt>","images_list":[]}' | jq -r .request_id)

curl -s https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result -H "x-api-key: $MUAPI_API_KEY"

Python example

import os, time, requests

API = "https://api.muapi.ai/api/v1"
headers = {"x-api-key": os.environ["MUAPI_API_KEY"]}

r = requests.post(f"{API}/flux-2-flex-edit", headers=headers, json={"prompt":"<prompt>","images_list":[]})
request_id = r.json()["request_id"]

while True:
    res = requests.get(f"{API}/predictions/{request_id}/result", headers=headers).json()
    if res["status"] == "completed":
        print(res["outputs"]); break
    if res["status"] == "failed":
        raise RuntimeError(res.get("error"))
    time.sleep(3)

Full docs and agent/MCP integration: llms.txt. Get an API key at muapi.ai/access-keys.

FLUX.2 Flex Edit API: AI Image Editing