Create Ai Generated Image
curl --request POST \
--url http://localhost:8000/api/v1/media/integrations/freepik/generated-images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"size": "square_1_1",
"guidance_scale": 1,
"filter_nsfw": true,
"style": "<string>",
"negative_prompt": "<string>",
"seed": 500000,
"tags": [
"<string>"
],
"alt_text": "<string>"
}
'import requests
url = "http://localhost:8000/api/v1/media/integrations/freepik/generated-images"
payload = {
"prompt": "<string>",
"size": "square_1_1",
"guidance_scale": 1,
"filter_nsfw": True,
"style": "<string>",
"negative_prompt": "<string>",
"seed": 500000,
"tags": ["<string>"],
"alt_text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
size: 'square_1_1',
guidance_scale: 1,
filter_nsfw: true,
style: '<string>',
negative_prompt: '<string>',
seed: 500000,
tags: ['<string>'],
alt_text: '<string>'
})
};
fetch('http://localhost:8000/api/v1/media/integrations/freepik/generated-images', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/media/integrations/freepik/generated-images",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'size' => 'square_1_1',
'guidance_scale' => 1,
'filter_nsfw' => true,
'style' => '<string>',
'negative_prompt' => '<string>',
'seed' => 500000,
'tags' => [
'<string>'
],
'alt_text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/v1/media/integrations/freepik/generated-images"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"size\": \"square_1_1\",\n \"guidance_scale\": 1,\n \"filter_nsfw\": true,\n \"style\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"seed\": 500000,\n \"tags\": [\n \"<string>\"\n ],\n \"alt_text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/media/integrations/freepik/generated-images")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"size\": \"square_1_1\",\n \"guidance_scale\": 1,\n \"filter_nsfw\": true,\n \"style\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"seed\": 500000,\n \"tags\": [\n \"<string>\"\n ],\n \"alt_text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/media/integrations/freepik/generated-images")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"size\": \"square_1_1\",\n \"guidance_scale\": 1,\n \"filter_nsfw\": true,\n \"style\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"seed\": 500000,\n \"tags\": [\n \"<string>\"\n ],\n \"alt_text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"filename": "<string>",
"url": "<string>",
"file_size": 123,
"mime_type": "<string>",
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"width": 123,
"height": 123,
"external_id": "<string>",
"external_metadata": {},
"tags": [
"<string>"
],
"alt_text": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Media
Create Ai Generated Image
POST
/
api
/
v1
/
media
/
integrations
/
freepik
/
generated-images
Create Ai Generated Image
curl --request POST \
--url http://localhost:8000/api/v1/media/integrations/freepik/generated-images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"size": "square_1_1",
"guidance_scale": 1,
"filter_nsfw": true,
"style": "<string>",
"negative_prompt": "<string>",
"seed": 500000,
"tags": [
"<string>"
],
"alt_text": "<string>"
}
'import requests
url = "http://localhost:8000/api/v1/media/integrations/freepik/generated-images"
payload = {
"prompt": "<string>",
"size": "square_1_1",
"guidance_scale": 1,
"filter_nsfw": True,
"style": "<string>",
"negative_prompt": "<string>",
"seed": 500000,
"tags": ["<string>"],
"alt_text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
size: 'square_1_1',
guidance_scale: 1,
filter_nsfw: true,
style: '<string>',
negative_prompt: '<string>',
seed: 500000,
tags: ['<string>'],
alt_text: '<string>'
})
};
fetch('http://localhost:8000/api/v1/media/integrations/freepik/generated-images', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/media/integrations/freepik/generated-images",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'size' => 'square_1_1',
'guidance_scale' => 1,
'filter_nsfw' => true,
'style' => '<string>',
'negative_prompt' => '<string>',
'seed' => 500000,
'tags' => [
'<string>'
],
'alt_text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/v1/media/integrations/freepik/generated-images"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"size\": \"square_1_1\",\n \"guidance_scale\": 1,\n \"filter_nsfw\": true,\n \"style\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"seed\": 500000,\n \"tags\": [\n \"<string>\"\n ],\n \"alt_text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/media/integrations/freepik/generated-images")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"size\": \"square_1_1\",\n \"guidance_scale\": 1,\n \"filter_nsfw\": true,\n \"style\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"seed\": 500000,\n \"tags\": [\n \"<string>\"\n ],\n \"alt_text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/media/integrations/freepik/generated-images")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"size\": \"square_1_1\",\n \"guidance_scale\": 1,\n \"filter_nsfw\": true,\n \"style\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"seed\": 500000,\n \"tags\": [\n \"<string>\"\n ],\n \"alt_text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"filename": "<string>",
"url": "<string>",
"file_size": 123,
"mime_type": "<string>",
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"width": 123,
"height": 123,
"external_id": "<string>",
"external_metadata": {},
"tags": [
"<string>"
],
"alt_text": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Query Parameters
Company ID
Body
application/json
Text prompt for image generation
Required string length:
3 - 1000Image aspect ratio (square_1_1, classic_4_3, traditional_3_4, widescreen_16_9, social_story_9_16)
Available options:
square_1_1, classic_4_3, traditional_3_4, widescreen_16_9, social_story_9_16 How closely to follow the prompt (0.0-2.0)
Required range:
0 <= x <= 2Filter NSFW content
Optional style modifier (e.g., 'anime', 'photo', 'digital-art', '3d', 'painting')
What to avoid in the image (min 3 chars)
Minimum string length:
3Seed for reproducibility (0-1000000)
Required range:
0 <= x <= 1000000Optional tags for the generated image
Optional alt text for accessibility
Response
Successful Response
Available options:
upload, stock, ai_generated ⌘I