Nano Banana 2.1 Image Generation

Nano Banana 2.1 Image Generation

Generate and edit images with Nano Banana 2.1, up to six reference images, and 1K, 2K, or 4K output

Tool Identifier

nano-banana-image-2.1-api

Use POST /api/un-api/create_tool_task with an API key and an active membership. Supports text-to-image generation and editing with reference images.

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYes—Non-empty image generation or editing instructions
image_liststring[]No[]Up to 6 publicly accessible, complete HTTP/HTTPS image URLs without embedded credentials
aspect_ratiostringNoautoauto, 1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 2:3, 3:2, 4:5, 5:4
resolutionstringNo1K1K, 2K, or 4K

Unsupported aspect ratios or resolutions are rejected with error_code: 400. Unlimited mode is not available through this API.

Pricing

ResolutionCredits per image
1K / 2K38
4K75

Request Examples

Text-to-Image

curl -X POST https://sjinn.ai/api/un-api/create_tool_task \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool_type": "nano-banana-image-2.1-api",
    "input": {
      "prompt": "A red fox in a snowy forest, natural morning light",
      "aspect_ratio": "16:9",
      "resolution": "2K"
    }
  }'

Image Editing

const response = await fetch('https://sjinn.ai/api/un-api/create_tool_task', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    tool_type: 'nano-banana-image-2.1-api',
    input: {
      prompt: 'Keep the subject and replace the background with a snowy forest',
      image_list: ['https://cdn.sjinn.ai/uploads/reference.jpg'],
      aspect_ratio: '4:5',
      resolution: '4K',
    },
  }),
});
const result = await response.json();
if (!result.success) throw new Error(result.errorMsg);
console.log(result.data.task_id);

Response and Task Status

{
  "success": true,
  "errorMsg": "",
  "error_code": 0,
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Save the returned task_id and poll Query Task Status. Status 0 means pending, 1 means completed, and 2 means failed. Completed images are returned in data.output_urls.

Creation can take several minutes. Allow a long client timeout. If creation returns a task ID, continue polling that task instead of creating it again. An uncertain provider response leaves the task pending for reconciliation; credits are refunded when failure is confirmed.

Related Links