Gemini 3 Pro 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 Pro Image
Gemini 3 Pro Image VIP 图像生成
Gemini 3 Pro Image VIP 支持文生图和图生图, 最多 14 张参考图.
POST
/
v1
/
images
/
generations
Gemini 3 Pro 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 作为 Base URL, 替换示例中的 https://toapis.com.版本选择
参考图数量指输入图片总数, 不代表输出图片数量. 三个版本使用不同的模型 ID, 请按对应页面的参数和示例调用.当前版本
使用model: "gemini-3-pro-image-preview-vip" 选择 VIP, 支持文生图和最多 14 张参考图的图生图或图像编辑.
适合需要 7 到 14 张参考图的编辑或多图组合. 多图请求可按列表顺序说明各张图片的用途.
请求异步执行, 提交成功后通过任务 ID 查询结果.
image_urls 仅支持图片 URL, 不直接接收 base64. 请先使用 上传图片接口 获取可访问的 URL.认证
请求参数
string
默认值:"gemini-3-pro-image-preview-vip"
必填
固定使用
gemini-3-pro-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".object[]
请求示例
curl --request POST 'https://toapis.com/v1/images/generations' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "gemini-3-pro-image-preview-vip",
"prompt": "保留第一张图的人物, 采用第二张图的背景和配色, 生成一张自然光肖像.",
"size": "1:1",
"n": 1,
"image_urls": [
{"url": "https://example.com/reference-1.png"},
{"url": "https://example.com/reference-2.png"}
],
"metadata": {"resolution": "2K"}
}'
image_urls, 并修改提示词.
查询结果
提交响应中的id 是任务 ID. 使用 图片任务查询接口 获取状态和最终图片.
任务查询和 Webhook 回调 沿用通用异步图片接口约定.