Skip to main content
POST
/
v1
/
ai
/
text-to-image
/
seedream
Create image from text - Seedream
curl --request POST \
  --url https://api.freepik.com/v1/ai/text-to-image/seedream \
  --header 'Content-Type: application/json' \
  --header 'x-freepik-api-key: <api-key>' \
  --data '{
  "prompt": "<string>",
  "webhook_url": "https://www.example.com/webhook",
  "aspect_ratio": "square_1_1",
  "guidance_scale": 2.5,
  "seed": 1073741823
}'
{
"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 text prompt used to generate the image

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"

aspect_ratio
enum<string>
default:square_1_1

The aspect ratio of the generated image

Available options:
square_1_1,
widescreen_16_9,
social_story_9_16,
portrait_2_3,
traditional_3_4,
standard_3_2,
classic_4_3
guidance_scale
number
default:2.5

Controls how closely the output image aligns with the input prompt. Higher values mean stronger prompt correlation.

Required range: 0 <= x <= 20
seed
integer

Random seed to control the stochasticity of image generation

Required range: 0 <= x <= 2147483647

Response

OK - The request has succeeded and the Seedream 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"
}