Freepik's developer API is now branded Magnific, at https://api.magnific.com (the older api.freepik.com host still answers). It covers stock-content search and AI image generation; generation is asynchronous — submit, then poll the task.
Get a key at magnific.com and send it as the x-magnific-api-key header. In the examples it's written {{MAGNIFIC_API_KEY}}.
Full reference: https://docs.magnific.com/introduction
curl "https://api.magnific.com/v1/resources?term=taco&limit=5" \
-H "x-magnific-api-key: {{MAGNIFIC_API_KEY}}"
Returns a task id to poll.
curl -X POST https://api.magnific.com/v1/ai/mystic \
-H "x-magnific-api-key: {{MAGNIFIC_API_KEY}}" \
-H "Content-Type: application/json" \
-d '{"prompt": "a taco food truck at golden hour, photo"}'
curl https://api.magnific.com/v1/ai/mystic/{{TASK_ID}} \
-H "x-magnific-api-key: {{MAGNIFIC_API_KEY}}"