Skip to Content
Image ModelsFlux Kontext

Flux Kontext

Overview

Flux Kontext is an image-to-image model that supports editing and generation based on existing images. This model offers three versions: Dev, Pro, and Max.

Test API KEY: key_00000000000000000000000000000000

Endpoints

1. Create Task

Request

POST https://api.pixwith.ai/api/task/create

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Api-Key{API_KEY}Yes

Request Parameters

ParameterTypeRequiredDescription
promptstringYesThe input prompt (e.g., “Put a hat on the cat”)
image_urlsarrayYes[“https://cdn.pixwith.ai/xxx.jpg ”]. Provide 1 image.
model_idstringYes1-1 (Dev), 1-2 (Pro), or 1-3 (Max)
optionsobjectYesConfiguration options for the task
options.prompt_optimizationbooleanYesIf true, all prompt words will be automatically translated into English.
options.aspect_ratiostringYesAspect ratio of the output. Valid values: '0' (match original image), '1:1', '3:4', '2:3', '9:16', '4:3', '3:2', or '16:9'. Default: '0'

Example Request

{ "prompt": "Put a hat on the cat", "image_urls": [ "https://cdn.pixwith.ai/images/cf0ddb5ad6a0f0c85ab4d1dceb9fd89c_0.jpeg" ], "model_id": "1-1", "options": { "prompt_optimization": true, "aspect_ratio": "0" } }

Response Parameters

ParameterTypeDescription
codeint1=success, 0=error
messagestringSuccess and failure messages
dataobject
data.task_idstring
data.estimated_timeintEstimated time in seconds

Response

{ "code": 1, "message": "success", "data": { "task_id": "d425ab4dc256f0ebaa84862b9cea8a3d", "estimated_time": 5 } }
Last updated on