How to hit the Freepik / Magnific API API

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.

Authentication

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

Generate an image (Mystic)

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"}'
Run in PostTaco

Check a generation

curl https://api.magnific.com/v1/ai/mystic/{{TASK_ID}} \
  -H "x-magnific-api-key: {{MAGNIFIC_API_KEY}}"
Run in PostTaco