AI image generation
All of Freepik image generation modes, under a single API
Classic fast
The most cost-effective tool in the market, also the quickest. Improved and optimized for speed, includes several styles for easy customization. Here’s an overview of the main features:
Generate Image
Create AI-generated images based on text prompts.
POST /v1/ai/text-to-image
Generate images using text prompts
Key Parameters
prompt
: Text to generate image from (required)negative_prompt
: Attributes to avoid in the generated imagestyling
: Object containing style, color, lightning, and framing optionsimage
: Object specifying size (required)guidance_scale
: Level of fidelity to the prompt (default: 1.0)num_images
: Number of images to generateseed
: Seed for reproducible results
Rate Limiting
Rate limits are based on IP address and API key:
- Free tier: 100 creations/day
- Pay per use: N/A
Exceeding limits may result in request failures.
API Call Example
curl --request POST \
--url https://api.freepik.com/v1/ai/text-to-image \
--header 'Content-Type: application/json' \
--header 'x-freepik-api-key: <api-key>' \
--data '{
"prompt": "Crazy dog in the space",
"negative_prompt": "b&w, earth, cartoon, ugly",
"guidance_scale": 2,
"seed": 42,
"num_images": 1,
"image": {
"size": "square"
},
"styling": {
"style": "anime",
"color": "pastel",
"lightning": "warm",
"framing": "portrait"
}
}'
For detailed information on request parameters, response formats, and more examples, check the API Reference.
Authentication
Include the x-freepik-api-key
header in your requests for authentication. Keep this key secure and don’t share it with others.
Need Higher Rate Limits?
For higher rate limits, contact the Freepik sales team to discuss custom plans tailored to your needs.
Was this page helpful?