Nano Banana 画像生成
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/nano-banana \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art",
"image_size": "1:1",
"output_format": "png"
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/nano-banana"
payload = {
"prompt": "A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art",
"image_size": "1:1",
"output_format": "png"
}
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 surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art',
image_size: '1:1',
output_format: 'png'
})
};
fetch('https://api.sinancode.com/v1/generate/k/nano-banana', 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.sinancode.com/v1/generate/k/nano-banana",
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 surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art',
'image_size' => '1:1',
'output_format' => 'png'
]),
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.sinancode.com/v1/generate/k/nano-banana"
payload := strings.NewReader("{\n \"prompt\": \"A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\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.sinancode.com/v1/generate/k/nano-banana")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/nano-banana")
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 surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}画像生成 - Nano Banana
Nano Banana テキストから画像
Nano Banana モデルを使用して画像を生成します(非同期)
POST
/
generate
/
k
/
nano-banana
Nano Banana 画像生成
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/nano-banana \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art",
"image_size": "1:1",
"output_format": "png"
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/nano-banana"
payload = {
"prompt": "A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art",
"image_size": "1:1",
"output_format": "png"
}
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 surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art',
image_size: '1:1',
output_format: 'png'
})
};
fetch('https://api.sinancode.com/v1/generate/k/nano-banana', 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.sinancode.com/v1/generate/k/nano-banana",
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 surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art',
'image_size' => '1:1',
'output_format' => 'png'
]),
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.sinancode.com/v1/generate/k/nano-banana"
payload := strings.NewReader("{\n \"prompt\": \"A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\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.sinancode.com/v1/generate/k/nano-banana")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/nano-banana")
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 surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}Google DeepMind の Nano Banana (Gemini 2.5 Flash) モデルを使用してテキストから画像を生成します。
モデルの特徴:
- 高速生成 - Gemini 2.5 Flash ベースで高速生成
- コストパフォーマンス - 低コストで大量生成に最適
- 1K 解像度 - 最大 1024x1024 ピクセル出力をサポート
- 優れた理解力 - Gemini の意味理解と推論能力を継承
承認
API Tokenを使用して認証を行ってください
ボディ
application/json
タスクパラメータ
プロンプト(必須、最大5000文字)- 画像生成のテキスト記述
Required string length:
1 - 5000例:
"A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art"
画像サイズ(オプション、デフォルト 1:1)- 画像アスペクト比
利用可能なオプション:
1:1, 9:16, 16:9, 3:4, 4:3, 3:2, 2:3, 5:4, 4:5, 21:9, auto 例:
"1:1"
出力形式(オプション)- 画像出力形式
利用可能なオプション:
png, jpeg 例:
"png"
レスポンス
OK
タスクID
例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I