Get started with the Flux Kontext API in minutes. Learn how to generate images from text and edit existing images using AI.
Get Your API Key
Add to Request Headers
taskId
to monitor progress:
0
: GENERATING - Task is currently being processed1
: SUCCESS - Task completed successfully2
: CREATE_TASK_FAILED - Failed to create the task3
: GENERATE_FAILED - Task creation succeeded but generation failedContent Policy Violations (Code 400)
Safety Tolerance Out of Range (Code 500)
Rate Limiting (Code 429)
flux-kontext-pro
for standard tasks, flux-kontext-max
for complex scenesenableTranslation: false
if your prompts are already in EnglishenableTranslation: true
for auto-translation)Parameter | Type | Description | Default |
---|---|---|---|
prompt | string | Required. Text description for generation/editing | - |
aspectRatio | string | Output image aspect ratio | 16:9 |
model | string | flux-kontext-pro or flux-kontext-max | flux-kontext-pro |
outputFormat | string | jpeg or png | jpeg |
Parameter | Type | Description | Default |
---|---|---|---|
inputImage | string | URL for image editing mode | - |
enableTranslation | boolean | Auto-translate non-English prompts | true |
promptUpsampling | boolean | AI prompt enhancement | false |
safetyTolerance | integer | Content moderation level | 2 |
callBackUrl | string | Webhook notification URL | - |
uploadCn | boolean | Use China servers for upload | false |
watermark | string | Watermark identifier | - |