Skip to main content
POST
/
v1
/
ai
/
text-to-icon
curl --request POST \
--url https://api.freepik.com/v1/ai/text-to-icon \
--header 'Content-Type: application/json' \
--header 'x-freepik-api-key: <api-key>' \
--data '{
"prompt": "Sliced avocado and chips",
"webhook_url": "https://example.com/webhook"
}'
{
"data": {
"generated": [],
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "IN_PROGRESS"
}
}

Description

Generate an icon from a text prompt.

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 prompt to generate the icon

Example:

"A cute cat icon"

webhook_url
string<uri>
required

The webhook URL to receive the result

Example:

"https://example.com/webhook"

format
enum<string>
default:png

The format of the icon

Available options:
png,
svg
Example:

"svg"

style
enum<string>
default:solid

The style to use for the icon

Available options:
solid,
outline,
color,
flat,
sticker
Example:

"solid"

num_inference_steps
integer

The number of inference steps to use for the generation

Required range: 10 <= x <= 50
Example:

10

guidance_scale
number

The guidance scale to use for the generation

Required range: 0 <= x <= 10
Example:

7

Response

Success - The request has succeeded and the Text to Icon 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"
}