Freepik

App · 20 actions

Freepik’s current Magnific API: icons, image jobs and flows.

Actions

ActionWhat it does
Create image promptStart this image task and return its ID.
Download iconDownload icon.
Generate flux dev imageStart this image task and return its ID.
Generate flux pro v1 1 imageStart this image task and return its ID.
Get flowGet flow.
Get flow runGet flow run.
Get flux dev taskGet flux dev task.
Get flux pro taskGet flux pro task.
Get iconGet icon.
Get image prompt taskGet image prompt task.
Get relight taskGet relight task.
List flux dev tasksList flux dev tasks.
List flux pro v1 1 tasksList flux pro v1 1 tasks.
List image prompt tasksList image prompt tasks.
List my flowsList my flows.
List recent creationsList recent creations.
List relight tasksList relight tasks.
Relight imageStart this image task and return its ID.
Run flowStart a flow with its input values.
Search iconsSearch icons.

Create image prompt

Start this image task and return its ID. Use the matching status action to retrieve its result.

Inputs

ImageimagetextRequired
Input image for prompt generation. Can be base64-encoded string or URL.
Webhook urlwebhook_urltext
Webhook URL to notify the user when the task is completed

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    }
  }
}

Download icon

Download icon.

Inputs

IdidnumberRequired
Icon resource ID
Formatformattext
These are the formats available for download - Note: gif, mp4, aep, json, psd and eps are not available for standard and sticker icon types.One of: svg, png, gif, mp4, aep, json, psd, eps.
Png sizepng_sizenumber
These are the sizes available for png_url formats. - Note: Only apply to format png.One of: 512, 256, 128, 64, 32, 24, 16.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "filename": "example",
      "url": "example"
    }
  }
}

Generate flux dev image

Start this image task and return its ID. Use the matching status action to retrieve its result.

Inputs

Promptprompttext
The prompt is a short text that describes the image you want to generate. It can range from simple descriptions, like `"a cat"`, to detailed scenarios, such as `"a cat with wings, playing the guitar, and wearing a hat"`. If no prompt is provided, the AI will generate a random image.
Webhook urlwebhook_urltext
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.
Aspect ratioaspect_ratiotext
Image size with the aspect ratio. The aspect ratio is the proportional relationship between an image's width and height, expressed as *_width_height (e.g., square_1_1, widescreen_16_9). It is calculated by dividing the width by the height.\ If not present, the default is `square_1_1`.One of: square_1_1 (Square 1 1), classic_4_3 (Classic 4 3), traditional_3_4 (Traditional 3 4), widescreen_16_9 (Widescreen 16 9), social_story_9_16 (Social story 9 16), standard_3_2 (Standard 3 2), portrait_2_3 (Portrait 2 3), horizontal_2_1 (Horizontal 2 1), vertical_1_2 (Vertical 1 2), social_post_4_5 (Social post 4 5).
Stylingstylingobject
Styling options for the image
Seedseednumber
Seed for the image generation. If not provided, a random seed will be used.From 1 to 4294967295.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "status": "CREATED",
      "task_id": "example"
    }
  }
}

Generate flux pro v1 1 image

Start this image task and return its ID. Use the matching status action to retrieve its result.

Inputs

PromptprompttextRequired
The prompt to use for image generation.
Prompt upsamplingprompt_upsamplingtrue/false
Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.
Seedseednumber
Optional seed for reproducibility. If not provided, a random seed will be used.
Aspect ratioaspect_ratiotext
Image size with the aspect ratio. The aspect ratio is the proportional relationship between an image's width and height, expressed as *_width_height (e.g., square_1_1, widescreen_16_9). It is calculated by dividing the width by the height.\ If not present, the default is `square_1_1`.One of: square_1_1 (Square 1 1), classic_4_3 (Classic 4 3), traditional_3_4 (Traditional 3 4), widescreen_16_9 (Widescreen 16 9), social_story_9_16 (Social story 9 16), standard_3_2 (Standard 3 2), portrait_2_3 (Portrait 2 3), horizontal_2_1 (Horizontal 2 1), vertical_1_2 (Vertical 1 2), social_post_4_5 (Social post 4 5).
Safety tolerancesafety_tolerancenumber
Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.From 0 to 6.
Output formatoutput_formattext
Format of the output imageOne of: jpeg, png.
Webhook urlwebhook_urltext
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.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "status": "CREATED",
      "task_id": "example"
    }
  }
}

