POST
/
v1
/
ai
/
image-style-transfer
curl --request POST \
--url https://api.freepik.com/v1/ai/image-style-transfer \
--header 'Content-Type: application/json' \
--header 'x-freepik-api-key: <api-key>' \
--data '{
"image": "iVBORw0KGgoAAAANSUhEUgAA...",
"reference_image": "iVBORw0KGgoAAAANSUhEUgAA..."
}'
{
"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
image
string
required

Base64 or URL of the image to do the style transfer

reference_image
string
required

Base64 or URL of the reference image for style transfer

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"

prompt
string

Prompt for the AI model

style_strength
integer
default:100

Percentage of style strength

Required range: 0 <= x <= 100
structure_strength
integer
default:50

Allows to maintain the structure of the original image

Required range: 0 <= x <= 100
is_portrait
boolean
default:false

Indicates whether the image should be processed as a portrait. When set to true, portrait-specific enhancements such as style and beautification can be applied.

portrait_style
enum<string>
default:standard

Optional setting to define the visual style applied to portrait images. Only used if is_portrait is true. The available options adjust the stylization level or aesthetic treatment of the portrait.

Available options:
standard,
pop,
super_pop
portrait_beautifier
enum<string>

Optional setting to enable facial beautification on portrait images. Only used if is_portrait is true. Options control the intensity or type of beautification applied.

Available options:
beautify_face,
beautify_face_max
flavor
enum<string>
default:faithful

Flavor of the transferring style

Available options:
faithful,
gen_z,
psychedelia,
detaily,
clear,
donotstyle,
donotstyle_sharp
engine
enum<string>
default:balanced
Available options:
balanced,
definio,
illusio,
3d_cartoon,
colorful_anime,
caricature,
real,
super_real,
softy
fixed_generation
boolean
default:false

When this option is enabled, using the same settings will consistently produce the same image. Fixed generations are ideal for fine-tuning, as it allows for incremental changes to parameters (such as the prompt) to see subtle variations in the output. When disabled, expect each generation to introduce a degree of randomness, leading to more diverse outcomes.

Response

OK - The request has succeeded and the Style Transfer process has started.

task_id
string<uuid>
required

Task identifier

task_status
enum<string>
required

Task status

Available options:
IN_PROGRESS,
CREATED,
COMPLETED,
FAILED
generated
string<uri>[]
required

URL of the generated image