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..."
}'
{
  "generated": [],
  "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
  "task_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 Image to style transfer

reference_image
string
required

Base64 Reference image for style transfer

webhook_url
string

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

Is the image a portrait

portrait_style
enum<string>
default:standard

Portrait style

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

Portrait beautifier

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

200
application/json
OK - The request has succeeded and the Style Transfer process has started.
task_id
string
required

Task identifier

task_status
enum<string>
required

Task status

Available options:
IN_PROGRESS,
COMPLETED,
FAILED
generated
string[]
required

URL of the generated image