Get flow

Get flow.

Inputs

Flow idflow_idtextRequired
Short unique identifier (sqid) of the flow. Discover flow identifiers via GET /v1/ai/flows.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "inputs": [],
      "name": "example",
      "sqid": "example",
      "tool_metadata": {
        "category": "example",
        "description_key": "example",
        "icon": "example",
        "sort_order": 1,
        "total_cost": 1,
        "translation_key": "example"
      }
    }
  }
}

Get flow run

Get flow run.

Inputs

Run idrun_idtextRequired
Unique identifier (SQID) of the flow run. This is the `workflow_run_identifier` value returned by the `POST /v1/ai/flows/{flow-id}/run` endpoint.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "app_id": "example",
      "completed_at": "example",
      "error_message": "example",
      "result": {
        "audios": [],
        "images": [],
        "videos": []
      },
      "run_id": "example",
      "started_at": "example",
      "status": "pending"
    }
  }
}

Get flux dev task

Get flux dev task.

Inputs

Task idtask_idtextRequired
ID of the task

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    }
  }
}

Get flux pro task

Get flux pro task.

Inputs

Task idtask_idtextRequired
ID of the task

Outputs

dataobject
Api response.
Example output
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    }
  }
}

Get icon

Get icon.

Inputs

IdidnumberRequired
Icon resource ID

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "author": {
        "assets": 1,
        "avatar": "example",
        "id": 1,
        "name": "example",
        "slug": "example"
      },
      "created": "example",
      "family": {
        "id": 1,
        "name": "example",
        "total": 1
      },
      "free_svg": false,
      "id": 1,
      "name": "example",
      "related": {
        "style": [],
        "variants": [],
        "visual_concept": []
      },
      "slug": "example",
      "style": {
        "id": 1,
        "name": "example"
      },
      "tags": [],
      "thumbnails": []
    }
  }
}

Get image prompt task

Get image prompt task.

Inputs

Task idtask_idtextRequired
ID of the task

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    },
    "examples": {}
  }
}

Get relight task

Get relight task.

Inputs

Task idtask_idtextRequired
ID of the task

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    }
  }
}

List flux dev tasks

List flux dev tasks.

Inputs

None.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": []
  }
}

List flux pro v1 1 tasks

List flux pro v1 1 tasks.

Inputs

None.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": []
  }
}

List image prompt tasks

List image prompt tasks.

Inputs

None.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": []
  }
}

List my flows

List my flows.

Inputs

None.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": []
  }
}

List recent creations

List recent creations.

Inputs

Per pageper_pagenumber
Results per page. It must be greater than 0.
Pagepagenumber
Page number. It must be greater than 0.
Tool nametool_nametext
Filter the creations by the tool that produced them.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "pagination": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1,
        "total": 1
      }
    }
  }
}

List relight tasks

List relight tasks.

Inputs

None.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": []
  }
}

Relight image

Start this image task and return its ID. Use the matching status action to retrieve its result.

Inputs

