Gemini 3.1 Flash Image VIP 画像生成
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"n": 123,
"image_urls": [
{
"url": "<string>"
}
],
"metadata": {
"resolution": "<string>"
}
}
'import requests
url = "https://toapis.com/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"n": 123,
"image_urls": [{ "url": "<string>" }],
"metadata": { "resolution": "<string>" }
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
size: '<string>',
n: 123,
image_urls: [{url: '<string>'}],
metadata: {resolution: '<string>'}
})
};
fetch('https://toapis.com/v1/images/generations', 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://toapis.com/v1/images/generations",
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' => '<string>',
'prompt' => '<string>',
'size' => '<string>',
'n' => 123,
'image_urls' => [
[
'url' => '<string>'
]
],
'metadata' => [
'resolution' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://toapis.com/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"n\": 123,\n \"image_urls\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {\n \"resolution\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://toapis.com/v1/images/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"n\": 123,\n \"image_urls\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {\n \"resolution\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"n\": 123,\n \"image_urls\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {\n \"resolution\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyGemini-3.1-Flash-Image VIP
Gemini 3.1 Flash Image VIP 画像生成
Gemini 3.1 Flash Image VIP はテキストから画像生成と画像から画像生成に対応し、参考画像は最大 14 枚です。
POST
/
v1
/
images
/
generations
Gemini 3.1 Flash Image VIP 画像生成
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"n": 123,
"image_urls": [
{
"url": "<string>"
}
],
"metadata": {
"resolution": "<string>"
}
}
'import requests
url = "https://toapis.com/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"size": "<string>",
"n": 123,
"image_urls": [{ "url": "<string>" }],
"metadata": { "resolution": "<string>" }
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
size: '<string>',
n: 123,
image_urls: [{url: '<string>'}],
metadata: {resolution: '<string>'}
})
};
fetch('https://toapis.com/v1/images/generations', 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://toapis.com/v1/images/generations",
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' => '<string>',
'prompt' => '<string>',
'size' => '<string>',
'n' => 123,
'image_urls' => [
[
'url' => '<string>'
]
],
'metadata' => [
'resolution' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://toapis.com/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"n\": 123,\n \"image_urls\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {\n \"resolution\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://toapis.com/v1/images/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"n\": 123,\n \"image_urls\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {\n \"resolution\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"size\": \"<string>\",\n \"n\": 123,\n \"image_urls\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {\n \"resolution\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body中国本土のユーザー向け: 中国本土のユーザーは
https://toapis.cn を API エンドポイント(Base URL)としてご利用ください。本ドキュメント内の例では https://toapis.com を https://toapis.cn に置き換えてください。バージョンの選択
参考画像の数は入力画像の合計枚数を指し、出力画像の枚数を表すものではありません。3 つのバージョンは異なるモデル ID を使用するため、それぞれのページのパラメータと例に従って呼び出してください。
現在のバージョン
model: "gemini-3.1-flash-image-preview-vip" で VIP を選択すると、テキストから画像生成と、最大 14 枚の参考画像を使った画像から画像生成または画像編集に対応します。
7 から 14 枚の参考画像が必要な編集や複数画像の組み合わせに適しています。複数画像のリクエストでは、リストの順序に従って各画像の用途を説明できます。
リクエストは非同期で実行され、送信に成功したらタスク ID で結果を照会します。
image_urls は画像 URL のみに対応し、base64 を直接受け取りません。先に Upload 画像API でアクセス可能な URL を取得してください。Authorizations
Body
string
デフォルト:"gemini-3.1-flash-image-preview-vip"
必須
gemini-3.1-flash-image-preview-vip に固定です。通常のモデル名やその他のエイリアスが、この VIP ルートに自動で切り替わることはありません。string
必須
生成または編集する画像を説明します。複数の参考画像を指定する場合は、リストの順序に従って各画像の用途を説明できます。
string
画像のアスペクト比。例:
1:1、2:3、3:2、3:4、4:3、4:5、5:4、9:16、16:9、21:9。integer
デフォルト:1
1 リクエストにつき画像を 1 枚生成します。数値の
1 を使用し、文字列の "1" は使用しないでください。object[]
省略可能な参考画像のリストで、最大 14 枚です。テキストから画像生成ではこのフィールドを省略します。
先に Upload 画像API でアクセス可能な画像 URL を取得し、base64 を直接渡さないでください。
例:
表示 参考画像のフィールド
表示 参考画像のフィールド
string
必須
公開アクセス可能な HTTP または HTTPS の画像 URL。
[{"url": "https://example.com/reference-1.png"}, {"url": "https://example.com/reference-2.png"}]。
14 枚は入力参考画像の上限であり、1 回のリクエストで出力される画像の枚数ではありません。リクエスト例
curl --request POST 'https://toapis.com/v1/images/generations' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "gemini-3.1-flash-image-preview-vip",
"prompt": "Keep the person from the first image, adopt the background and color palette from the second image, and generate a natural-light portrait.",
"size": "1:1",
"n": 1,
"image_urls": [
{"url": "https://example.com/reference-1.png"},
{"url": "https://example.com/reference-2.png"}
],
"metadata": {"resolution": "1K"}
}'
image_urls を削除してプロンプトを変更するだけです。
結果の照会
送信レスポンスのid がタスク ID です。画像タスクのステータス取得 でステータスと最終的な画像を取得します。
タスクの照会と Webhook コールバック は、共通の非同期画像エンドポイントの規約に従います。