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

# Grok Imagine Image 2.0 이미지 생성

> - Grok Imagine Image 2.0(grok-imagine-image-2.0)은 xAI의 이미지 생성 및 편집 모델로, 텍스트-이미지 생성과 이미지 편집이 동일한 모델명을 공유합니다
- `image_urls`를 전달하지 않으면 텍스트-이미지 생성이며, `1~3`장의 참조 이미지를 전달하면 자동으로 이미지 편집 모드로 전환됩니다(모델 변경 불필요)
- 비동기 처리 모드, 반환된 작업 ID로 [조회](/ko/api-manual/task-management/get-task-detail)
- 생성된 이미지 링크는 24시간 동안 유효하며, 즉시 저장해 주세요



## OpenAPI

````yaml ko/api-manual/image-series/grok/grok-imagine-image-2.0-image-generate.json POST /v1/images/generations
openapi: 3.1.0
info:
  title: grok-imagine-image-2.0 API
  description: AI 모델을 사용하여 이미지 작업을 생성하며, 다양한 모델 및 파라미터 설정을 지원합니다
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 프로덕션
security:
  - bearerAuth: []
tags:
  - name: 이미지 생성
    description: AI 이미지 생성 관련 API
paths:
  /v1/images/generations:
    post:
      tags:
        - 이미지 생성
      summary: grok-imagine-image-2.0 API
      description: >-
        - Grok Imagine Image 2.0(grok-imagine-image-2.0)은 xAI의 이미지 생성 및 편집 모델로,
        텍스트-이미지 생성과 이미지 편집이 동일한 모델명을 공유합니다

        - `image_urls`를 전달하지 않으면 텍스트-이미지 생성이며, `1~3`장의 참조 이미지를 전달하면 자동으로 이미지 편집
        모드로 전환됩니다(모델 변경 불필요)

        - 비동기 처리 모드, 반환된 작업 ID로
        [조회](/ko/api-manual/task-management/get-task-detail)

        - 생성된 이미지 링크는 24시간 동안 유효하며, 즉시 저장해 주세요
      operationId: createImageGenerationGrokImagineImage2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
            examples:
              text_to_image:
                summary: 텍스트-이미지 (기본)
                value:
                  model: grok-imagine-image-2.0
                  prompt: 사이버펑크 스타일의 도쿄 밤거리, 젖은 노면에 반사되는 네온 불빛
              text_to_image_hd:
                summary: 텍스트-이미지 (2K 와이드)
                value:
                  model: grok-imagine-image-2.0
                  prompt: 황혼 무렵 미래 도시 스카이라인의 시네마틱 와이드 샷
                  size: '16:9'
                  resolution: 2K
                  quality: medium
              image_edit:
                summary: 이미지 편집 (참조 이미지 1장)
                value:
                  model: grok-imagine-image-2.0
                  prompt: 장면의 계절을 눈 내리는 겨울로 바꿔 주세요
                  size: '1:1'
                  resolution: 1K
                  quality: medium
                  image_urls:
                    - https://example.com/input.png
                  callback_url: https://your-domain.com/webhook/image-done
              multi_image_edit:
                summary: 다중 이미지 편집 (참조 문법)
                value:
                  model: grok-imagine-image-2.0
                  prompt: <IMAGE_0>의 인물을 <IMAGE_1>의 장면에 배치하고 조명을 일관되게 유지해 주세요
                  size: '16:9'
                  resolution: 1K
                  quality: medium
                  image_urls:
                    - https://example.com/person.png
                    - https://example.com/scene.png
              batch_generation:
                summary: 일괄 생성 (고속 등급)
                value:
                  model: grok-imagine-image-2.0
                  prompt: 픽셀 아트 스타일의 귀여운 로봇
                  size: '1:1'
                  resolution: 1K
                  quality: low
                  'n': 4
      responses:
        '200':
          description: 이미지 작업이 성공적으로 생성되었습니다
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '400':
          description: 잘못된 요청 파라미터
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 인증되지 않음, 토큰이 유효하지 않거나 만료됨
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: 할당량 부족, 충전 필요
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: 액세스 거부됨
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: 'Token does not have access to model: grok-imagine-image-2.0'
                  type: invalid_request_error
        '429':
          description: 요청 빈도 초과
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: 서버 내부 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: >-
            이미지 생성 모델명. 텍스트-이미지 생성과 이미지 편집이 이 모델명을 공유하며, `image_urls` 전달 여부에 따라
            모드가 자동으로 전환됩니다
          enum:
            - grok-imagine-image-2.0
          example: grok-imagine-image-2.0
        prompt:
          type: string
          description: >-
            생성하려는 이미지 또는 전달한 참조 이미지의 편집 방식을 설명하는 프롬프트


            **다중 이미지 참조 문법:**

            - 여러 장의 참조 이미지를 전달할 때 프롬프트에서 `<IMAGE_0>`, `<IMAGE_1>`, `<IMAGE_2>`로
            각각 1번째, 2번째, 3번째 참조 이미지를 지정할 수 있습니다

            - 인덱스는 `0`부터 시작하며 `image_urls` 배열의 순서와 1:1로 대응합니다

            - 예시: `<IMAGE_0>의 인물을 <IMAGE_1>의 장면에 배치해 주세요`
          example: 사이버펑크 스타일의 도쿄 밤거리, 젖은 노면에 반사되는 네온 불빛
        image_urls:
          type: array
          description: >-
            이미지-이미지 및 이미지 편집 기능을 위한 참조 이미지 URL 목록


            **참고:**

            - 요청당 입력 이미지 수: `0~3`개(미전달 = 텍스트-이미지 생성, `1~3`개 = 이미지 편집)

            - 공개적으로 직접 접근 가능한 `http` / `https` 이미지 URL만 지원하며, base64 및 data URL은
            지원하지 않습니다

            - 지원 형식: `.jpeg`, `.jpg`, `.png`, `.webp`

            - 이미지 URL은 서버에서 직접 접근 가능하거나, 접근 시 직접 다운로드되어야 합니다 (일반적으로 `.png`,
            `.jpg` 등 이미지 확장자로 끝나는 URL)

            - 이미지 편집 시 전달한 참조 이미지에는 추가 비용이 발생하며, 요청당 한 번만 계산되고 `n`배가 되지 않습니다
          items:
            type: string
            format: uri
          maxItems: 3
          example:
            - https://example.com/person.png
            - https://example.com/scene.png
        size:
          type: string
          description: >-
            생성 이미지의 가로세로 비율, 기본값은 `auto`


            **지원하는 비율(13종):**


            | 비율 | 설명 |

            |---|---|

            | `1:1` | 정사각형 |

            | `4:3` / `3:4` | 전통적인 가로형 / 세로형 |

            | `3:2` / `2:3` | 표준 가로형 / 세로형 |

            | `16:9` / `9:16` | 와이드스크린 / 모바일 세로형 |

            | `2:1` / `1:2` | 초광폭 가로형 / 초장축 세로형 |

            | `19.5:9` / `9:19.5` | 풀스크린 스마트폰 가로 / 세로 |

            | `20:9` / `9:20` | 울트라와이드 가로 / 세로 |


            **참고:**

            - `auto`: 모델이 비율을 자동으로 결정하며, 이 파라미터를 전달하지 않으면 `auto`와 동일합니다(출력은 보통
            세로형)

            - 위 표에 없는 값은 지원하지 않습니다
          enum:
            - '1:1'
            - '4:3'
            - '3:4'
            - '3:2'
            - '2:3'
            - '16:9'
            - '9:16'
            - '2:1'
            - '1:2'
            - 19.5:9
            - '9:19.5'
            - '20:9'
            - '9:20'
            - auto
          default: auto
          example: '16:9'
        resolution:
          type: string
          description: |-
            출력 이미지의 픽셀 등급, 기본값은 `1K`이며 `1K`와 `2K` 두 등급을 지원

            **참고:**
            - 본 모델은 `4K`를 지원하지 않습니다
            - 값은 대소문자를 구분하지 않습니다
          enum:
            - 1K
            - 2K
          default: 1K
          example: 1K
        quality:
          type: string
          description: |-
            생성 품질 등급으로 모델의 사고 깊이를 제어하며, 기본값은 `medium`

            | 값 | 설명 |
            |---|---|
            | `low` | 생성이 빠르고 비용이 저렴 |
            | `medium` | 화질과 디테일이 더 우수 |

            **참고:**
            - 본 모델은 `low` / `medium` 두 등급만 지원하며, `high` 등 다른 값은 지원하지 않습니다
            - `quality`(품질 등급)와 `resolution`(픽셀 등급)은 서로 독립적이며 자유롭게 조합할 수 있습니다
            - 값은 대소문자를 구분하지 않습니다
          enum:
            - low
            - medium
          default: medium
          example: medium
        'n':
          type: integer
          description: |-
            생성할 이미지 수, 범위는 `1~10`, 기본값은 `1`

            **참고:**
            - 이미지마다 개별 과금되며 비용은 `n`에 비례해 증가합니다
            - 참조 이미지로 인한 추가 비용은 요청당 한 번만 계산되며 `n`배가 되지 않습니다
            - 작업 완료 후 `result_urls`에는 서로 독립적인 `n`개의 이미지 링크가 반환됩니다
          minimum: 1
          maximum: 10
          default: 1
          example: 1
        callback_url:
          type: string
          description: >-
            작업 완료 후 HTTPS 콜백 주소


            **콜백 타이밍:**

            - 작업이 완료, 실패 또는 취소될 때 트리거됨

            - 과금 확인 완료 후 전송


            **보안 제한:**

            - HTTPS 프로토콜만 지원

            - 내부 IP 주소로의 콜백 금지 (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x
            등)

            - URL 길이는 `2048`자를 초과할 수 없음


            **콜백 메커니즘:**

            - 타임아웃: `10`초

            - 실패 시 최대 `3`회 재시도 (`1`초/`2`초/`4`초 후 재시도)

            - 콜백 응답 본문 형식은 작업 조회 API 응답 형식과 동일

            - 콜백 주소가 2xx 상태 코드를 반환하면 성공으로 간주, 다른 상태 코드는 재시도를 트리거
          format: uri
          example: https://your-domain.com/webhooks/image-task-completed
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: 작업 생성 타임스탬프
          example: 1757156493
        id:
          type: string
          description: 작업 ID
          example: task-unified-1757156493-imcg5zqt
        model:
          type: string
          description: 실제 사용된 모델 이름
          example: grok-imagine-image-2.0
        object:
          type: string
          enum:
            - image.generation.task
          description: 구체적인 작업 유형
        progress:
          type: integer
          description: 작업 진행률 (0-100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: 작업 상태
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          $ref: '#/components/schemas/TaskInfo'
          description: 비동기 작업 정보
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          description: 작업 출력 유형
          example: image
        usage:
          $ref: '#/components/schemas/Usage'
          description: 사용량 및 과금 정보
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: 오류 코드 식별자
            message:
              type: string
              description: 오류 설명
            type:
              type: string
              description: 오류 유형
    TaskInfo:
      type: object
      properties:
        can_cancel:
          type: boolean
          description: 작업 취소 가능 여부
          example: true
        estimated_time:
          type: integer
          description: 예상 완료 시간(초)
          minimum: 0
          example: 100
    Usage:
      type: object
      description: 사용량 및 과금 정보
      properties:
        billing_rule:
          type: string
          description: 과금 규칙
          enum:
            - per_call
            - per_token
            - per_second
          example: per_call
        credits_reserved:
          type: number
          description: 예상 소비 크레딧 수
          minimum: 0
          example: 3.06
        user_group:
          type: string
          description: 사용자 그룹 카테고리
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##모든 API는 Bearer Token 인증이 필요합니다##

        **API Key 받기:**

        [API Key 관리 페이지](https://evolink.ai/dashboard/keys)를 방문하여 API Key를 받으세요

        **요청 헤더에 추가:**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````