Skip to content
Docs menu

Image models

Flux.1 Kontext

On this page

In-context image generation and precise editing.

modelIdflux-kontext
Modalityimage
PricingSee this model on the Pricing page for the current per-call price (with your markup).

Operations

OperationEndpointDescription
Text to imagePOST /api/v1/generateBase generation from a text prompt.
Image to imagePOST /api/v1/generateCondition on a reference image — upload it via /api/v1/files/upload and pass the URL.
Poll taskGET /api/v1/task/{id}?model=flux-kontextRetrieve state and result URLs.

Input parameters

FieldTypeRequiredValues / example
imageUrlimageoptionalPNG, JPG, JPEG, or WEBP (max 5MB)
prompttextarearequiredDescribe the edit you want…
enableTranslationselectoptionalfalse, true
aspectRatioselectrequired16:9, 21:9, 4:3, 1:1, 3:4, 9:16
outputFormatselectrequiredJPEG, PNG
modelselectrequiredPro, Max

Example request

bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"flux-kontext","input":{"prompt":"A cozy reading nook inside a treehouse at dusk, string lights, rain on the round window, storybook illustration.","enableTranslation":"true","aspectRatio":"1:1","outputFormat":"JPEG","model":"Pro"}}'