Image models
Flux.1 Kontext
On this page
In-context image generation and precise editing.
| modelId | flux-kontext |
| Modality | image |
| Pricing | See this model on the Pricing page for the current per-call price (with your markup). |
Operations
| Operation | Endpoint | Description |
|---|---|---|
| Text to image | POST /api/v1/generate | Base generation from a text prompt. |
| Image to image | POST /api/v1/generate | Condition on a reference image — upload it via /api/v1/files/upload and pass the URL. |
| Poll task | GET /api/v1/task/{id}?model=flux-kontext | Retrieve state and result URLs. |
Input parameters
| Field | Type | Required | Values / example |
|---|---|---|---|
| imageUrl | image | optional | PNG, JPG, JPEG, or WEBP (max 5MB) |
| prompt | textarea | required | Describe the edit you want… |
| enableTranslation | select | optional | false, true |
| aspectRatio | select | required | 16:9, 21:9, 4:3, 1:1, 3:4, 9:16 |
| outputFormat | select | required | JPEG, PNG |
| model | select | required | Pro, 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"}}'