POST
/
v1
/
ai
/
text-to-image
/
flux-dev
curl --request POST \
  --url https://api.freepik.com/v1/ai/text-to-image/flux-dev \
  --header 'Content-Type: application/json' \
  --header 'x-freepik-api-key: <api-key>' \
  --data '{
  "prompt": "<string>",
  "webhook_url": "<string>",
  "aspect_ratio": "square_1_1",
  "styling": {
    "effects": {
      "color": "softhue",
      "camera": "portrait",
      "lightning": "iridescent"
    }
  },
  "seed": 2147483648
}'
{
  "data": {
    "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "status": "IN_PROGRESS"
  }
}

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
prompt
string

The prompt is a short text that describes the image you want to generate. It can range from simple descriptions, like "a cat", to detailed scenarios, such as "a cat with wings, playing the guitar, and wearing a hat". If no prompt is provided, the AI will generate a random image.

webhook_url
string

Webhook URL to notify the user when the task is completed

aspect_ratio
enum<string>
default:
square_1_1

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 square_1_1.

Available options:
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
styling
object

Styling options for the image

seed
integer

Seed for the image generation. If not provided, a random seed will be used.

Required range: 1 < x < 4294967295

Response

200
application/json
OK - Get the status of the flux-dev task
data
object
required