Submit Nano Banana 2.1 Image Edit Task
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/nano-banana-2.1/edit",
"input": {
"prompt": "Preserve the product and replace the background with a warm modern studio.",
"image_urls": [
"https://cdn.vidgo.ai/temp/reference-product.png"
],
"size": "auto",
"resolution": "1K"
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"model": "google/nano-banana-2.1/edit",
"input": {
"prompt": "Preserve the product and replace the background with a warm modern studio.",
"image_urls": ["https://cdn.vidgo.ai/temp/reference-product.png"],
"size": "auto",
"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({
model: 'google/nano-banana-2.1/edit',
input: {
prompt: 'Preserve the product and replace the background with a warm modern studio.',
image_urls: ['https://cdn.vidgo.ai/temp/reference-product.png'],
size: 'auto',
resolution: '1K'
}
})
};
fetch('https://api.vidgo.ai/api/generate/submit', 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.vidgo.ai/api/generate/submit",
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' => 'google/nano-banana-2.1/edit',
'input' => [
'prompt' => 'Preserve the product and replace the background with a warm modern studio.',
'image_urls' => [
'https://cdn.vidgo.ai/temp/reference-product.png'
],
'size' => 'auto',
'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.vidgo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"google/nano-banana-2.1/edit\",\n \"input\": {\n \"prompt\": \"Preserve the product and replace the background with a warm modern studio.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/temp/reference-product.png\"\n ],\n \"size\": \"auto\",\n \"resolution\": \"1K\"\n }\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.vidgo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"google/nano-banana-2.1/edit\",\n \"input\": {\n \"prompt\": \"Preserve the product and replace the background with a warm modern studio.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/temp/reference-product.png\"\n ],\n \"size\": \"auto\",\n \"resolution\": \"1K\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidgo.ai/api/generate/submit")
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\": \"google/nano-banana-2.1/edit\",\n \"input\": {\n \"prompt\": \"Preserve the product and replace the background with a warm modern studio.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/temp/reference-product.png\"\n ],\n \"size\": \"auto\",\n \"resolution\": \"1K\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "running",
"created_time": "2026-10-09T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}Google
Nano Banana 2.1 Image Edit
Edit one image with Nano Banana 2.1 using text instructions and reference images.
POST
/
api
/
generate
/
submit
Submit Nano Banana 2.1 Image Edit Task
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/nano-banana-2.1/edit",
"input": {
"prompt": "Preserve the product and replace the background with a warm modern studio.",
"image_urls": [
"https://cdn.vidgo.ai/temp/reference-product.png"
],
"size": "auto",
"resolution": "1K"
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"model": "google/nano-banana-2.1/edit",
"input": {
"prompt": "Preserve the product and replace the background with a warm modern studio.",
"image_urls": ["https://cdn.vidgo.ai/temp/reference-product.png"],
"size": "auto",
"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({
model: 'google/nano-banana-2.1/edit',
input: {
prompt: 'Preserve the product and replace the background with a warm modern studio.',
image_urls: ['https://cdn.vidgo.ai/temp/reference-product.png'],
size: 'auto',
resolution: '1K'
}
})
};
fetch('https://api.vidgo.ai/api/generate/submit', 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.vidgo.ai/api/generate/submit",
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' => 'google/nano-banana-2.1/edit',
'input' => [
'prompt' => 'Preserve the product and replace the background with a warm modern studio.',
'image_urls' => [
'https://cdn.vidgo.ai/temp/reference-product.png'
],
'size' => 'auto',
'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.vidgo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"google/nano-banana-2.1/edit\",\n \"input\": {\n \"prompt\": \"Preserve the product and replace the background with a warm modern studio.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/temp/reference-product.png\"\n ],\n \"size\": \"auto\",\n \"resolution\": \"1K\"\n }\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.vidgo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"google/nano-banana-2.1/edit\",\n \"input\": {\n \"prompt\": \"Preserve the product and replace the background with a warm modern studio.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/temp/reference-product.png\"\n ],\n \"size\": \"auto\",\n \"resolution\": \"1K\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidgo.ai/api/generate/submit")
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\": \"google/nano-banana-2.1/edit\",\n \"input\": {\n \"prompt\": \"Preserve the product and replace the background with a warm modern studio.\",\n \"image_urls\": [\n \"https://cdn.vidgo.ai/temp/reference-product.png\"\n ],\n \"size\": \"auto\",\n \"resolution\": \"1K\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "running",
"created_time": "2026-10-09T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}- After submission, a
task_idwill be returned. If you provided acallback_url, when the task status becomesfinishedorfailed, a POST request will be sent to thecallback_url. - Regardless of whether
callback_urlis provided, you can retrieve the result through the unified Query Task Status endpoint.
Optional parameters
size(string): Output aspect ratio. auto follows the reference image. Accepted values:auto,1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9. Default:auto.resolution(string): Output resolution tier. Accepted values:1K,2K,4K. Default:1K.
Usage Guide
Edit one image with Nano Banana 2.1 using text instructions and reference images.- Set
modeltogoogle/nano-banana-2.1/edit. - Place
modeland optionalcallback_urlat the request root; place workflow parameters insideinput. - Each request produces one image.
- For prompt-only generation, use Text to Image with
model=google/nano-banana-2.1/text-to-image.
Parameter Details
promptis required. Supply non-blank text of up to 20,000 characters.image_urlsis required and accepts 1 to 10 reference image URLs. Use publicly accessible HTTP(S) URLs in the same order as the references in your prompt.sizedefaults toauto.autofollows the reference image aspect ratio.
Billing
Billing is per output image and depends onresolution. Text-to-image and editing use the same rate at each tier.
Credits are deducted on submission and refunded if the task fails.Body
application/json