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

# 이미지 생성

> DALL-E 3, Stable Diffusion, Flux 등의 모델을 사용하여 텍스트 프롬프트에서 이미지를 생성합니다. ARouter는 단일 통합 엔드포인트를 통해 이미지 생성 요청을 라우팅합니다.

ARouter는 OpenAI 호환 `/v1/images/generations` 엔드포인트를 통해 이미지 생성을 지원합니다.

## 빠른 시작

```bash theme={null}
curl https://api.arouter.ai/v1/images/generations \
  -H "Authorization: Bearer lr_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{"model": "openai/dall-e-3", "prompt": "A futuristic city skyline at sunset, photorealistic", "n": 1, "size": "1024x1024"}'
```

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from openai import OpenAI
    client = OpenAI(base_url="https://api.arouter.ai/v1", api_key="lr_live_xxxx")
    response = client.images.generate(
        model="openai/dall-e-3",
        prompt="A futuristic city skyline at sunset, photorealistic",
        n=1, size="1024x1024", quality="hd"
    )
    print(response.data[0].url)
    ```
  </Tab>

  <Tab title="Node.js">
    ```typescript theme={null}
    import OpenAI from "openai";
    const client = new OpenAI({ baseURL: "https://api.arouter.ai/v1", apiKey: "lr_live_xxxx" });
    const response = await client.images.generate({
      model: "openai/dall-e-3",
      prompt: "A futuristic city skyline at sunset, photorealistic",
      n: 1, size: "1024x1024", quality: "hd"
    });
    console.log(response.data[0].url);
    ```
  </Tab>
</Tabs>

## 요청 파라미터

| 파라미터              | 타입        | 설명                                                         |
| ----------------- | --------- | ---------------------------------------------------------- |
| `model`           | `string`  | 이미지 생성 모델 ID                                               |
| `prompt`          | `string`  | 원하는 이미지의 텍스트 설명. DALL-E 3는 최대 4,000자, DALL-E 2는 최대 1,000자. |
| `n`               | `integer` | 생성할 이미지 수（기본값 `1`）. DALL-E 3는 `n=1`만 지원.                   |
| `size`            | `string`  | 이미지 크기（모델에 따라 다름）                                          |
| `quality`         | `string`  | `"standard"` 또는 `"hd"`（DALL-E 3만 해당, 기본값 `"standard"`）     |
| `style`           | `string`  | `"vivid"`（초현실적）또는 `"natural"`（DALL-E 3만 해당）                |
| `response_format` | `string`  | `"url"`（기본값）또는 `"b64_json"`                                |

## 응답 형식

```json theme={null}
{
  "created": 1234567890,
  "data": [
    {"url": "https://...", "revised_prompt": "A photorealistic futuristic city skyline at sunset..."}
  ]
}
```

## 이미지 크기

### DALL-E 3

| 크기          | 화면 비율     |
| ----------- | --------- |
| `1024x1024` | 정사각형（1:1） |
| `1792x1024` | 가로형（16:9） |
| `1024x1792` | 세로형（9:16） |

## 지원 모델

| 모델                                   | 제공업체         | 해상도          | 스타일 제어       |
| ------------------------------------ | ------------ | ------------ | ------------ |
| `openai/dall-e-3`                    | OpenAI       | 최대 1792×1024 | `style` 파라미터 |
| `openai/dall-e-2`                    | OpenAI       | 최대 1024×1024 | —            |
| `stability/stable-diffusion-3-large` | Stability AI | 최대 1024×1024 | —            |
| `black-forest-labs/flux-1-pro`       | Replicate    | 유연           | —            |

## 가격

| 모델                   | 크기                     | 비용      |
| -------------------- | ---------------------- | ------- |
| `openai/dall-e-3` 표준 | 1024×1024              | \$0.040 |
| `openai/dall-e-3` 표준 | 1024×1792 또는 1792×1024 | \$0.080 |
| `openai/dall-e-3` HD | 1024×1024              | \$0.080 |
| `openai/dall-e-3` HD | 1024×1792 또는 1792×1024 | \$0.120 |
| `openai/dall-e-2`    | 1024×1024              | \$0.020 |

<Note>
  ARouter가 반환하는 이미지 URL은 1시간 후 만료됩니다. 보관하려는 이미지는 다운로드하여 저장하세요.
</Note>
