Runbase

Command Palette

Search for a command to run...

Gemini

Nano Banana 2.1

ID:google/nano-banana-2.1

API tạo ảnh Nano Banana 2.1 của Google — model ảnh Gemini Flash được nâng cấp về thiết kế hình ảnh, chỉnh sửa và tính nhất quán của chủ thể, tối đa 4K với 14 ảnh tham chiếu.

Nano Banana 2.1Gemini ImageGoogleChỉnh sửa ảnh4K

Tổng quan

API tạo ảnh Nano Banana 2.1 của Google — model ảnh Gemini Flash được nâng cấp về thiết kế hình ảnh, chỉnh sửa và tính nhất quán của chủ thể, tối đa 4K với 14 ảnh tham chiếu.

Xác thực

Tất cả request API yêu cầu khóa API hợp lệ được truyền qua header Authorization sử dụng scheme Bearer.

Bắt đầu nhanh

Thông tin xác thực

Đặt biến môi trường RUNBASE_API_KEY.

Shell
export RUNBASE_API_KEY=your-api-key

Tạo lượt chạy

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.1",
    "input": {
      "prompt": "A cinematic product photo of a ceramic lamp"
    }
  }'

Lượt chạy

Các lượt chạy được xử lý bất đồng bộ. Gửi request, sau đó poll để lấy kết quả.

Tạo lượt chạy

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.1",
    "input": { "prompt": "A cinematic product photo of a ceramic lamp" }
  }'

Lấy trạng thái lượt chạy

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

Lấy kết quả

Poll endpoint trạng thái cho đến khi status là "succeeded", sau đó đọc output.urls từ response.

Schema đầu vào

Tham sốLoạiBắt buộcMô tả
promptstringBắt buộcPromptTối đa 20000 ký tự
aspect_ratiostringTùy chọnAspect ratioTùy chọn: 1:11:41:82:33:23:44:14:34:55:48:19:1616:921:9autoMặc định: 1:1
resolutionstringTùy chọnResolutionTùy chọn: 1K2K4KMặc định: 1K
image_urlsstring[]Tùy chọnReference imagesTối đa 14 ảnh

Schema đầu ra

TrườngLoạiMô tả
urlsstring[]URL đầu ra đã tạo

Lỗi

API sử dụng mã trạng thái HTTP tiêu chuẩn để biểu thị thành công hoặc thất bại.

Mã trạng tháiMô tả
400Invalid request - missing or malformed parameters
401Authentication failed - missing or invalid API key
402Insufficient credits
403Forbidden - IP not allowed, account banned, or API key credit limit exceeded
404Run not found
429Rate limit exceeded
500Internal server error