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

# Grok Imagine Image 2.0 공식 이미지 생성 및 편집

> grok-imagine-image-2.0 비동기 이미지 생성 및 편집

<Info>
  이 엔드포인트는 **비동기 방식**입니다. 제출 성공 후 작업 ID가 반환됩니다. [작업 상태 조회](/ko/api-reference/tasks/status)를 폴링하여 최종 결과를 가져오세요. `image_urls`를 생략하면 텍스트-이미지, 포함하면 이미지 편집 또는 다중 이미지 참조입니다.
</Info>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/images/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --header 'X-APIMart-Response-Version: 2026-07-27' \
    --data '{
      "model": "grok-imagine-image-2.0",
      "prompt": "비 내리는 밤, 네온 불빛이 비추는 영화 같은 도시 거리",
      "n": 1,
      "aspect_ratio": "16:9",
      "resolution": "2k",
      "quality": "medium"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 202 theme={null}
  {
    "code": 202,
    "data": {
      "id": "task_01KZQE5CM0Y3KZ6M1N1BK619MX",
      "object": "generation.task",
      "type": "image",
      "status": "pending",
      "progress": 0,
      "poll_url": "/v1/tasks/task_01KZQE5CM0Y3KZ6M1N1BK619MX"
    }
  }
  ```
</ResponseExample>

## 모델 기능

| 모델                       | 해상도        | `quality`                  | 입력 이미지 |  출력 수 |
| ------------------------ | ---------- | -------------------------- | -----: | ----: |
| `grok-imagine-image-2.0` | `1k`, `2k` | 텍스트-이미지에서만 `low`, `medium` |   0–3장 | 1–10장 |

## Body

<ParamField body="model" type="string" default="grok-imagine-image-2.0" required>
  고정값: `grok-imagine-image-2.0`.
</ParamField>

<ParamField body="prompt" type="string" required>
  이미지 생성 또는 편집 지시문입니다. 공백 제거 후 비어 있지 않아야 하며 최대 8,000자입니다.
</ParamField>

<ParamField body="n" type="integer" default="1">
  출력 이미지 수: `1`–`10`.
</ParamField>

<ParamField body="aspect_ratio" type="string" default="auto">
  `1:1`, `3:4`, `4:3`, `9:16`, `16:9`, `2:3`, `3:2`, `9:19.5`, `19.5:9`, `9:20`, `20:9`, `1:2`, `2:1`, `auto`를 지원합니다.
</ParamField>

<ParamField body="resolution" type="string" default="1k">
  `1k` 또는 `2k`.
</ParamField>

<ParamField body="quality" type="string">
  텍스트-이미지에서만 `low` 또는 `medium`(기본값). `image_urls`가 있으면 보내지 마세요.
</ParamField>

<ParamField body="image_urls" type="array">
  참조 이미지 1–3장. 공개 HTTP(S) URL 또는 JPEG, PNG, WebP Base64 Data URL을 지원합니다.
</ParamField>

## 비동기 작업

제출 성공 시 HTTP `202`를 반환하고 작업 ID는 `data.id`에 있습니다. `data.poll_url` 또는 `GET /v1/tasks/{task_id}`를 사용해 `completed` 또는 `failed`가 될 때까지 조회하세요.

<Warning>
  장기 API 키를 브라우저 코드, 공개 환경 변수, URL, 로컬 스토리지 또는 클라이언트 로그에 노출하지 마세요. 백엔드 또는 BFF에서 호출하세요.
</Warning>
