Runbase

Command Palette

Search for a command to run...

Gemini

Nano Banana 2

ID:google/nano-banana-2

Nano Banana 2 image generation API by Google — Gemini 3.1 Flash with 4K output, 15 aspect ratios, and character consistency for up to 5 characters.

Text to imageImage editingReference images4KText rendering

Overview

Nano Banana 2 image generation API by Google — Gemini 3.1 Flash with 4K output, 15 aspect ratios, and character consistency for up to 5 characters.

Authentication

All API requests require a valid API key passed via the Authorization header using the Bearer scheme.

Quickstart

Credentials

Set the RUNBASE_API_KEY environment variable.

Shell
export RUNBASE_API_KEY=your-api-key

Create a run

Shell
curl -s https://runbase.net/api/v1/runs \
  -H "Authorization: Bearer $RUNBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/nano-banana-2",
    "input": {
      "prompt": "A cinematic product photo of a ceramic lamp"
    }
  }'

Runs

Runs are processed asynchronously. Submit a request, then poll for the result.

Create a run

Shell
curl -s https://runbase.net/api/v1/runs \
  -H "Authorization: Bearer $RUNBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/nano-banana-2",
    "input": { "prompt": "A cinematic product photo of a ceramic lamp" }
  }'

Get run status

Shell
curl -s https://runbase.net/api/v1/runs/RUN_ID \
  -H "Authorization: Bearer $RUNBASE_API_KEY"

Get result

Poll the status endpoint until status is "succeeded", then read output.urls from the response.

Input Schema

ParameterTypeRequiredDescription
promptstringRequiredPrompt
aspect_ratiostringOptionalAspect ratioOptions: 1:11:41:82:33:23:44:14:34:55:48:19:1616:921:9auto
resolutionstringOptionalResolutionOptions: 1K2K4K
image_urlsstring[]OptionalReference images

Output Schema

FieldTypeDescription
urlsstring[]Generated output URLs

Errors

The API uses standard HTTP status codes to indicate success or failure.

Status CodeDescription
400잘못된 요청 - 매개변수가 누락되었거나 형식이 올바르지 않습니다
401인증 실패 - API 키가 누락되었거나 유효하지 않습니다
402크레딧 부족
403접근 거부 - IP가 허용되지 않았거나 API 키 지출 한도 초과
404실행을 찾을 수 없습니다
429요청 속도 제한 초과
500내부 서버 오류