Creates an image given a prompt.
curl --request POST \
--url https://api.galadriel.com/v1/images/generations \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "dall-e-3",
"n": 1,
"prompt": "a red apple",
"quality": "standard",
"response_format": "url",
"size": "1024x1024",
"style": "vivid",
"user": "user123"
}
'import requests
url = "https://api.galadriel.com/v1/images/generations"
payload = {
"model": "dall-e-3",
"n": 1,
"prompt": "a red apple",
"quality": "standard",
"response_format": "url",
"size": "1024x1024",
"style": "vivid",
"user": "user123"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'dall-e-3',
n: 1,
prompt: 'a red apple',
quality: 'standard',
response_format: 'url',
size: '1024x1024',
style: 'vivid',
user: 'user123'
})
};
fetch('https://api.galadriel.com/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.galadriel.com/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([
'model' => 'dall-e-3',
'n' => 1,
'prompt' => 'a red apple',
'quality' => 'standard',
'response_format' => 'url',
'size' => '1024x1024',
'style' => 'vivid',
'user' => 'user123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.galadriel.com/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"prompt\": \"a red apple\",\n \"quality\": \"standard\",\n \"response_format\": \"url\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\",\n \"user\": \"user123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.galadriel.com/v1/images/generations")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"prompt\": \"a red apple\",\n \"quality\": \"standard\",\n \"response_format\": \"url\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\",\n \"user\": \"user123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galadriel.com/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"prompt\": \"a red apple\",\n \"quality\": \"standard\",\n \"response_format\": \"url\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\",\n \"user\": \"user123\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1,
"data": [
{
"b64_json": null,
"revised_prompt": null,
"url": "https://example.com/image"
}
]
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
{
"response": "NOK",
"error": {
"status_code": 429,
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded"
}
}
{
"response": "NOK",
"error": {
"status_code": 503,
"code": "no_available_inference_nodes",
"message": "No available inference nodes to process the request."
}
}
Image Generation API
Tap into Galadriel’s image generation network. Follows the same schema as OpenAI’s image generation API.
POST
/
v1
/
images
/
generations
Creates an image given a prompt.
curl --request POST \
--url https://api.galadriel.com/v1/images/generations \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "dall-e-3",
"n": 1,
"prompt": "a red apple",
"quality": "standard",
"response_format": "url",
"size": "1024x1024",
"style": "vivid",
"user": "user123"
}
'import requests
url = "https://api.galadriel.com/v1/images/generations"
payload = {
"model": "dall-e-3",
"n": 1,
"prompt": "a red apple",
"quality": "standard",
"response_format": "url",
"size": "1024x1024",
"style": "vivid",
"user": "user123"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'dall-e-3',
n: 1,
prompt: 'a red apple',
quality: 'standard',
response_format: 'url',
size: '1024x1024',
style: 'vivid',
user: 'user123'
})
};
fetch('https://api.galadriel.com/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.galadriel.com/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([
'model' => 'dall-e-3',
'n' => 1,
'prompt' => 'a red apple',
'quality' => 'standard',
'response_format' => 'url',
'size' => '1024x1024',
'style' => 'vivid',
'user' => 'user123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.galadriel.com/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"prompt\": \"a red apple\",\n \"quality\": \"standard\",\n \"response_format\": \"url\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\",\n \"user\": \"user123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.galadriel.com/v1/images/generations")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"prompt\": \"a red apple\",\n \"quality\": \"standard\",\n \"response_format\": \"url\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\",\n \"user\": \"user123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galadriel.com/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"prompt\": \"a red apple\",\n \"quality\": \"standard\",\n \"response_format\": \"url\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\",\n \"user\": \"user123\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1,
"data": [
{
"b64_json": null,
"revised_prompt": null,
"url": "https://example.com/image"
}
]
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
{
"response": "NOK",
"error": {
"status_code": 429,
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded"
}
}
{
"response": "NOK",
"error": {
"status_code": 503,
"code": "no_available_inference_nodes",
"message": "No available inference nodes to process the request."
}
}
{
"created": 1,
"data": [
{
"b64_json": null,
"revised_prompt": null,
"url": "https://example.com/image"
}
]
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
{
"response": "NOK",
"error": {
"status_code": 429,
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded"
}
}
{
"response": "NOK",
"error": {
"status_code": 503,
"code": "no_available_inference_nodes",
"message": "No available inference nodes to process the request."
}
}
Authorizations
Bearer authentication header.
example value: Bearer Galadriel-API-key
Get API key from Galadriel dashboard.
Body
application/json
text description of the desired image(s).
The model to use for image generation.
The number of images to generate. Must be between 1 and 10.
Required range:
1 <= x <= 10The quality of the image that will be generated.
Available options:
standard, hd The format in which the generated images are returned.
Available options:
url, b64_json The size of the generated images.
Available options:
256x256, 512x512, 1024x1024 The style of the generated images.
Available options:
vivid, natural A unique identifier representing your end-user

