Skip to main content

Body

Generate image only social media post with no text.
size
string
Enter ratios 1:1 4:5 9:16 or 16:9
guildlines
string
Any guildlines to consider while generating the post. Example: No political posts
theme
string
Your desired theme for image generation. Example: light blue
image
string
Your image URL or use “generated” to generate image from text
source
string
Source text to generate social media post from. Example: “Hello World”

Response

only_image_post
string
The post URL.
curl -X POST \
  <BASE_URL>/only-image \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{
    "size": "4:5",
    "guidelines": "No political content",
    "theme": "light blue",
    "image": "generated",
    "source": "hello word"
}'

<?php
$url = '<BASE_URL>/only-image';
$data = array(
    "size" => "4:5",
    "guidelines" => "No political content",
    "theme" => "light blue",
    "image" => "generated",
    "source" => "hello word"
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'X-API-Key: YOUR_API_KEY'
));

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

import requests

url = '<BASE_URL>/only-image'
headers = {
    'Content-Type': 'application/json',
    'X-API-Key': 'YOUR_API_KEY'
}
data = {
    "size": "4:5",
    "guidelines": "No political content",
    "theme": "light blue",
    "image": "generated",
    "source": "hello word"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

const url = '<BASE_URL>/only-image';
const headers = {
    'Content-Type': 'application/json',
    'X-API-Key': 'YOUR_API_KEY'
};
const data = {
    "size": "4:5",
    "guidelines": "No political content",
    "theme": "light blue",
    "image": "generated",
    "source": "hello word"
};

fetch(url, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

{
  "only_image_post": "https://ai.contentify.app/some-image.jpg",
}