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

# 플레이그라운드

> 이 페이지에서 실제 Grok Imagine 이미지 작업을 제출한 다음, 반환된 작업 ID로 상태를 폴링합니다.

API 키와 prompt를 입력한 다음 전송합니다. 실시간 API가 호출되며, 코드에서 호출하는 것과 동일한
엔드포인트입니다.

<Warning>
  **이 페이지에서 전송하는 요청은 실제 요청이며 사용자의 키에 과금됩니다.**
  이미지 1개당 비용은 모델과 등급에 따라 \$0.02\~\$0.08입니다. 이곳의 어떤 기능도
  샌드박스나 모의 환경이 아닙니다.
</Warning>

## 매개변수

<ParamField body="model" type="string" required>
  실행할 모델입니다. `grok-imagine-image`, `grok-imagine-image-2.0` 또는
  `grok-imagine-image-quality`을 허용하며, 정확히 일치해야 합니다 — 별칭은 지원되지 않습니다.
</ParamField>

<ParamField body="input" type="object" required>
  생성 매개변수입니다. 아래에 나열되지 않은 키는 `invalid_params`와 함께
  거부됩니다.

  <Expandable title="입력">
    <ParamField body="input.prompt" type="string" required>
      생성할 항목입니다. 비워 둘 수 없으며, 최대 32000바이트입니다.
    </ParamField>

    <ParamField body="input.resolution" type="string" default="1k">
      `1k` 또는 `2k`입니다. 소문자여야 하며 대문자는 거부됩니다.
    </ParamField>

    <ParamField body="input.quality" type="string" default="low">
      `low` 또는 `medium`입니다. **`grok-imagine-image-2.0`에서만 허용됩니다**. 나머지
      두 모델에서는 알 수 없는 필드로 반환됩니다.
    </ParamField>

    <ParamField body="input.aspect_ratio" type="string">
      `auto` `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `2:1` `1:2`
      `19.5:9` `9:19.5` `20:9` `9:20` `21:9` `5:2` 중 하나입니다. 생략하면 모델 자체의
      기본 프레이밍을 사용합니다.
    </ParamField>

    <ParamField body="input.n" type="integer" default="1">
      생성할 이미지 수입니다(1\~4). 각 이미지는 `outputs`의 별도 항목이며,
      각각 과금됩니다.
    </ParamField>

    <ParamField body="input.images" type="string[]">
      편집하거나 합성할 참조 이미지로, 최대 3개까지 지정할 수 있습니다. 각 항목은
      `https` URL 또는 base64 데이터 URI이며, 각각 약 \$0.01이 추가됩니다.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="callback_url" type="string">
  완료된 작업을 POST할 `https` URL입니다. 따라서 폴링을 건너뛸 수 있습니다. 반드시
  `https`여야 하며, 그 외의 값은 제출 시점에 거부됩니다.
</ParamField>

## 반환 내용

제출하면 1초 이내에 즉시 반환됩니다. 이미지는 이 응답에 **포함되지 않습니다**. 생성은 백그라운드에서 진행됩니다.

| 필드           | 유형      | 참고 사항                      |
| ------------ | ------- | -------------------------- |
| `id`         | string  | 작업 id입니다. 이후 모든 작업에 필요합니다. |
| `status`     | string  | 새 작업에서는 `queued`입니다.       |
| `created_at` | integer | UTC 기준 Unix 초입니다.          |

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "task_2wZ1SuRH4VzXxONqGrH9oCLEZiBQTAVF",
    "status": "queued",
    "created_at": 1788189088
  }
  ```
</ResponseExample>

## 그런 다음 결과를 폴링합니다

이 플레이그라운드는 생성 호출만 다룹니다. 위 응답의 `id`를 가져와
`status`가 `completed` 또는 `failed`에 도달할 때까지 작업을 조회합니다. 약
7\~10초가 걸립니다.

```bash theme={null}
curl https://api.widerouter.com/v1/task/$TASK_ID \
  -H "Authorization: Bearer $WIDEROUTER_API_KEY"
```

완료된 작업에는 `outputs` 배열이 포함됩니다:

```json theme={null}
{
  "id": "task_2wZ1SuRH4VzXxONqGrH9oCLEZiBQTAVF",
  "model": "grok-imagine-image",
  "status": "completed",
  "created_at": 1788189088,
  "completed_at": 1788189094,
  "expires_at": 1788275494,
  "outputs": ["https://r2cdn.agisuitepro.com/o/2026/08/31/task_2wZ1SuRH4VzXxONqGrH9oCLEZiBQTAVF_0.jpg"],
  "counts": { "requested": 1, "succeeded": 1, "failed": 0 },
  "usage": { "cost_in_usd_ticks": 200000000 }
}
```

<Info>
  출력 URL은 인증이 필요 없으며 작업 완료 후 24시간이 지나면 만료됩니다.
  `usage.cost_in_usd_ticks`는 **정가**이며, 잔액은 해당 금액에 그룹 배수를 곱한 만큼
  변동합니다. [가격](/ko/models/grok-imagine/image/overview#pricing)을 참조하세요.
</Info>

## 다음 단계

<CardGroup cols={2}>
  <Card title="개요" icon="image" href="/ko/models/grok-imagine/image/overview">
    모든 매개변수, 해상도 및 품질 표, 측정된 지연 시간입니다.
  </Card>

  <Card title="비동기 작업 API" icon="clock" href="/ko/api/async-tasks">
    폴링 루프, 콜백 및 전체 오류 표입니다.
  </Card>
</CardGroup>
