# Nano Banana AI Image Generator API: Text to Image, No Key (`spellzcode/nano-banana-ai-image-generator`) Actor

Generate and edit images with Google's Nano Banana (Gemini 2.5 Flash Image) from text prompts, in bulk: any aspect ratio, optional reference images for editing, a download link per image. $0.005 per image plus the model cost at Google's price.

- **URL**: https://apify.com/spellzcode/nano-banana-ai-image-generator.md
- **Developed by:** [SpellzCode](https://apify.com/spellzcode) (community)
- **Categories:** AI, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 image generateds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Nano Banana AI Image Generator API: Text to Image, No Key

Generate images from text in bulk with **Google's Nano Banana (Gemini 2.5 Flash Image)**, the model known for sharp detail, readable text in images and reliable edits, and get a **download link for every image**.

**Try it now:** press **Start**. The example input is already filled in. **$5 per 1,000 images** ($0.005 each), and Apify's free $5 monthly credit covers about 1,000.

- **Text to image**: one prompt per line, 1 to 4 variations each
- **Image editing and combining**: add up to 4 reference images, then prompt "put this product on a marble table" or "make this photo look like a watercolour"
- **Any shape**: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4, 21:9
- **No Google account, API key or setup**: it runs on your Apify account

### Price

You pay two things, both on your Apify bill:

1. **$0.005 per image generated** (this actor's fee). Failed prompts are free.
2. **The model's own cost**, passed through at Google's price by Apify's official OpenRouter actor (`apify/openrouter`). That is roughly $0.04 per image today. The exact amount shows on your run's usage.

### Use it for

- Product shots, ads and social media images at scale
- Blog headers, thumbnails and illustrations from a list of titles
- Editing a catalogue of product photos with one instruction
- Images for an AI agent or automation (call it through the Apify API or MCP)

### Input

| Field | What it does |
|---|---|
| Prompts | One image description per line |
| Aspect ratio | Shape of the images |
| Images per prompt | 1-4 variations |
| Reference images to edit | Optional public image links for editing or combining |

### Output (one item per image)

```json
{
  "prompt": "A cozy coffee shop on a rainy evening, warm light, photorealistic",
  "status": "ok",
  "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/image-001-....png",
  "mimeType": "image/png",
  "bytes": 1523344,
  "model": "google/gemini-2.5-flash-image (Nano Banana)",
  "aspectRatio": "1:1"
}
```

### Notes

- Google's safety rules apply. A prompt the model refuses comes back as `failed` with the model's reason and is not charged by this actor.
- Generated images are stored in your run's key-value store. Download them or move them with the API.

# Actor input Schema

## `prompts` (type: `array`):

One image description per line. Each prompt makes one image (or more, see below).

## `aspectRatio` (type: `string`):

Shape of the image.

## `imagesPerPrompt` (type: `integer`):

Variations to make for each prompt (1-4).

## `inputImageUrls` (type: `array`):

Public image links. With these, each prompt edits or combines the images (for example 'put this product on a marble table'). Up to 4.

## Actor input object example

```json
{
  "prompts": [
    "A cozy coffee shop on a rainy evening, warm light, photorealistic"
  ],
  "aspectRatio": "1:1",
  "imagesPerPrompt": 1
}
```

# Actor output Schema

## `images` (type: `string`):

One item per image: a download link, the prompt and its size.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "prompts": [
        "A cozy coffee shop on a rainy evening, warm light, photorealistic"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("spellzcode/nano-banana-ai-image-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "prompts": ["A cozy coffee shop on a rainy evening, warm light, photorealistic"] }

# Run the Actor and wait for it to finish
run = client.actor("spellzcode/nano-banana-ai-image-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "prompts": [
    "A cozy coffee shop on a rainy evening, warm light, photorealistic"
  ]
}' |
apify call spellzcode/nano-banana-ai-image-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spellzcode/nano-banana-ai-image-generator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AtlUnFR8AXJrEwfwi/builds/bb1WzaXclOc2Q1P6i/openapi.json
