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

# 채팅으로 이미지 생성

> 2026-03-23 Crazyrouter 프로덕션 환경 검증을 기반으로 한 Chat 이미지 생성 현황과 안정적인 대체 방안

> 업데이트: 2026-06-06

# 채팅으로 이미지 생성

```
POST /v1/chat/completions
```

2026년 3월 23일 기준, Crazyrouter 프로덕션 환경에서 Chat 이미지 생성에 대한 실측 결과는 다음과 같습니다.

* `gpt-4o`는 정상적으로 `200`을 반환하지만, 응답의 `message.content`는 일반 문자열이며 표준 이미지 다중 파트 콘텐츠가 아닙니다
* `gpt-image-2`도 정상적으로 `200`을 반환하지만, 현재 반환 형태는 여전히 텍스트나 Markdown이며 파라미터 블록, 작업 ID, 미리보기 링크를 포함할 뿐 표준 OpenAI `image_url` 다중 파트 구조가 아닙니다
* 안정적이고 프로그램으로 파싱 가능한 이미지 결과가 필요하다면, 현재는 [`/v1/images/generations`](/ko/images/gpt-image) + `gpt-image-2`를 우선 사용해야 합니다. Grok 이미지 모델이 필요하다면 [`Grok 이미지 모델`](/ko/images/grok)을 참고하세요
* Gemini / Nano Banana 이미지 생성, 참조 이미지 편집 또는 다중 이미지 합성이 필요하다면 통합 Images API를 사용하고, [`Nano Banana 2`](/ko/images/nano-banana-2) 또는 [`Nano Banana Pro`](/ko/images/nano-banana-pro)를 우선 참고하세요

<Warning>
  Crazyrouter의 현재 Chat 이미지 생성 응답을 표준 OpenAI `content: [{type: "image_url", ...}]` 구조로 파싱하지 마세요.
</Warning>

***

## 현재 재현 가능한 Chat 동작

아래 요청은 프로덕션 환경에서 `gpt-image-2`에 도달했고 `200`을 반환했습니다.

```bash theme={null}
curl https://api.crazyrouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-image-2",
    "messages": [
      {
        "role": "user",
        "content": "Generate an image of a red square on a white background."
      }
    ],
    "max_tokens": 512
  }'
```

프로덕션 환경에서 실제로 관측된 `message.content`는 다음과 같은 문자열입니다.

```text theme={null}
{
  "prompt": "Generate an image of a red square on a white background.",
  "ratio": "1:1",
  "n": 1
}

ID: ...
Data Preview: https://...
```

이는 현재 Chat 경로가 표준화된 다중 파트 이미지 메시지 객체가 아니라 "텍스트로 감싼 이미지 작업 결과"에 더 가깝다는 것을 보여줍니다.

***

## 안정적인 경로: Images API

프로그램적으로 이미지를 가져오는 것이 목표라면, 현재 더 안정적인 방식은 다음과 같습니다.

```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": "gpt-image-2",
    "prompt": "A red square on a white background",
    "size": "1024x1024",
    "quality": "low",
    "output_format": "png"
  }'
```

현재 `gpt-image-2`의 안정적인 경로는 주 수신 라인인 `https://api.crazyrouter.com/v1`을 사용합니다. 응답은 보통 다음을 반환합니다.

* `data[0].url`

`gpt-image-2`는 `response_format`을 지원하지 않으므로 `response_format="url"`이나 `response_format="b64_json"`을 전달하지 마세요. 이미지 파일 형식을 제어하려면 `output_format="png"`, `"jpeg"` 또는 `"webp"`를 사용하세요.

즉, 현재 안정적인 자동화 소비 방식은 여전히 Chat Completions의 이미지 호환 경로가 아니라 Images API입니다.

<Note>
  단순히 수동으로 사용해 보는 경우라면 `gpt-image-2`의 Chat 경로로도 결과를 확인할 수 있습니다. 프론트엔드/백엔드 자동화, 결과 저장, 이미지 후처리를 하려면 [`GPT Image 문서`](/ko/images/gpt-image), [`Grok 이미지 모델`](/ko/images/grok) 또는 [`Nano Banana 2`](/ko/images/nano-banana-2)를 직접 사용하세요. 이미지 관련 장시간 요청에는 `https://api.crazyrouter.com/v1`을 우선 사용하세요.
</Note>
