Generate Image
POST/v1beta/models/gemini-3.1-flash-image-preview:generateContent
VerifiedPublished by Nano Banana 2
curl -X POST https://api.orthogonal.com/v1/run \
-H 'Authorization: Bearer orth_live_••••' \
-H 'Content-Type: application/json' \
-d '{
"api": "nano-banana-2",
"path": "/v1beta/models/gemini-3.1-flash-image-preview:generateContent",
"method": "POST",
"body": {
"contents": [
{
"parts": [
{
"text": ""
}
]
}
]
}
}'
$0.05per call
Every call costs the same.
You aren't charged for failed calls. A wallet payment for a failed call is refunded.
About this endpoint
Generate images with Nano Banana 2 (Gemini 3.1 Flash Image). Pro-quality at Flash speed. Supports text-to-image, image editing, multi-image composition (up to 5 characters, 14 objects). Subject consistency, precise text rendering, and translation.
Body parameters
contentsrequiredarrayArray with one object containing parts. Example: [{"parts": [{"text": "A cute cat wearing a hat"}]}]. For editing, add inlineData: [{"parts": [{"text": "Add a hat"}, {"inlineData": {"mimeType": "image/jpeg", "data": "base64..."}}]}]generationConfigobjectConfig options: responseModalities (["IMAGE"] or ["TEXT","IMAGE"]), imageConfig.aspectRatio (1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, or 21:9)