Submit Nano Banana 2.1 Text to Image 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/text-to-image",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A product photograph of a silver coffee maker in a bright studio.",
"size": "1:1",
"resolution": "1K"
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"model": "google/nano-banana-2.1/text-to-image",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A product photograph of a silver coffee maker in a bright studio.",
"size": "1:1",
"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/text-to-image',
callback_url: 'https://your-domain.com/callback',
input: {
prompt: 'A product photograph of a silver coffee maker in a bright studio.',
size: '1:1',
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/text-to-image',
'callback_url' => 'https://your-domain.com/callback',
'input' => [
'prompt' => 'A product photograph of a silver coffee maker in a bright studio.',
'size' => '1:1',
'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/text-to-image\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A product photograph of a silver coffee maker in a bright studio.\",\n \"size\": \"1:1\",\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/text-to-image\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A product photograph of a silver coffee maker in a bright studio.\",\n \"size\": \"1:1\",\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/text-to-image\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A product photograph of a silver coffee maker in a bright studio.\",\n \"size\": \"1:1\",\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 Text to Image
Generate one image with Nano Banana 2.1 using a text prompt.
POST
/
api
/
generate
/
submit
Submit Nano Banana 2.1 Text to Image 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/text-to-image",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A product photograph of a silver coffee maker in a bright studio.",
"size": "1:1",
"resolution": "1K"
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"model": "google/nano-banana-2.1/text-to-image",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A product photograph of a silver coffee maker in a bright studio.",
"size": "1:1",
"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/text-to-image',
callback_url: 'https://your-domain.com/callback',
input: {
prompt: 'A product photograph of a silver coffee maker in a bright studio.',
size: '1:1',
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/text-to-image',
'callback_url' => 'https://your-domain.com/callback',
'input' => [
'prompt' => 'A product photograph of a silver coffee maker in a bright studio.',
'size' => '1:1',
'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/text-to-image\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A product photograph of a silver coffee maker in a bright studio.\",\n \"size\": \"1:1\",\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/text-to-image\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A product photograph of a silver coffee maker in a bright studio.\",\n \"size\": \"1:1\",\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/text-to-image\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A product photograph of a silver coffee maker in a bright studio.\",\n \"size\": \"1:1\",\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"
}
}- Submit the request with
VIDGO_API_KEY. Atask_idis returned. Keep it until the task reachesfinishedorfailed. - Use Query Task Status to retrieve the result. If you provide a
callback_url, Vidgo sends the result to your webhook when the task finishes or fails.
Nano Banana 2.1 Text to Image
Usage Guide
Generate one image with Nano Banana 2.1 using a text prompt.- Set
modeltogoogle/nano-banana-2.1/text-to-image. - Place
modeland optionalcallback_urlat the request root; place workflow parameters insideinput. - Each request produces one image.
- For reference-image editing, use Image Edit with
model=google/nano-banana-2.1/edit.
Parameter Details
promptis required. Supply non-blank text of up to 20,000 characters.sizedefaults to1:1.
Developer Notes
- Submission is asynchronous. Use the task status endpoint or a completion webhook to retrieve the final image.
- Billing is per output image and depends on
resolution. Text-to-image and editing use the same rate at each tier. - Credits are deducted on submission and refunded if the task fails.
Optional parameters
size(string): Output aspect ratio. Accepted values:1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9. Default:1:1.resolution(string): Output resolution tier. Accepted values:1K,2K,4K. Default:1K.
Authorizations
Use Authorization: Bearer VIDGO_API_KEY.
Body
application/json