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

# Nano Banana

> nano-banana를 사용하여 OpenAI Images API로 이미지를 생성하고 편집합니다

> 업데이트: 2026-06-06

# Nano Banana

```
POST /v1/images/generations
```

`nano-banana`는 `nano-banana`의 공개 별칭입니다. 사용자 측에서는 통합된 OpenAI Images 호환 프로토콜을 사용하며, Gemini / Vertex 네이티브 처리, 필드 변환, 라우팅 선택은 모두 Crazyrouter가 서버 측에서 처리합니다.

<Warning>
  이미지 생성, 이미지 편집, 다중 참조 이미지와 같은 요청은 일반적으로 처리 시간이 길어집니다. 프로덕션 연동 시에는 주 처리 라인인 `https://api.crazyrouter.com/v1`을 우선 사용하시고, 전체 생성 엔드포인트는 `https://api.crazyrouter.com/v1/images/generations`입니다. 계정 로그인, 충전, 콘솔은 계속 `https://crazyrouter.com`을 사용합니다.
</Warning>

## 모델명

| 권장 모델명        | 동등한 기반 모델     |
| ------------- | ------------- |
| `nano-banana` | `nano-banana` |

고객 코드에서는 `nano-banana` 사용을 권장합니다. 시스템에 이미 `nano-banana`가 직접 작성되어 있다면, 동일한 `/v1/images/generations` 엔드포인트를 통해 계속 호출할 수 있습니다.

## 요청 파라미터

| 파라미터                 | 타입                  | 필수  | 설명                                       |
| -------------------- | ------------------- | --- | ---------------------------------------- |
| `model`              | string              | 예   | `nano-banana` 권장; `nano-banana`와도 호환     |
| `prompt`             | string              | 예   | 생성 또는 편집 지시문                             |
| `image_input`        | string 또는 string\[] | 아니오 | 참조 이미지 URL; 전달하지 않으면 텍스트-투-이미지로 처리       |
| `resolution`         | string              | 아니오 | `1K`, `2K`, `4K`                         |
| `aspect_ratio`       | string              | 아니오 | 예: `1:1`, `16:9`, `9:16`, `21:9`, `auto` |
| `output_format`      | string              | 아니오 | `png`, `jpeg` / `jpg`                    |
| `output_compression` | integer             | 아니오 | `0-100`, JPEG 압축 품질에 사용                  |
| `n`                  | integer             | 아니오 | 생성 수량, 기본값 `1`                           |

<Note>
  고객 요청에 `generationConfig`, `imageConfig`, `imageOutputOptions`, `image_output_options`와 같은 Gemini 네이티브 필드를 전달하지 마십시오. 이는 업스트림 provider의 세부 사항에 속하며, Crazyrouter가 통합 파라미터에서 자동으로 변환합니다.
</Note>

## 텍스트-투-이미지 예시

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.crazyrouter.com/v1/images/generations \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d '{
      "model": "nano-banana",
      "prompt": "A clean banana icon on a white background, minimal product style",
      "resolution": "1K",
      "aspect_ratio": "1:1",
      "output_format": "png"
    }'
  ```

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

  client = OpenAI(
      api_key="YOUR_API_KEY",
      base_url="https://api.crazyrouter.com/v1",
  )

  response = client.images.generate(
      model="nano-banana",
      prompt="A clean banana icon on a white background, minimal product style",
      n=1,
      extra_body={
          "resolution": "1K",
          "aspect_ratio": "1:1",
          "output_format": "png",
      },
  )

  print(response.data[0].url or response.data[0].b64_json)
  ```
</CodeGroup>

## 참조 이미지 편집 예시

```bash cURL theme={null}
curl -X POST https://api.crazyrouter.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "nano-banana",
    "prompt": "주체는 그대로 유지하고 배경을 흰색 이커머스 스튜디오 촬영 스타일로 변경",
    "image_input": [
      "https://example.com/product.png"
    ],
    "resolution": "1K",
    "aspect_ratio": "1:1",
    "output_format": "jpeg",
    "output_compression": 85
  }'
```

## 응답

응답은 OpenAI Images 스타일을 유지합니다. 기본적으로 `data[0].url`을 우선 읽으며, 일부 호환 채널은 `data[0].b64_json`을 반환할 수 있습니다.

```json theme={null}
{
  "created": 1778990000,
  "data": [
    {
      "url": "https://media.crazyrouter.com/task-artifacts/2026/05/17/sync-image/request-id-1.png"
    }
  ]
}
```

## 흔한 오류

| 잘못된 작성                                                                   | 올바른 작성                                             |
| ------------------------------------------------------------------------ | -------------------------------------------------- |
| `/v1beta/models/nano-banana:generateContent`를 직접 호출                      | `POST /v1/images/generations`로 변경                  |
| 요청에 `image_output_options`를 전달                                           | 통합 파라미터 `output_format`, `output_compression`으로 변경 |
| base URL을 `https://api.crazyrouter.com`으로만 설정한 후 SDK가 OpenAI 경로를 이어붙이게 함 | OpenAI SDK는 `https://api.crazyrouter.com/v1`을 사용   |
