Create image
curl --request POST \
--url https://router.requesty.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "azure/openai/gpt-image-1",
"prompt": "A watercolor painting of a Japanese garden in autumn",
"n": 1,
"size": "1024x1024",
"quality": "auto",
"response_format": "url",
"background": "auto",
"output_format": "png"
}
'import requests
url = "https://router.requesty.ai/v1/images/generations"
payload = {
"model": "azure/openai/gpt-image-1",
"prompt": "A watercolor painting of a Japanese garden in autumn",
"n": 1,
"size": "1024x1024",
"quality": "auto",
"response_format": "url",
"background": "auto",
"output_format": "png"
}
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({
model: 'azure/openai/gpt-image-1',
prompt: 'A watercolor painting of a Japanese garden in autumn',
n: 1,
size: '1024x1024',
quality: 'auto',
response_format: 'url',
background: 'auto',
output_format: 'png'
})
};
fetch('https://router.requesty.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://router.requesty.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([
'model' => 'azure/openai/gpt-image-1',
'prompt' => 'A watercolor painting of a Japanese garden in autumn',
'n' => 1,
'size' => '1024x1024',
'quality' => 'auto',
'response_format' => 'url',
'background' => 'auto',
'output_format' => 'png'
]),
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://router.requesty.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"azure/openai/gpt-image-1\",\n \"prompt\": \"A watercolor painting of a Japanese garden in autumn\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"quality\": \"auto\",\n \"response_format\": \"url\",\n \"background\": \"auto\",\n \"output_format\": \"png\"\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://router.requesty.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"azure/openai/gpt-image-1\",\n \"prompt\": \"A watercolor painting of a Japanese garden in autumn\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"quality\": \"auto\",\n \"response_format\": \"url\",\n \"background\": \"auto\",\n \"output_format\": \"png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://router.requesty.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 \"model\": \"azure/openai/gpt-image-1\",\n \"prompt\": \"A watercolor painting of a Japanese garden in autumn\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"quality\": \"auto\",\n \"response_format\": \"url\",\n \"background\": \"auto\",\n \"output_format\": \"png\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1719000000,
"data": [
{
"url": "<string>",
"b64_json": "<string>"
}
]
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}Create Image
Generate images from a text prompt using image generation models
POST
/
v1
/
images
/
generations
Create image
curl --request POST \
--url https://router.requesty.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "azure/openai/gpt-image-1",
"prompt": "A watercolor painting of a Japanese garden in autumn",
"n": 1,
"size": "1024x1024",
"quality": "auto",
"response_format": "url",
"background": "auto",
"output_format": "png"
}
'import requests
url = "https://router.requesty.ai/v1/images/generations"
payload = {
"model": "azure/openai/gpt-image-1",
"prompt": "A watercolor painting of a Japanese garden in autumn",
"n": 1,
"size": "1024x1024",
"quality": "auto",
"response_format": "url",
"background": "auto",
"output_format": "png"
}
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({
model: 'azure/openai/gpt-image-1',
prompt: 'A watercolor painting of a Japanese garden in autumn',
n: 1,
size: '1024x1024',
quality: 'auto',
response_format: 'url',
background: 'auto',
output_format: 'png'
})
};
fetch('https://router.requesty.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://router.requesty.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([
'model' => 'azure/openai/gpt-image-1',
'prompt' => 'A watercolor painting of a Japanese garden in autumn',
'n' => 1,
'size' => '1024x1024',
'quality' => 'auto',
'response_format' => 'url',
'background' => 'auto',
'output_format' => 'png'
]),
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://router.requesty.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"azure/openai/gpt-image-1\",\n \"prompt\": \"A watercolor painting of a Japanese garden in autumn\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"quality\": \"auto\",\n \"response_format\": \"url\",\n \"background\": \"auto\",\n \"output_format\": \"png\"\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://router.requesty.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"azure/openai/gpt-image-1\",\n \"prompt\": \"A watercolor painting of a Japanese garden in autumn\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"quality\": \"auto\",\n \"response_format\": \"url\",\n \"background\": \"auto\",\n \"output_format\": \"png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://router.requesty.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 \"model\": \"azure/openai/gpt-image-1\",\n \"prompt\": \"A watercolor painting of a Japanese garden in autumn\",\n \"n\": 1,\n \"size\": \"1024x1024\",\n \"quality\": \"auto\",\n \"response_format\": \"url\",\n \"background\": \"auto\",\n \"output_format\": \"png\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1719000000,
"data": [
{
"url": "<string>",
"b64_json": "<string>"
}
]
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}Generate images from a text prompt using OpenAI-compatible image generation models through Requesty’s routing.
Base URL
https://router.requesty.ai/v1/images/generations
Authentication
Include your Requesty API key in the request headers:Authorization: Bearer YOUR_REQUESTY_API_KEY
Example Request
curl https://router.requesty.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
-d '{
"model": "azure/openai/gpt-image-1",
"prompt": "A watercolor painting of a Japanese garden in autumn",
"n": 1,
"size": "1024x1024",
"quality": "auto"
}'
Supported Models
azure/openai/gpt-image-1— OpenAI’s GPT Image 1 model via Azureazure/openai/gpt-image-1.5— OpenAI’s GPT Image 1.5 model via Azure
Transparent Backgrounds
Use thebackground parameter to generate images with transparent backgrounds (useful for logos, icons, and design assets):
curl https://router.requesty.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
-d '{
"model": "azure/openai/gpt-image-1",
"prompt": "A simple icon of a rocket ship",
"background": "transparent",
"output_format": "png"
}'
Error Handling
The API returns standard HTTP status codes:200- Success400- Bad Request (invalid parameters)401- Unauthorized (invalid API key)429- Rate Limited500- Internal Server Error
This endpoint is fully compatible with the OpenAI Images API. You can use the OpenAI SDK’s
client.images.generate() method directly.To edit or extend an existing image instead of generating a new one, use the Edit Image endpoint. For models that generate images as part of a conversational response (e.g., Gemini), use the Chat Completions endpoint instead. See the Image Generation feature guide for a full comparison.
Authorizations
API key for authentication
Body
application/json
The model to use for image generation
Example:
"azure/openai/gpt-image-1"
A text description of the desired image
Example:
"A watercolor painting of a Japanese garden in autumn"
The number of images to generate
Required range:
x >= 1Example:
1
The size of the generated images
Available options:
1024x1024, 1536x1024, 1024x1536 Example:
"1024x1024"
The quality of the generated image
Available options:
auto, high, medium, low Example:
"auto"
The format in which the generated images are returned
Available options:
url, b64_json Example:
"url"
The background type for the generated image
Available options:
auto, transparent, opaque Example:
"auto"
The file format of the generated image
Available options:
png, jpeg, webp Example:
"png"
Last modified on April 29, 2026
Was this page helpful?