POST
/
v1
/
ai
/
beta
/
text-to-image
/
reimagine-flux
curl --request POST \
  --url https://api.freepik.com/v1/ai/beta/text-to-image/reimagine-flux \
  --header 'Content-Type: application/json' \
  --header 'x-freepik-api-key: <api-key>' \
  --data '{
  "webhook_url": "https://api.ejemplo.com/webhook",
  "image": "iVBORw0KGgoAAAANSUhEUgAA...",
  "prompt": "Un hermoso atardecer sobre un océano tranquilo",
  "imagination": "wild",
  "aspect_ratio": "square_1_1"
}'
{
  "data": {
    "generated": [
      "https://ai-statics.freepik.com/completed_task_image.jpg"
    ],
    "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "status": "COMPLETED"
  }
}

Authorizations

x-freepik-api-key
string
header
required

Your Freepik API key. Required for authentication. Learn how to obtain an API key

Body

application/json
image
string
required

Base64 image to do the reimagination

webhook_url
string

Webhook URL to notify the user when the task is completed

prompt
string
Example:

"A beautiful sunset over a calm ocean"

imagination
enum<string>

Imagination type

Available options:
wild,
subtle,
vivid
aspect_ratio
enum<string>
default:original

Image size with the aspect ratio. The aspect ratio is the proportional relationship between an image's width and height, expressed as *_width_height (e.g., square_1_1, widescreen_16_9). It is calculated by dividing the width by the height.
If not present, the default is original.

Available options:
original,
square_1_1,
classic_4_3,
traditional_3_4,
widescreen_16_9,
social_story_9_16,
standard_3_2,
portrait_2_3,
horizontal_2_1,
vertical_1_2,
social_post_4_5

Response

200
application/json
Success - The image has been generated
task_id
string
required

Task identifier

status
enum<string>
required

Task status

Available options:
IN_PROGRESS,
COMPLETED,
FAILED
generated
string[]
required

URL of the generated image