POST
/
v1
/
ai
/
text-to-image
/
imagen3
curl --request POST \
--url https://api.freepik.com/v1/ai/text-to-image/imagen3 \
--header 'Content-Type: application/json' \
--header 'x-freepik-api-key: <api-key>' \
--data '{
"prompt": "Crazy dog in the space",
"num_images": 1,
"aspect_ratio": "square_1_1",
"styling": {
"style": "anime",
"effects": {
"color": "pastel",
"lightning": "warm",
"framing": "portrait"
}
},
"person_generation": "allow_adult",
"safety_settings": "block_low_and_above"
}'
{
"data": {
"generated": [],
"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
required

The prompt to be used while generating the image

Example:

"A beautiful sunset over a calm ocean"

webhook_url
string<uri>

Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.

Example:

"https://www.example.com/webhook"

num_images
integer
default:1

Specifies the number of images to generate in a single request. Valid values range [1, 4], default 1.

Required range: 1 <= x <= 4
Example:

1

aspect_ratio
enum<string>
default:square_1_1

The aspect ratio of the image

Available options:
square_1_1,
social_story_9_16,
widescreen_16_9,
traditional_3_4,
classic_4_3
Example:

"square_1_1"

styling
object
person_generation
enum<string>
default:allow_all

Allow person generation

Available options:
dont_allow,
allow_adult,
allow_all
safety_settings
enum<string>
default:block_none

Safety settings options

Available options:
block_low_and_above,
block_medium_and_above,
block_only_high,
block_none

Response

OK - The request has succeeded and the Imagen3 process has started.

data
object
required
Example:
{
"generated": [
"https://openapi-generator.tech",
"https://openapi-generator.tech"
],
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED"
}