Google AI Studio
Gemini 3 Pro Image (AI Studio)
Google AI Studio text-to-image preview model with 1K/2K/4K output, multi-image reference, Thinking + Search Grounding
Context window65K input / 32K output tokens
ResolutionDefault 1K, optional 2K / 4K, multiple aspect ratios
Reference imagesUp to 14 refs, supports character consistency
ๅฎไปทไธ่งๆ ผ
๐ฐ ๅฎไปท
่พๅ
ฅ$2 / M tokens
่พๅบ$12 / M tokens
โ๏ธ ่งๆ ผ
Context window65K input / 32K output tokens
ResolutionDefault 1K, optional 2K / 4K, multiple aspect ratios
Reference imagesUp to 14 refs, supports character consistency
Key abilitiesSearch Grounding, Thinking reasoning, multi-turn generation/editing
ProviderGoogle AI Studio
API ่ฐ็จ็คบไพ
Python
from google import genai
from google.genai import types
from google.api_core.client_options import ClientOptions
client = genai.Client(
api_key="your-api-key",
client_options=ClientOptions(api_endpoint="https://api.xairouter.com")
)
resp = client.models.generate_content(
model="gemini-3-pro-image-preview",
contents="Create a 2K retro-futuristic night city scene with neon and flying cars",
config=types.GenerateContentConfig(
response_modalities=["IMAGE", "TEXT"],
image_config=types.ImageConfig(
aspect_ratio="16:9",
image_size="2K"
),
tools=[{"google_search": {}}] # optional: Search Grounding
)
)
for part in resp.parts:
if image := part.as_image():
image.save("city.png")
elif part.text:
print(part.text)cURL
curl -X POST \
"https://api.xairouter.com/v1beta/models/gemini-3-pro-image-preview:generateContent" \
-H "x-goog-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"parts":[{"text":"Generate a 1K studio portrait of a tech founder in soft rim light"}]}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {"aspectRatio": "3:4", "imageSize": "1K"}
},
"tools": [{"googleSearch": {}}]
}'