Authentication
authorization string required
All APIs require authentication via Bearer Token
Get API Key:
Visit API Key Management Page to get your API Key
Usage:
Add to request header:
Authorization: Bearer YOUR_API_KEY
Parameters
model string required
Model ID to use for the request
Options: flux_pro_11
prompt string required
Text description of the desired image
image_prompt string
Image Base64 for image-guided generation
width integer
Image width, must be a multiple of 32
Range: 256 - 1440
Default: 1024
height integer
Image height, must be a multiple of 32
Range: 256 - 1440
Default: 1024
prompt_upsampling boolean
Whether to perform upsampling on the prompt. If activated, will automatically modify prompt to achieve more creative generation
Default: false
seed integer
Random seed for result reproducibility, accepts any integer
safety_tolerance integer
Content moderation level. Values range from 0 (strictest) to 6 (more lenient)
Range: 0 - 6
Default: 2
output_format string
Output format
Options: jpeg, png
Default: jpeg
Polling
Since image generation takes time, you need to poll the task status after creation
The initial response returns the task ID and initial status. The actual generation results must be obtained through polling the task status endpoint
Response Format
error object
Error information, only present when status is failed
code
stringError code
message
stringDetailed error message
output array
Generation results, only present when status is completed
content
arrayList of generated content
type
stringResource type, e.g.,
imageurl
stringGenerated content URL
usage object
Usage statistics, only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information
Error Codes
Error information is provided in the error field when status is failed