Skip to main content
POST
  • Flux Kontext image generation and editing model
  • Choose flux-kontext-pro (Pro) or flux-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_id for querying results
Important Change: For better performance and cost control, we no longer support passing base64 image data directly in image_urls. Please use the Upload 画像API first to upload images and get URLs, then call this endpoint.

Authorization

string
必須
All endpoints require Bearer Token authenticationGet your API Key: Visit the API Key Management Page to get your API KeyAdd to request header:

リクエストパラメータ

string
必須
Image generation model nameOptions:
  • flux-kontext-pro - Pro version
  • flux-kontext-max - Max version, higher quality
string
必須
Text description for image generation
string
Image aspect ratioDefault:
  • With reference image: match_input_image (match input image)
  • Without reference image: 16:9
Supported aspect ratios:
string[]
Reference image URL array for image editing⚠️ URL format only (base64 not supported)
  • Publicly accessible image URL (http:// or https://)
  • Use the Upload 画像API to upload local images and get URLs
Limits:
  • Maximum 1 image
  • With image = image editing mode; without = text-to-image mode
object
Metadata parameters for additional configuration options

レスポンス

string
Unique task identifier for querying task status
string
Object type, fixed as generation.task
string
モデル name used for generation
string
Task status
  • queued - Waiting to be processed
  • in_progress - Processing
  • completed - Successfully completed
  • failed - Failed
integer
Task progress percentage (0-100)
integer
Task creation timestamp (Unix timestamp)
object
Task metadata

Use Cases

Case 1: Text-to-Image

Case 2: Image Editing

Case 3: High-Quality Text-to-Image (Max モデル)

Query Task ResultsImage generation is an async task. After submission, a task ID is returned. Use the Get Image Task ステータス endpoint to query generation progress and results.