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

# Image-to-Image

> NanoBanana Pro — generate an image from a prompt and input image URLs at 1K, 2K, or 4K.

Create an asynchronous image-to-image generation with **NanoBanana Pro** (top tier) from URLs.
Returns `202 Accepted` with a `job_id` — poll [`GET /jobs/{job_id}`](/api-reference/get-job) until
the job is `done` or `failed`.

```
POST /url-generations
```

<Info>
  NanoBanana Pro supports selectable [resolution](/concepts/resolutions) (`1K`, `2K`, `4K`) and the
  full [aspect-ratio](/concepts/aspect-ratios) set, including `auto`. It uses the **unprefixed**
  endpoint path.
</Info>

## Headers

<ParamField header="Authorization" type="string" required>
  `Bearer <YOUR_API_KEY>`. See [Authentication](/authentication).
</ParamField>

<ParamField header="Idempotency-Key" type="string">
  Optional. Replaying the same key returns the original `job_id` without creating a duplicate job
  or charging again.
</ParamField>

## Body

<ParamField body="prompt" type="string" required>
  Generation prompt. Minimum length 1. Null bytes are stripped.
</ParamField>

<ParamField body="aspect_ratio" type="string" required>
  Output aspect ratio. See [Aspect ratios](/concepts/aspect-ratios). `auto` infers the ratio from
  the first input image.
</ParamField>

<ParamField body="input_images_urls" type="string[]" required>
  1–14 image URLs. Each must start with `http://` or `https://`.
</ParamField>

<ParamField body="resolution" type="string">
  `1K`, `2K`, or `4K`. See [Resolutions](/concepts/resolutions).
</ParamField>

<ParamField body="callback_url" type="string | null">
  Webhook URL called once the job reaches a terminal state. Overrides the account webhook for this
  request. See [Webhooks](/concepts/webhooks).
</ParamField>

<Info>
  **Input image limits** — 1–14 images per request, up to **40 MB** total across all input images.
</Info>

## Response

Returns `202 Accepted`.

<ResponseField name="job_id" type="string">
  UUID of the created job.
</ResponseField>

<ResponseField name="status" type="string">
  Always `queued` on creation.
</ResponseField>

<ResponseField name="status_url" type="string">
  Relative path to poll for status and result.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -s -X POST https://bananahub.io/api/v1/url-generations \
    -H "Authorization: Bearer $API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "make it look like a watercolor painting",
      "aspect_ratio": "auto",
      "resolution": "2K",
      "input_images_urls": [
        "https://example.com/photo-1.jpg",
        "https://example.com/photo-2.jpg"
      ]
    }'
  ```

  ```python Python theme={null}
  import requests

  resp = requests.post(
      "https://bananahub.io/api/v1/url-generations",
      headers={"Authorization": f"Bearer {API_KEY}"},
      json={
          "prompt": "make it look like a watercolor painting",
          "aspect_ratio": "auto",
          "resolution": "2K",
          "input_images_urls": [
              "https://example.com/photo-1.jpg",
              "https://example.com/photo-2.jpg",
          ],
      },
  )
  print(resp.json())
  ```

  ```javascript Node.js theme={null}
  const resp = await fetch("https://bananahub.io/api/v1/url-generations", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      prompt: "make it look like a watercolor painting",
      aspect_ratio: "auto",
      resolution: "2K",
      input_images_urls: [
        "https://example.com/photo-1.jpg",
        "https://example.com/photo-2.jpg",
      ],
    }),
  });
  console.log(await resp.json());
  ```
</RequestExample>

<ResponseExample>
  ```json 202 Accepted theme={null}
  {
    "job_id": "0193a7f2-1c4a-7e0b-9b3a-2f1d8c6e4a55",
    "status": "queued",
    "status_url": "/api/v1/jobs/0193a7f2-1c4a-7e0b-9b3a-2f1d8c6e4a55"
  }
  ```
</ResponseExample>

<Note>
  A `422` is returned when an input URL can't be fetched or the inputs exceed the size limit. See
  [Errors](/concepts/errors).
</Note>
