POST

Edit an input image from a text prompt with configurable aspect ratio and output format. Powered by FLUX Kontext Max on Replicate

/v1/image/edit/flux-kontext

Powered by Replicate

Request → Response

Examples from schemas.json.

Requestapplication/json
POST /v1/image/edit/flux-kontext
Content-Type: application/json

{
  "input_image": "https://tools402.dev/og/og-docs.png",
  "prompt": "Summarize this text in one sentence.",
  "aspect_ratio": "match_input_image",
  "output_format": "jpg",
  "safety_tolerance": 2,
  "prompt_upsampling": false
}
Responseapplication/json
HTTP/1.1 200 OK
Content-Type: application/json

// Endpoint-specific body after 402 settlement

Overview

Edit an input image from a text prompt with configurable aspect ratio and output format. Powered by FLUX Kontext Max on Replicate.

Cloud platform to run open-source machine learning models via API.

Request schema

Body: JSON · application/json

FieldTypeDescription
input_imagestringrequired
promptstringrequired
aspect_ratiostringrequiredenum: match_input_image, 1:1, 16:9, 9:16, 3:2, 2:3
output_formatstringrequiredenum: jpg, png
safety_toleranceintegerrequiredmin: 1
prompt_upsamplingbooleanrequired
IMPLEMENTATION
curl -X POST https://api.tools402.dev/v1/image/edit/flux-kontext \
  -H "Content-Type: application/json" \
  -d '{
  "input_image": "https://tools402.dev/og/og-docs.png",
  "prompt": "Summarize this text in one sentence.",
  "aspect_ratio": "match_input_image",
  "output_format": "jpg",
  "safety_tolerance": 2,
  "prompt_upsampling": false
}'

402 payment flow omitted — see Integrations for settlement.