> For the complete documentation index, see [llms.txt](https://bountyv.gitbook.io/vdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bountyv.gitbook.io/vdocs/frontier-passthrough/frontier-nano-banana-pro.md).

# Nano Banana Pro

Google's `gemini-3-pro-image-preview` on Gemini's own parameters. Synchronous — the image comes back in the response body.

```
POST /api/v1/frontier/nano-banana-pro
```

This is the same model as `engine=nanobanana` on [Text-to-Image](/vdocs/image-api/images-txt2img.md), at the same price, without our normalised parameter shape in the way. See [Frontier Passthrough](/vdocs/frontier-passthrough/frontier-overview.md) for what that does and doesn't cover.

## Authentication

```
Authorization: Bearer sk_live_...
```

## Request

**Content-Type:** `application/json`

| Field          | Type      | Required | Default                  | Description                                                                                                                                                               |
| -------------- | --------- | -------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt`       | string    | ✅        | —                        | What to generate                                                                                                                                                          |
| `images`       | string\[] | —        | —                        | Up to 14 reference images, in prompt order ("image 1", "image 2", …). Each may be a `data:` URL, a public https URL, or a bare base64 string. Omit for pure text-to-image |
| `image`        | string    | —        | —                        | Single reference, same formats. Can be combined with `images`                                                                                                             |
| `image_size`   | string    | —        | `"2K"`                   | `"1K"` \| `"2K"` \| `"4K"` — maps to Gemini's `imageConfig.imageSize`                                                                                                     |
| `aspect_ratio` | string    | —        | `"1:1"` on text-to-image | `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `3:2`, `2:3`, `5:4`, `4:5`. **Omit on an image-to-image call** to follow the reference image's own shape                             |

Gemini controls output pixels through `imageConfig` only — dimensions written into the prompt are ignored.

Google's guidance for the 14 slots: at most 6 object references and 5 character references gives the cleanest composition. 14 is the hard API ceiling.

## Response

```json
{
  "image": "https://.../generations/<id>.png?token=...",
  "generation_id": "gJ8nP3kQ2m",
  "model": "gemini-3-pro-image-preview",
  "reference_images": 2,
  "max_reference_images": 14,
  "image_size": "2K",
  "aspect_ratio": "16:9",
  "charged_cents": 49,
  "balance_cents": 4751,
  "elapsed_ms": 9184
}
```

| Field              | Type           | Description                                                              |
| ------------------ | -------------- | ------------------------------------------------------------------------ |
| `image`            | string         | Signed URL when the generation persists, otherwise an inline `data:` URL |
| `generation_id`    | string \| null | Generation record ID, or `null` if persistence failed                    |
| `model`            | string         | The exact provider model that ran                                        |
| `reference_images` | integer        | How many references were accepted                                        |
| `charged_cents`    | integer        | Amount deducted                                                          |
| `elapsed_ms`       | integer        | Generation time                                                          |

## Example

```bash
curl -X POST https://substance-api.com/api/v1/frontier/nano-banana-pro \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A product shot of the bottle from image 1 on a marble counter, morning light",
    "images": ["https://example.com/bottle.png"],
    "image_size": "4K",
    "aspect_ratio": "3:2"
  }'
```

## Errors

| Status | Meaning                                                                                                                               |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| `400`  | Missing `prompt`, unsupported `aspect_ratio`, an unreadable image value, or more than 14 references (`max_reference_images` included) |
| `402`  | Balance below the call price — `required_cents` and `model` included                                                                  |
| `403`  | Your account doesn't have the `image` product enabled                                                                                 |
| `502`  | Gemini failed or refused the prompt (safety filter). The charge is refunded — `refunded_cents` included                               |
| `503`  | The pipeline is disabled                                                                                                              |

## Pricing

$0.49 per image. Bills on `images.txt2img.nanobanana`, the same key as the wrapped engine. See [Credits & pricing](/vdocs/account/credits.md).

SFW only — see [Frontier Passthrough → Content policy](/vdocs/frontier-passthrough/frontier-overview.md#content-policy).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bountyv.gitbook.io/vdocs/frontier-passthrough/frontier-nano-banana-pro.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
