Recently, I've been attempting to integrate a Freepik API key for making API calls, as my goal was to select a specific AI model for image generation, namely Google Image 3. I entered the correct credentials, but I observed that the module does not allow me to add x-freepik-api-key
at the beginning before the API key itself. Consequently, I tried using the Authorization header instead, which resulted in the error shown in the image.
Based on my research, there's an alternative method involving three modules to execute an API call to Freepik's Google Image 3 endpoints:
- First, an HTTP POST request to initiate image creation.
- Then, a pause of 50 seconds.
- Finally, an HTTP GET request to retrieve the generated image.
My question is: Is there any way to input a different value in the Freepik API call?
Currently, the module doesn't permit the addition of the x-freepik-api-key
header. I also attempted to add another header with the correct API call structure, but I encountered an invalid API call error. Interestingly, when I execute a local API request using Windows Terminal, it functions correctly and returns a 200 status code.
One important detail is that I cannot create a new API key or reset the existing one, as I am utilizing the Freepik free API plan with a 5 euro free trial. Even when I test with a different free account, I receive the same error when using the Freepik API call module. I'm uncertain if the module is outdated or if it exclusively supports paid APIs.
Error output of an API call using the Freepik module
RuntimeError
[403] <!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Access denied</title>
<link rel="icon" type="image/x-icon" href="https://fps.cdnpk.net/favicons/favicon.ico">
<link rel="icon" type="image/png" href="https://fps.cdnpk.net/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://fps.cdnpk.net/favicons/favicon-16x16.png" sizes="16x16">
<link rel="shortcut icon" type="image/x-icon" href="https://fps.cdnpk.net/favicons/favicon-96x96.png">
<link rel="icon" type="image/x-icon" href="https://fps.cdnpk.net/favicons/favicon-96x96.png" sizes="96x96">
<link rel="apple-touch-icon-precomposed" href="https://fps.cdnpk.net/favicons/apple-icon-57x57.png" sizes="57x57">
<link rel="apple-touch-icon-precomposed" href="https://fps.cdnpk.net/favicons/apple-icon-72x72.png" sizes="72x72">
<link rel="apple-touch-icon-precomposed" href="https://fps.cdnpk.net/favicons/apple-icon-114x114.png" sizes="114x114">
<link rel="apple-touch-icon-precomposed" href="https://fps.cdnpk.net/favicons/apple-icon-144x144.png" sizes="144x144">
<link rel="preload" href="https://fps.cdnpk.net/common/error-image-left.png" as="image" fetchpriority="high">
<link rel="preload" href="https://fps.cdnpk.net/common/error-image-right.png" as="image" fetchpriority="high">
<link rel="preload" href="https://fps.cdnpk.net/static/inter-regular.woff2" as="font" type="font/woff2"
crossorigin="anonymous">
<link rel="preload" href="https://fps.cdnpk.net/static/inter-semibold.woff2" as="font" type="font/woff2"
crossorigin="anonymous">
<link rel="preload" href="https://fps.cdnpk.net/static/inter-bold.woff2" as="font" type="font/woff2"
crossorigin="anonymous">
<link rel="preload" href="https://fps.cdnpk.net/static/degular-semibold.woff2" as="font" type="font/woff2"
crossorigin="anonymous">
<link rel="preload" href="https://fps.cdnpk.net/common/static-errors.css" as="style" crossorigin="">
<link rel="stylesheet" href="https://fps.cdnpk.net/common/static-errors.css" crossorigin="">
</head>
<body class="_otnfkq0">
<div
class="_17lid5f4 _17lid5f1 _1286nb12il _1286nb128l _1286nb18l _1286nb12v3 _1286nb12uf _1286nb16os _1286nb12sl _1286nb124l _1286nb1255 _1286nb1241 _1286nb12dx _1286nb12nl _1286nb12nh _17lid5f3">
<div class="_1286nb1m _1286nb18l _1286nb12v3 _1286nb12t9 _1286nb12tx">
<h4 class="_17lid5f9 _1286nb12n9 _1286nb12mz _1286nb12r3 _1286nb111 _1286nb11ol">Error</h4>
<div class="_17lid5fi">
<div class="_17lid5ft _17lid5fq _17lid5fr"><img alt="Space Man" fetchpriority="high" width="222" height="276"
decoding="async" class="_1286nb1433 _1286nb1434 _1286nb143n _1286nb1446 _1286nb13jl _1286nb11ox"
src="https://fps.cdnpk.net/common/error-image-left.png"></div><span
class="_17lid5ff _1286nb189 _1286nb12r9 _1286nb11ox">403</span>
<div class="_17lid5fo">
<div class="_17lid5ft _17lid5fq _17lid5fs"><img alt="Space Woman" fetchpriority="high" width="153"
height="317" decoding="async"
class="_1286nb1433 _1286nb1434 _1286nb143n _1286nb1446 _1286nb13jl _1286nb11ox"
src="https://fps.cdnpk.net/common/error-image-right.png"></div>
</div>
</div>
<h4 class="_17lid5f9 _1286nb12n9 _1286nb12mz _1286nb12r3 _1286nb11ox">Access denied
</h4>
<p><b>Reference:</b> 0.9b0a3d17.1751657173.25300774</p>
<p><b>My IP Address:</b> 44.209.150.16</p>
<p style="margin-top: 20px;">You don’t have permission to access this resource. This may be due to restricted
content, insufficient
permissions, or a misconfigured request.</p>
</div>
<p class="_1286nb12nx _1286nb168j _1286nb11b9">If the problem persists, contact our support team <a
class="_1286nb15nj _1286nb15op _1286nb12r3"
href="mailto:support@freepik.com?subject=Error%20500">support@freepik.com</a></p>
</div>
</body>
</html>
Images:
Temporary solution:
This documentation may assist in understanding the issue:
When setting up a connection with the Freepik module, you simply need to input the API key during the connection setup. It's not necessary to add it again in the headers.
For the "Make an API Call" module, the base URL is already set. You just need to enter /v1/ai/text-to-image/imagen3
into the URL field.
I trust this addresses your concern. Please inform me if you encounter any additional difficulties.
Instead of using the full URL https://api.freepik.com/v1/ai/text-to-image/imagen3 , please use just the endpoint /v1/ai/text-to-image/imagen3.
https://api.freříklad.com/ This is already included in the module, so there's no need to add it.