cURL
curl --request POST \
--url https://api.ttapi.org/gemini/image/generate \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"prompt": "<string>",
"model": "gemini-3-pro-image-preview",
"refer_images": [
"https://cdn.ttapi.io/xxx1.png",
"https://cdn.ttapi.io/xxx2.png"
],
"aspect_ratio": "1:1",
"image_size": "1K",
"google_search": "false",
"image_search": "false"
}
'import requests
url = "https://api.ttapi.org/gemini/image/generate"
payload = {
"prompt": "<string>",
"model": "gemini-3-pro-image-preview",
"refer_images": ["https://cdn.ttapi.io/xxx1.png", "https://cdn.ttapi.io/xxx2.png"],
"aspect_ratio": "1:1",
"image_size": "1K",
"google_search": "false",
"image_search": "false"
}
headers = {
"TT-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'TT-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
model: 'gemini-3-pro-image-preview',
refer_images: ['https://cdn.ttapi.io/xxx1.png', 'https://cdn.ttapi.io/xxx2.png'],
aspect_ratio: '1:1',
image_size: '1K',
google_search: 'false',
image_search: 'false'
})
};
fetch('https://api.ttapi.org/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.ttapi.org/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' => '<string>',
'model' => 'gemini-3-pro-image-preview',
'refer_images' => [
'https://cdn.ttapi.io/xxx1.png',
'https://cdn.ttapi.io/xxx2.png'
],
'aspect_ratio' => '1:1',
'image_size' => '1K',
'google_search' => 'false',
'image_search' => 'false'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"TT-API-KEY: <api-key>"
],
]);
$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.ttapi.org/gemini/image/generate"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"model\": \"gemini-3-pro-image-preview\",\n \"refer_images\": [\n \"https://cdn.ttapi.io/xxx1.png\",\n \"https://cdn.ttapi.io/xxx2.png\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"image_size\": \"1K\",\n \"google_search\": \"false\",\n \"image_search\": \"false\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TT-API-KEY", "<api-key>")
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.ttapi.org/gemini/image/generate")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"model\": \"gemini-3-pro-image-preview\",\n \"refer_images\": [\n \"https://cdn.ttapi.io/xxx1.png\",\n \"https://cdn.ttapi.io/xxx2.png\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"image_size\": \"1K\",\n \"google_search\": \"false\",\n \"image_search\": \"false\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.org/gemini/image/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"model\": \"gemini-3-pro-image-preview\",\n \"refer_images\": [\n \"https://cdn.ttapi.io/xxx1.png\",\n \"https://cdn.ttapi.io/xxx2.png\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"image_size\": \"1K\",\n \"google_search\": \"false\",\n \"image_search\": \"false\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "success",
"data": {
"prompt": "a cute cat",
"refer_images": null,
"image_url": "https://cdn.ttapi.io/other/2025-09-10/8b46aa28-4433-455f-bf5c-f5ccea48baf2.png",
"quota": 2
}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}Nano Banana
Генерация изображения
Генерируйте качественные изображения с помощью Nano Banana API. Включает параметры запроса, форматы ответа и примеры использования.
POST
/
gemini
/
image
/
generate
cURL
curl --request POST \
--url https://api.ttapi.org/gemini/image/generate \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"prompt": "<string>",
"model": "gemini-3-pro-image-preview",
"refer_images": [
"https://cdn.ttapi.io/xxx1.png",
"https://cdn.ttapi.io/xxx2.png"
],
"aspect_ratio": "1:1",
"image_size": "1K",
"google_search": "false",
"image_search": "false"
}
'import requests
url = "https://api.ttapi.org/gemini/image/generate"
payload = {
"prompt": "<string>",
"model": "gemini-3-pro-image-preview",
"refer_images": ["https://cdn.ttapi.io/xxx1.png", "https://cdn.ttapi.io/xxx2.png"],
"aspect_ratio": "1:1",
"image_size": "1K",
"google_search": "false",
"image_search": "false"
}
headers = {
"TT-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'TT-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
model: 'gemini-3-pro-image-preview',
refer_images: ['https://cdn.ttapi.io/xxx1.png', 'https://cdn.ttapi.io/xxx2.png'],
aspect_ratio: '1:1',
image_size: '1K',
google_search: 'false',
image_search: 'false'
})
};
fetch('https://api.ttapi.org/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.ttapi.org/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' => '<string>',
'model' => 'gemini-3-pro-image-preview',
'refer_images' => [
'https://cdn.ttapi.io/xxx1.png',
'https://cdn.ttapi.io/xxx2.png'
],
'aspect_ratio' => '1:1',
'image_size' => '1K',
'google_search' => 'false',
'image_search' => 'false'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"TT-API-KEY: <api-key>"
],
]);
$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.ttapi.org/gemini/image/generate"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"model\": \"gemini-3-pro-image-preview\",\n \"refer_images\": [\n \"https://cdn.ttapi.io/xxx1.png\",\n \"https://cdn.ttapi.io/xxx2.png\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"image_size\": \"1K\",\n \"google_search\": \"false\",\n \"image_search\": \"false\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TT-API-KEY", "<api-key>")
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.ttapi.org/gemini/image/generate")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"model\": \"gemini-3-pro-image-preview\",\n \"refer_images\": [\n \"https://cdn.ttapi.io/xxx1.png\",\n \"https://cdn.ttapi.io/xxx2.png\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"image_size\": \"1K\",\n \"google_search\": \"false\",\n \"image_search\": \"false\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.org/gemini/image/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"model\": \"gemini-3-pro-image-preview\",\n \"refer_images\": [\n \"https://cdn.ttapi.io/xxx1.png\",\n \"https://cdn.ttapi.io/xxx2.png\"\n ],\n \"aspect_ratio\": \"1:1\",\n \"image_size\": \"1K\",\n \"google_search\": \"false\",\n \"image_search\": \"false\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "success",
"data": {
"prompt": "a cute cat",
"refer_images": null,
"image_url": "https://cdn.ttapi.io/other/2025-09-10/8b46aa28-4433-455f-bf5c-f5ccea48baf2.png",
"quota": 2
}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}Поскольку генерация изображений Nano Banana является синхронным ответом и занимает сравнительно много времени, рекомендуется использовать шлюз https://api.ttapi.org.
Доступные модели
| Модели | Псевдоним |
|---|---|
gemini-2.5-flash-image | Nano Banana |
gemini-3-pro-image-preview | Nano Banana Pro |
gemini-3.1-flash-image | Nano Banana 2 |
gemini-3.1-flash-lite-image | Nano Banana 2 Lite |
Авторизации
Вы можете получить API-ключ в панель управления TTAPI.
Тело
application/json
Описание изображения для генерации или изменения
Версия модели
Доступные опции:
gemini-2.5-flash-image, gemini-3-pro-image-preview, gemini-3.1-flash-image, gemini-3.1-flash-lite-image Список эталонных изображений
Пример:
[ "https://cdn.ttapi.io/xxx1.png", "https://cdn.ttapi.io/xxx2.png" ]
Соотношение сторон изображения: Поддерживается только моделями Gemini 3 и более поздних версий.
Соотношения сторон 1:4, 4:1, 1:8 и 8:1 поддерживаются только моделями gemini-3.1-flash-image и gemini-3.1-flash-lite-image.
Доступные опции:
1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1 Разрешение изображения. Примечание: используйте заглавную 'K'
Доступные опции:
512px, 1K, 2K, 4K Включить веб-поиск Google
Включить поиск изображений Google
Уровень размышления
Доступные опции:
Минимальный, Высокий Последнее изменение 7 августа 2026 г.