> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytespike.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# nano-banana-v2

> Google's lightweight image model, second generation. Adds image-to-image edits while keeping the nano-banana cost profile. The default volume-tier model for any pipeline that needs to mutate an input photo.

`nano-banana-v2` is Google's lightweight image model with **image-to-image edits** on the same low-cost protocol surface as the rest of the image tier. The differentiator is the optional `source_image` field: when present, the model treats it as a reference (style transfer, mask edit, background swap) rather than generating from text alone.

**Pricing:** \$0.022 / image — see the [rate card](/pricing). Failures don't bill; image-to-image runs at the same per-image rate as text-to-image.

## Protocols

| Protocol      | Path                                                  |
| ------------- | ----------------------------------------------------- |
| OpenAI Images | `POST https://llm.bytespike.ai/v1/images/generations` |

## Quickstart

<CodeGroup>
  ```bash cURL (image-to-image) theme={null}
  curl https://llm.bytespike.ai/v1/images/generations \
    -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
    -H "content-type: application/json" \
    -d '{
      "model": "nano-banana-v2",
      "prompt": "Same product, change the background to deep blue",
      "source_image": "https://example.com/source.png",
      "n": 1,
      "size": "1024x1024"
    }'
  ```

  ```python Python (openai SDK) theme={null}
  from openai import OpenAI

  client = OpenAI(
      base_url="https://llm.bytespike.ai/v1",
      api_key=os.environ["BYTESPIKE_API_KEY"],
  )

  resp = client.images.generate(
      model="nano-banana-v2",
      prompt="Same product, change the background to deep blue",
      extra_body={"source_image": "https://example.com/source.png"},
      n=1,
      size="1024x1024",
  )

  print(resp.data[0].url)
  ```
</CodeGroup>

The DOSIA `generate_image` tool passes `source_image` through automatically when you've attached one in the chat.

## Capabilities

| Capability                               | Supported        |
| ---------------------------------------- | ---------------- |
| Text-to-image                            | ✅                |
| **Image-to-image (with `source_image`)** | ✅                |
| `n` ≥ 2 batch generation                 | ✅                |
| `size` 1024×1024 / 1024×1792 / 1792×1024 | ✅                |
| `response_format` url / b64\_json        | ✅                |
| Modality                                 | image            |
| Capability bucket                        | `image_generate` |

## When to use

* **DOSIA "edit this image" requests** — main brain attaches the chat image and routes here when permission is granted.
* **Background swaps, style transfers, mask edits** without the cost of `gpt-image-2`.
* **Cost-sensitive image-to-image pipelines** — volume programmatic edits.

When **not** to use:

* Top-fidelity typography or marketing hero — [`gpt-image-2`](/models/gpt-image-2).

## Next

* [`gpt-image-2`](/models/gpt-image-2) — OpenAI flagship with image-to-image
* [Multimodal endpoints](/concepts/multimodal) — overview
