POST
https://api.unifically.com
/
flux.2-flex
/
generate
Generate Image
curl --request POST \
  --url https://api.unifically.com/flux.2-flex/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "image_urls": [
    {}
  ],
  "aspect_ratio": "<string>",
  "quality": "<string>",
  "callback_url": "<string>",
  "steps": 123,
  "cfg": 123
}
'
{
  "code": 200,
  "data": {
    "status": "processing",
    "task_id": "dd55ae25-adff-47a0-9194-6a37845b58e4"
  }
}
Generate high-quality AI images using the Flux.2 Flex model with support for up to 10 reference images.

Pricing

QualityPrice
1K$0.04
2K$0.06

Request

curl -X POST "https://api.unifically.com/flux.2-flex/generate" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "prompt": "A beautiful sunset over mountains",
    "image_urls": ["https://example.com/ref1.jpg"],
    "aspect_ratio": "16:9",
    "quality": "2K"
  }'

Parameters

Required Parameters

prompt
string
required
Text description of the image to generate

Optional Parameters

image_urls
array
Array of reference image URLs to guide generationMaximum: 10 images
aspect_ratio
string
Aspect ratio of the generated imageOptions: "auto", "1:1", "4:3", "16:9", "3:2", "2:3", "9:16", "3:4"Default: "auto"
quality
string
Output image quality/resolutionOptions: "1K", "2K"Default: "1K"
callback_url
string
URL to receive webhook notification on completion

Flex-only Optional Parameters

steps
integer
Quality steps for generation. More steps = higher quality but longer generation time.Range: 1-50
cfg
number
Prompt strength. Higher value limits creativity and follows prompt more strictly.Range: 1.5-10

Response

{
  "code": 200,
  "data": {
    "status": "processing",
    "task_id": "dd55ae25-adff-47a0-9194-6a37845b58e4"
  }
}

Response Fields

code
integer
default:"200"
HTTP status code (200 for success)
data
object
Response data
task_id
string
Unique identifier for this generation task
status
string
Task status (e.g., “processing”)
Use the task_id to check the status using the Check Status endpoint.