curl --request POST \
--url https://api.mountsea.ai/gemini/image/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A fluffy orange cat running through a sunny meadow",
"action": "generate",
"num_images": 1,
"image_urls": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
],
"aspect_ratio": "1:1",
"model": "nano-banana-fast",
"resolution": "1K"
}
'import requests
url = "https://api.mountsea.ai/gemini/image/generate"
payload = {
"prompt": "A fluffy orange cat running through a sunny meadow",
"action": "generate",
"num_images": 1,
"image_urls": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
"aspect_ratio": "1:1",
"model": "nano-banana-fast",
"resolution": "1K"
}
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 fluffy orange cat running through a sunny meadow',
action: 'generate',
num_images: 1,
image_urls: ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'],
aspect_ratio: '1:1',
model: 'nano-banana-fast',
resolution: '1K'
})
};
fetch('https://api.mountsea.ai/gemini/image/generate', 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.mountsea.ai/gemini/image/generate",
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 fluffy orange cat running through a sunny meadow',
'action' => 'generate',
'num_images' => 1,
'image_urls' => [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg'
],
'aspect_ratio' => '1:1',
'model' => 'nano-banana-fast',
'resolution' => '1K'
]),
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.mountsea.ai/gemini/image/generate"
payload := strings.NewReader("{\n \"prompt\": \"A fluffy orange cat running through a sunny meadow\",\n \"action\": \"generate\",\n \"num_images\": 1,\n \"image_urls\": [\n \"https://example.com/image1.jpg\",\n \"https://example.com/image2.jpg\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"model\": \"nano-banana-fast\",\n \"resolution\": \"1K\"\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.mountsea.ai/gemini/image/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A fluffy orange cat running through a sunny meadow\",\n \"action\": \"generate\",\n \"num_images\": 1,\n \"image_urls\": [\n \"https://example.com/image1.jpg\",\n \"https://example.com/image2.jpg\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"model\": \"nano-banana-fast\",\n \"resolution\": \"1K\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mountsea.ai/gemini/image/generate")
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 fluffy orange cat running through a sunny meadow\",\n \"action\": \"generate\",\n \"num_images\": 1,\n \"image_urls\": [\n \"https://example.com/image1.jpg\",\n \"https://example.com/image2.jpg\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"model\": \"nano-banana-fast\",\n \"resolution\": \"1K\"\n}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>"
}Banana 图像生成
Nano Banana image generation, capable of image creation and editing.
curl --request POST \
--url https://api.mountsea.ai/gemini/image/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A fluffy orange cat running through a sunny meadow",
"action": "generate",
"num_images": 1,
"image_urls": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
],
"aspect_ratio": "1:1",
"model": "nano-banana-fast",
"resolution": "1K"
}
'import requests
url = "https://api.mountsea.ai/gemini/image/generate"
payload = {
"prompt": "A fluffy orange cat running through a sunny meadow",
"action": "generate",
"num_images": 1,
"image_urls": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"],
"aspect_ratio": "1:1",
"model": "nano-banana-fast",
"resolution": "1K"
}
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 fluffy orange cat running through a sunny meadow',
action: 'generate',
num_images: 1,
image_urls: ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'],
aspect_ratio: '1:1',
model: 'nano-banana-fast',
resolution: '1K'
})
};
fetch('https://api.mountsea.ai/gemini/image/generate', 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.mountsea.ai/gemini/image/generate",
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 fluffy orange cat running through a sunny meadow',
'action' => 'generate',
'num_images' => 1,
'image_urls' => [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg'
],
'aspect_ratio' => '1:1',
'model' => 'nano-banana-fast',
'resolution' => '1K'
]),
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.mountsea.ai/gemini/image/generate"
payload := strings.NewReader("{\n \"prompt\": \"A fluffy orange cat running through a sunny meadow\",\n \"action\": \"generate\",\n \"num_images\": 1,\n \"image_urls\": [\n \"https://example.com/image1.jpg\",\n \"https://example.com/image2.jpg\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"model\": \"nano-banana-fast\",\n \"resolution\": \"1K\"\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.mountsea.ai/gemini/image/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A fluffy orange cat running through a sunny meadow\",\n \"action\": \"generate\",\n \"num_images\": 1,\n \"image_urls\": [\n \"https://example.com/image1.jpg\",\n \"https://example.com/image2.jpg\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"model\": \"nano-banana-fast\",\n \"resolution\": \"1K\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mountsea.ai/gemini/image/generate")
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 fluffy orange cat running through a sunny meadow\",\n \"action\": \"generate\",\n \"num_images\": 1,\n \"image_urls\": [\n \"https://example.com/image1.jpg\",\n \"https://example.com/image2.jpg\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"model\": \"nano-banana-fast\",\n \"resolution\": \"1K\"\n}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>"
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
The prompt which used to generate the images
"A fluffy orange cat running through a sunny meadow"
Action type: edit (modify existing images) or generate (create new images)
edit, generate "generate"
only support generate 1 image, default is 1
Link to the picture that needs to be edited. It can be a accessible http or https url, The image size should not exceed 10MB for each. If the action is edit, this parameter is required.
[
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
]
The aspect ratio of the image, nano-banana-2 supports all aspect ratios, other models only support 21:9, 1:1, 4:3, 3:2, 2:3, 5:4, 4:5, 3:4, 16:9, 9:16
21:9, 1:1, 4:3, 3:2, 2:3, 5:4, 4:5, 3:4, 16:9, 9:16, 1:4, 4:1, 1:8, 8:1 "1:1"
The model of the image, default is NanoBananaFast
nano-banana-fast, nano-banana-pro, nano-banana-2, nano-banana-2-lite "nano-banana-fast"
The resolution of the image, only valid when model is nano-banana-pro or nano-banana-2
1K, 2K, 4K "1K"
响应
task id, used to get task result later