Generate images
curl --request POST \
--url https://api.gately.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A beautiful sunset over a calm ocean",
"n": 1,
"size": "1024x1024",
"model": "dall-e-3"
}
'import requests
url = "https://api.gately.ai/v1/images/generations"
payload = {
"prompt": "A beautiful sunset over a calm ocean",
"n": 1,
"size": "1024x1024",
"model": "dall-e-3"
}
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: 'A beautiful sunset over a calm ocean',
n: 1,
size: '1024x1024',
model: 'dall-e-3'
})
};
fetch('https://api.gately.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gately.ai/v1/images/generations",
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' => 'A beautiful sunset over a calm ocean',
'n' => 1,
'size' => '1024x1024',
'model' => 'dall-e-3'
]),
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 := "https://api.gately.ai/v1/images/generations"
payload := strings.NewReader("{\n \"prompt\": \"A beautiful sunset over a calm ocean\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"model\": \"dall-e-3\"\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("https://api.gately.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A beautiful sunset over a calm ocean\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"model\": \"dall-e-3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gately.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A beautiful sunset over a calm ocean\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"model\": \"dall-e-3\"\n}"
response = http.request(request)
puts response.read_body{
"created": 123,
"data": [
{
"revised_prompt": "<string>",
"url": "<string>"
}
]
}Media
Image Generation
Create images from text descriptions using AI models
POST
/
v1
/
images
/
generations
Generate images
curl --request POST \
--url https://api.gately.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A beautiful sunset over a calm ocean",
"n": 1,
"size": "1024x1024",
"model": "dall-e-3"
}
'import requests
url = "https://api.gately.ai/v1/images/generations"
payload = {
"prompt": "A beautiful sunset over a calm ocean",
"n": 1,
"size": "1024x1024",
"model": "dall-e-3"
}
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: 'A beautiful sunset over a calm ocean',
n: 1,
size: '1024x1024',
model: 'dall-e-3'
})
};
fetch('https://api.gately.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gately.ai/v1/images/generations",
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' => 'A beautiful sunset over a calm ocean',
'n' => 1,
'size' => '1024x1024',
'model' => 'dall-e-3'
]),
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 := "https://api.gately.ai/v1/images/generations"
payload := strings.NewReader("{\n \"prompt\": \"A beautiful sunset over a calm ocean\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"model\": \"dall-e-3\"\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("https://api.gately.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A beautiful sunset over a calm ocean\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"model\": \"dall-e-3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gately.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A beautiful sunset over a calm ocean\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"model\": \"dall-e-3\"\n}"
response = http.request(request)
puts response.read_body{
"created": 123,
"data": [
{
"revised_prompt": "<string>",
"url": "<string>"
}
]
}The Image Generation endpoint allows you to create images from text descriptions using various AI models.
Authentication Required
Learn how to get your API key to use this endpoint
Models
Available models:dall-e-3dall-e-2stable-diffusion-xl
Parameters
string
required
Text description of the desired image
integer
default:"1"
Number of images to generate
string
default:"1024x1024"
Size of the generated images. Options:
1024x1024, 1024x1792, 1792x1024string
default:"standard"
Image quality. Options:
standard, hdstring
default:"natural"
Image style. Options:
natural, vividExample Request
curl --location 'https://api.gately.ai/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"prompt": "a white siamese cat",
"n": 1,
"size": "1024x1024",
"model": "dall-e-3",
"quality": "standard",
"style": "natural"
}'
Example Response
{
"created": 1737411800,
"data": [
{
"revised_prompt": "Visualize a Siamese cat with a predominantly white coat...",
"url": "https://example.com/image.png"
}
]
}
Authorizations
Enter your API key prefixed with 'Bearer '
Body
application/json
Text description of the desired image
Number of images to generate
Available options:
1024x1024, 1024x1792, 1792x1024 Available options:
dall-e-3 Available options:
standard, hd Available options:
natural, vivid Was this page helpful?

