Direct
Direct upstream connection — best when you need native behavior and the full context window.
| Input | Output |
|---|---|
| 0.50/M | 60.00/M |

gemini-3.1-flash-image-previewGemini 3.1 Flash image preview, also known as "Nano Banana 2", is Google's latest state-of-the-art image generation and editing model, delivering professional-grade visual quality at Flash speed. It combines advanced contextual understanding with fast, cost-efficient inference, making complex image generation and iterative editing more accessible than ever.
The same model is available through multiple service channels — choose based on latency, reliability and cost.
Prices in $ / 1M tokensprovider field to the request body, for example "provider": { "channel": "direct" }. Valid values are direct / stable / economical; omit it to use the default channel.Direct upstream connection — best when you need native behavior and the full context window.
| Input | Output |
|---|---|
| 0.50/M | 60.00/M |
gemini-3.1-flash-image-previewhttps://api.seawhaleai.com/v2/images/generationsThe SeaWhale AI image generation endpoint is compatible with the OpenAI Images API and can be called with standard HTTP requests.
curl https://api.seawhaleai.com/v2/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "gemini-3.1-flash-image-preview",
"prompt": "A cute kitten playing in the sunshine",
"aspect_ratio": "1:1"
}'import requests
url = "https://api.seawhaleai.com/v2/images/generations"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>",
}
payload = {
"model": "gemini-3.1-flash-image-preview",
"prompt": "A cute kitten playing in the sunshine",
"aspect_ratio": "1:1",
}
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
data = response.json()
print(data["data"][0]["url"])const response = await fetch('https://api.seawhaleai.com/v2/images/generations', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <API_KEY>',
},
body: JSON.stringify({
model: 'gemini-3.1-flash-image-preview',
prompt: 'A cute kitten playing in the sunshine',
aspect_ratio: '1:1',
}),
})
const data = await response.json()
console.log(data.data[0].url)