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

# GPT-Image-2.6 이미지 생성

> 표준 티어 gpt-image-2.6-flare 및 gpt-image-2.6-sunburst 액세스 가이드. 비동기 작업, 3단계 품질, 참조 이미지, GIF 및 SVG 출력, 해상도 기반 요금 포함

표준 티어는 `POST /v1/images/generations`로 이미지 작업을 생성하고 작업 ID를 반환합니다. 작업이 완료되면 상태 엔드포인트에서 이미지 URL을 가져옵니다. 두 모델 모두 동일한 요청 형식을 사용합니다:

| 모델 | 요청의 model |
| - | - |
| Flare | `gpt-image-2.6-flare` |
| Sunburst | `gpt-image-2.6-sunburst` |

`gpt-image-2.6`은 시리즈 이름입니다. 반드시 표의 전체 모델명을 사용하세요.

> [!NOTE]
>
> **중국 본토 사용자 안내:** API 엔드포인트(Base URL)로 `https://api.toapis.cn`을 사용하세요. 이 문서의 예제에서 `https://api.toapis.com`을 `https://api.toapis.cn`으로 바꾸세요.

API Key는 [콘솔](https://toapis.com/dashboard)에서 생성합니다.

## 빠른 시작

ToAPIs API Key를 `TOAPIS_API_KEY` 환경 변수로 설정한 후 작업을 제출합니다:

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "어린이 그림책 스타일, 청진기로 아기 수달의 심장 박동을 듣는 수의사",
    "quality": "high",
    "size": "1:1",
    "resolution": "1K",
    "n": 1
  }'
```

제출 응답 예시:

```json theme={null}
{
  "id": "tsk_img_example",
  "object": "generation.task",
  "model": "gpt-image-2.6-flare",
  "status": "pending",
  "progress": 0,
  "created_at": 1788951900,
  "metadata": {}
}
```

반환된 `id`를 저장하고 아래 `TASK_ID`를 해당 값으로 바꿔 결과를 조회합니다:

```bash theme={null}
curl --fail-with-body \
  --url https://api.toapis.com/v1/images/generations/TASK_ID \
  --header "Authorization: Bearer $TOAPIS_API_KEY"
```

작업은 `pending`, `queued`, `in_progress`를 거쳐 `completed` 또는 `failed`가 됩니다. `completed`에서는 `result.data`에서 이미지 URL을, `failed`에서는 `error`를 읽습니다. 몇 초마다 폴링하세요. 전체 필드는 [이미지 작업 상태 API](https://docs.toapis.com/docs/ko/api-reference/tasks/image-status.md)를 참조하세요.

제출 성공은 작업이 생성되었다는 의미일 뿐입니다. 이미지 다운로드는 `completed`까지 기다리고, 기다리는 동안 동일한 작업 ID를 계속 폴링하세요.

## 요청 파라미터

**Authorization** `string` *required*

`Bearer YOUR_TOAPIS_API_KEY`로 인증합니다.

**model** `string` *required*

`gpt-image-2.6-flare` 또는 `gpt-image-2.6-sunburst`.

**prompt** `string` *required*

이미지 설명. 참조 이미지를 사용할 때는 유지할 대상과 변경할 내용을 설명하세요.

**quality** `string` (default: high)

3단계: `low`, `medium`, `high`. Playground 기본값은 `high`. 생략하면 업스트림 기본값이 사용됩니다.

**size** `string` (default: 1:1)

화면 비율. 예: `1:1`, `3:2`, `2:3`, `4:3`, `3:4`, `5:4`, `4:5`, `16:9`, `9:16`, `21:9`.

`size`에 화면 비율을 지정하고 `resolution`을 명시적으로 전달하는 것을 권장합니다. 출력 픽셀 크기는 두 값으로 계산됩니다.

`auto`를 전달해 업스트림이 크기를 정하게 할 수도 있지만, 최종 비율과 픽셀 크기는 보장되지 않습니다.

**resolution** `string` (default: 1K)

해상도 티어. `1K`, `2K`, `4K`를 지원하며 소문자도 허용됩니다. 표준 티어에서는 이 필드가 요금 티어를 결정합니다.

**n** `integer` (default: 1)

요청당 `1`을 사용해 이미지 한 장을 생성합니다.

**background** `string`

선택적 배경 설정. `"transparent"`로 투명 배경 이미지를 생성합니다. 일반 생성에서는 생략하세요.

텍스트 생성과 `reference_images`가 포함된 요청 모두에서 사용할 수 있습니다.

**output\_format** `string`

출력 형식: `png`, `jpeg`, `webp`, `gif`, `svg`. 생략하면 업스트림 기본값이 사용됩니다. GIF 및 SVG의 추가 파라미터와 제한은 아래 각 섹션을 참조하세요.

**frame\_count** `integer` (default: 9)

GIF 전용. 프레임 수 `2`\~`64`. 텍스트-투-GIF는 이 값을 따르며, 이미지-투-GIF 출력은 항상 `9`프레임으로 렌더링됩니다.

**frame\_duration\_ms** `integer` (default: 200)

GIF 전용. 프레임당 밀리초 `20`\~`2000` (`10` 단위).

**reference\_images** `string[]`

선택적 참조 이미지 URL 목록, 최대 10장. 이미지는 서버에서 접근 가능해야 합니다. URL만 지원되며 로컬 파일 업로드와 base64는 허용되지 않습니다. 로컬 이미지는 먼저 [이미지 업로드 API](https://docs.toapis.com/docs/ko/api-reference/uploads/images.md)로 URL을 얻으세요.

`image_urls`도 허용됩니다. 둘 중 하나만 사용하세요.

`"output_format": "gif"`와 결합하면 이미지-투-GIF 출력이 됩니다.

## 투명 배경

생성 요청에 `"background": "transparent"`를 추가하면 투명 배경 이미지를 얻을 수 있습니다. 일반 생성에서는 생략하세요.

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "투명한 배경의 빨간 원형 스티커",
    "quality": "high",
    "size": "1:1",
    "resolution": "1K",
    "background": "transparent",
    "n": 1
  }'
```

