Text to Image Generation
curl --request POST \
--url https://api.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A beautiful sunset over the mountains",
"aspect_ratio": "5:4",
"resolution": "2K"
}
'import requests
url = "https://api.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation"
payload = {
"prompt": "A beautiful sunset over the mountains",
"aspect_ratio": "5:4",
"resolution": "2K"
}
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 the mountains',
aspect_ratio: '5:4',
resolution: '2K'
})
};
fetch('https://api.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation', 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.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation",
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 the mountains',
'aspect_ratio' => '5:4',
'resolution' => '2K'
]),
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.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation"
payload := strings.NewReader("{\n \"prompt\": \"A beautiful sunset over the mountains\",\n \"aspect_ratio\": \"5:4\",\n \"resolution\": \"2K\"\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.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A beautiful sunset over the mountains\",\n \"aspect_ratio\": \"5:4\",\n \"resolution\": \"2K\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation")
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 the mountains\",\n \"aspect_ratio\": \"5:4\",\n \"resolution\": \"2K\"\n}"
response = http.request(request)
puts response.read_body{
"task_info": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "pending",
"created_at": "2025-09-21T00:00:00.000Z",
"updated_at": "2025-09-21T00:00:00.000Z"
}
}Nano Banana Pro
π Nano Banana Pro Image Generation
Generate ultra-sharp images from text prompts using the Gemini Nano-Banana Pro model
POST
/
vendors
/
google
/
v1
/
nano-banana-pro
/
generation
Text to Image Generation
curl --request POST \
--url https://api.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A beautiful sunset over the mountains",
"aspect_ratio": "5:4",
"resolution": "2K"
}
'import requests
url = "https://api.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation"
payload = {
"prompt": "A beautiful sunset over the mountains",
"aspect_ratio": "5:4",
"resolution": "2K"
}
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 the mountains',
aspect_ratio: '5:4',
resolution: '2K'
})
};
fetch('https://api.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation', 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.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation",
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 the mountains',
'aspect_ratio' => '5:4',
'resolution' => '2K'
]),
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.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation"
payload := strings.NewReader("{\n \"prompt\": \"A beautiful sunset over the mountains\",\n \"aspect_ratio\": \"5:4\",\n \"resolution\": \"2K\"\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.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A beautiful sunset over the mountains\",\n \"aspect_ratio\": \"5:4\",\n \"resolution\": \"2K\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mulerouter.ai/vendors/google/v1/nano-banana-pro/generation")
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 the mountains\",\n \"aspect_ratio\": \"5:4\",\n \"resolution\": \"2K\"\n}"
response = http.request(request)
puts response.read_body{
"task_info": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "pending",
"created_at": "2025-09-21T00:00:00.000Z",
"updated_at": "2025-09-21T00:00:00.000Z"
}
}Overview
Generate ultra-sharp, cinematic frames from short text prompts using Googleβs Gemini Nano Banana Pro model. Compared with the base Nano Banana release, the Pro tier unlocks:- Wider aspect ratios (from square up to 21:9 panoramic)
- Higher fidelity presets (
resolutionup to 4K) - Better prompt adherence thanks to an upgraded vision-language alignment stack
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Text to image generation request body
Text prompt for image generation
Aspect ratio of the generated image
Available options:
1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 Output resolution preset (longest side in pixels)
Available options:
1K, 2K Response
202 - application/json
Task created successfully
Show child attributes
Show child attributes

