Skip to main content
POST
/
v1
/
ai
/
improve-prompt
curl --request POST \
--url https://api.freepik.com/v1/ai/improve-prompt \
--header 'Content-Type: application/json' \
--header 'x-freepik-api-key: <api-key>' \
--data '{
"prompt": "A beautiful landscape",
"type": "image"
}'
{
"data": {
"generated": [],
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED"
}
}

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

Text prompt to improve for AI generation. Can be empty to generate a creative prompt.

Maximum length: 2500
Example:

"A beautiful landscape"

type
enum<string>
required

Type of generation (image or video)

Available options:
image,
video
Example:

"image"

language
string
default:en

Language code for the improved prompt (ISO 639-1 format). Defaults to English if not specified.

Example:

"en"

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"

Response

OK - The task exists and the status is returned

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