작업은 평소처럼 작업 ID로 조회하고 `result.data`에서 이미지 URL을 읽습니다.

## GIF 출력

`output_format`을 `gif`로 설정하면 애니메이션을 생성합니다. `frame_count`가 프레임 수(`2`~~`64`, 기본값 `9`)를, `frame_duration_ms`가 프레임당 시간(`20`~~`2000`밀리초, `10` 단위, 기본값 `200`)을 제어합니다.

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "푸른 하늘을 가로질러 순환 비행하는 종이비행기, 플랫 일러스트",
    "output_format": "gif",
    "frame_count": 8,
    "frame_duration_ms": 200,
    "size": "1:1",
    "n": 1
  }'
```

### 이미지-투-GIF

`reference_images`를 추가하면 기존 이미지를 애니메이션화할 수 있습니다. 이미지-투-GIF 출력은 항상 `9`프레임으로 렌더링되며 `frame_count`는 이 모드에서 무시되지만 `frame_duration_ms`는 계속 적용됩니다.

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "장면을 부드럽게 움직이게 해줘",
    "reference_images": ["https://example.com/scene.png"],
    "output_format": "gif",
    "frame_duration_ms": 200,
    "n": 1
  }'
```

## SVG 출력

`output_format`을 `svg`로 설정하면 벡터 이미지를 생성합니다. 추가 필드는 필요 없습니다.

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "미니멀한 산 로고, 플랫 벡터 스타일",
    "output_format": "svg",
    "n": 1
  }'
```

## 비율 및 해상도 예시

| size | 1K | 2K | 4K |
| - | - | - | - |
| `1:1` | `1024x1024` | `2048x2048` | `2880x2880` |
| `3:2` | `1536x1024` | `2048x1360` | `3520x2336` |
| `2:3` | `1024x1536` | `1360x2048` | `2336x3520` |
| `16:9` | `1536x864` | `2048x1152` | `3840x2160` |
| `9:16` | `864x1536` | `1152x2048` | `2160x3840` |

`4K`는 해상도 티이며 실제 너비와 높이는 화면 비율에 따라 달라집니다. 예를 들어 정사각형 4K 출력은 `2880x2880`입니다.

## 참조 이미지로 생성

같은 생성 엔드포인트에 `reference_images`를 최대 10장까지 추가합니다. 아래 예시는 Sunburst를 사용하며 비동기 작업을 반환합니다:

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-sunburst",
    "prompt": "참조 이미지의 아기 수달과 수의사를 유지하고, 아기 수달에 노란 목도리를 추가해줘",
    "reference_images": ["https://example.com/otter.png"],
    "quality": "high",
    "size": "1:1",
    "resolution": "2K",
    "n": 1
  }'
```

`https://example.com/otter.png`를 실제 참조 이미지 URL로 바꾼 후 반환된 작업 ID로 결과를 조회하세요.

## 요금

표준 티어는 생성된 이미지당 과금되며 `resolution` 티어가 요금 티어를 결정합니다. GIF와 SVG 출력도 동일한 이미지당 요금으로 과금됩니다. 참조 이미지 입력에는 현재 추가 요금이 없습니다. 계정별 가격이나 할인이 다를 수 있으니 최신 가격은 [모델 요금 페이지](https://toapis.com/pricing)와 계정 설정에서 확인하세요.

## 관련 모델

[GPT-Image-2.6 Official](https://docs.toapis.com/docs/ko/api-reference/images/gpt-image-2.6-official/generation.md) 에디션은 공식 채널을 통해 6단계 품질, 사용자 지정 픽셀 크기, 마크업 가이드 편집, 토큰 기반 과금을 제공합니다. 해당 채널을 사용하려면 `-official` 접미사가 붙은 모델명을 사용하세요.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.