Webhook urlwebhook_urltext
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.
ImageimagetextRequired
Base64 or URL of the image to do the relight
Promptprompttext
You can guide the generation process and influence the light transfer with a descriptive prompt. For example, if the reference image is a brightly lit scene, adding something like "A sunlit forest clearing at golden hour" will be helpful. You can also use your imagination to alter lighting conditions in images: transforming a daytime scene into a moonlit night, enhancing the warmth of a sunset, or even dramatic changes like casting shadows of towering structures across a cityscape. IMPORTANT: You can emphasize specific aspects of the light in your prompt by using a number in parentheses, ranging from 1 to 1.4, like "(dark scene:1.3)".
Transfer light from reference imagetransfer_light_from_reference_imagetext
Base64 or URL of the reference image for light transfer. Incompatible with 'transfer_light_from_lightmap'
Transfer light from lightmaptransfer_light_from_lightmaptext
Base64 or URL of the lightmap for light transfer. Icompatible with 'transfer_light_from_reference_image'
Light transfer strengthlight_transfer_strengthnumber
It allows you to specify the level of light transfer, meaning the intensity that your prompt, reference image, or lightmap will have. A value of 0% will keep your image closest to the original, while 100% represents the maximum possible light transfer. If you enable "Interpolate from original", lower values on this slider will make the result even more similar to your original image. Valid values range `[0, 100]`, default `100`From 0 to 100.
Interpolate from originalinterpolate_from_originaltrue/false
When enabled, this feature will make your final image interpolate from the original using the "Light transfer strength" slider, at the cost of sometimes restricting the generation's freedom. If disabled, the generation will be freer and will generally produce better results. However, for example, if you want to generate all the frames of a video where a room transitions from having the lights off and very dim lighting to gradually becoming fully illuminated as a new day begins, activating this option might be useful (together with gradually ingreasing the "Light transfer strength" slider).
Change backgroundchange_backgroundtrue/false
When enabled, it will change the background based on your prompt and/or reference image. This is super useful for product placement and portraits. However, don't forget to disable it if your scene is something like a landscape or an interior.
Stylestyletext
Style.One of: standard, darker_but_realistic (Darker but realistic), clean, smooth, brighter, contrasted_n_hdr (Contrasted n hdr), just_composition (Just composition).
Preserve detailspreserve_detailstrue/false
It will try to maintain the texture and small details of the original image. Especially good for product photography, texts, etc. Disable it if you prefer a smoother result.
Advanced settingsadvanced_settingsobject
Advanced settings.

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": {
      "generated": [],
      "status": "CREATED",
      "task_id": "example"
    }
  }
}

Run flow

Start a flow with its input values. Use Get flow run to retrieve the final status and outputs.

Inputs

Flow idflow_idtextRequired
Short unique identifier (sqid) of the flow to execute. Discover flow identifiers via GET /v1/ai/flows.
InputsinputsobjectRequired
Map of input identifier to value. Use each input's `api_key` (recommended) or its `id` (UUID, legacy) as the key , both are accepted. Value types by input type: - `creation` (image/media): URL string, base64-encoded string, or existing creation sqid - `text`: Plain text string - `number`: Numeric value - `select`: Value from allowed options
Webhookwebhooktext
Optional callback URL that receives status notifications during execution. The webhook receives POST requests with the event payload (see webhook event schema). Events are sent when the run starts (`initialized`) and when it finishes (`finished` or `failed`).

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "status": "running",
    "workflow_run_identifier": "example"
  }
}

Search icons

Search icons.

Inputs

Termtermtext
Search term. If only term comes, it is searched for term, if only slug comes, it is searched for slug and if both come, it is searched for slug
Slugslugtext
Search by slug
Pagepagenumber
Page number. It must be greater than 0.
Per pageper_pagenumber
Results per page. It must be greater than 0.
Family idfamily_idnumber
Icon family id.At least 1.
Orderordertext
Define order of results. - Note: If the term or slug parameter is used, the order will be the similarity of the search.One of: relevance, recent.
Thumbnail sizethumbnail_sizetext
Size of the thumbnail. If the size is not specified, the API will return 128 as a default size.
Filtersfiltersobject
Filter parameters for icons

Outputs

dataobject
Api result.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "pagination": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 1,
        "total": 1
      }
    }
  }
}

On this page