Flux Kontext
Flux Kontext Image Generation
Generate and edit images using Flux Kontext model, supporting text-to-image and image editing
POST
Documentation Index
Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
Use this file to discover all available pages before exploring further.
- Flux Kontext image generation and editing model
- Choose
flux-kontext-pro(Pro) orflux-kontext-max(Max, higher quality) via the model parameter - Supports text-to-image and image editing modes
- With reference image = image editing; without = text-to-image
- Fixed billing per request
- Async task mode, returns
task_idfor querying results
Authorization
All endpoints require Bearer Token authenticationGet your API Key: Visit the API Key Management Page to get your API KeyAdd to request header:
Request Parameters
Image generation model nameOptions:
flux-kontext-pro- Pro versionflux-kontext-max- Max version, higher quality
Text description for image generation
Image aspect ratioDefault:
- With reference image:
match_input_image(match input image) - Without reference image:
16:9
| Value | Description |
|---|---|
match_input_image | Match input image ratio (image editing only) |
1:1 | Square |
4:3 / 3:4 | Traditional display ratio |
16:9 / 9:16 | Widescreen/portrait |
3:2 / 2:3 | Standard photo |
21:9 / 9:21 | Ultrawide/ultra-narrow |
Reference image URL array for image editing⚠️ URL format only (base64 not supported)
- Publicly accessible image URL (http:// or https://)
- Use the Upload Image API to upload local images and get URLs
- Maximum 1 image
- With image = image editing mode; without = text-to-image mode
Metadata parameters for additional configuration options
Response
Unique task identifier for querying task status
Object type, fixed as
generation.taskModel name used for generation
Task status
queued- Waiting to be processedin_progress- Processingcompleted- Successfully completedfailed- Failed
Task progress percentage (0-100)
Task creation timestamp (Unix timestamp)
Task metadata
Use Cases
Case 1: Text-to-Image
Case 2: Image Editing
Case 3: High-Quality Text-to-Image (Max Model)
Query Task ResultsImage generation is an async task. After submission, a task ID is returned. Use the Get Task Status endpoint to query generation progress and results.