> ## 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.

# Gemini 이미지 생성

> OpenAI Images API를 통해 Gemini / Nano Banana 이미지 모델 호출하기

> 업데이트: 2026-06-06

# Gemini 이미지 생성

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

Crazyrouter는 Gemini 이미지 모델에 대해 통합 OpenAI Images 호환 엔드포인트를 제공합니다. 사용자는 Gemini 네이티브 `generateContent`를 직접 호출할 필요가 없으며, Gemini 네이티브 `generationConfig.imageConfig`를 전달할 필요도 없습니다.

| 권장 공개 모델명         | 호환 하위 모델명         |
| ----------------- | ----------------- |
| `nano-banana`     | `nano-banana`     |
| `nano-banana-pro` | `nano-banana-pro` |
| `nano-banana-2`   | `nano-banana-2`   |

<Warning>
  Gemini 이미지 생성은 장시간 요청에 해당합니다. 프로덕션 연동 시 주 수신 라인인 `https://api.crazyrouter.com/v1`을 우선 사용하세요. 전체 생성 엔드포인트는 `https://api.crazyrouter.com/v1/images/generations`입니다.
</Warning>

<Note>
  클라이언트 코드에서는 `nano-banana`, `nano-banana-pro`, `nano-banana-2`를 사용하는 것을 권장합니다. 시스템에서 이미 `nano-banana`, `nano-banana-pro`, `nano-banana-2`를 직접 사용하고 있다면, 동일한 Images API 엔드포인트를 통해 계속 호출할 수 있습니다.
</Note>

***

## 요청 파라미터

| 파라미터                 | 타입                  | 필수  | 설명                                                                          |
| -------------------- | ------------------- | --- | --------------------------------------------------------------------------- |
| `model`              | string              | 예   | `nano-banana`, `nano-banana-pro`, `nano-banana-2` 또는 해당 Gemini canonical 명칭 |
| `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`                                                              |

다음과 같은 상위 전용 필드는 전달하지 마세요: `generationConfig`, `imageConfig`, `imageOutputOptions`, `image_output_options`.

## 요청 예제

```bash 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-2",
    "prompt": "A simple red square on a white background, clean vector style",
    "resolution": "1K",
    "aspect_ratio": "1:1",
    "output_format": "png"
  }'
```

응답은 OpenAI Images 스타일을 유지합니다.

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

***

## 참조 이미지 편집

```bash 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-pro",
    "prompt": "참조 이미지를 고급 이커머스 포스터로 바꿔줘, 주체는 유지하고 배경은 더 깔끔하게",
    "image_input": [
      "https://example.com/reference.png"
    ],
    "resolution": "1K",
    "aspect_ratio": "1:1",
    "output_format": "jpeg",
    "output_compression": 85
  }'
```

<Note>
  Gemini 네이티브 API 형태가 반드시 필요하다면 [Gemini 네이티브 형식](/ko/chat/gemini/native)을 참고하세요. 다만 이미지 생성 및 편집의 경우, 클라이언트 측에서는 이 페이지의 Images API를 통합적으로 사용하는 것을 권장합니다.
</Note>
