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

# GPT Image 2.6 API

> OpenAI generation API guide - Ace Data Cloud

GPT Image 2.6을 사용하여 텍스트로 이미지를 생성하거나 참조 이미지를 바탕으로 편집합니다. 먼저 공개 모델을 선택한 다음 동일한 이미지 API를 사용하여 연동합니다.

## 모델 선택

| 모델 | 선택 및 호출 안내 |
| - | - |
| `gpt-image-2.6-flare` | Flare 모델, 해당 모델 페이지에서 기능, 가격 및 최소 요청 확인 |
| `gpt-image-2.6-sunburst` | Sunburst 모델, 해당 모델 페이지에서 기능, 가격 및 최소 요청 확인 |
| `:official` 및 `:reverse` 변형 | 모델 ID 접미사는 공개 호출 이름의 일부이며, 각 변형의 비용과 지원 매개변수는 해당 모델 페이지 기준 |

* [Flare](https://platform.acedata.cloud/models/gpt-image-2.6-flare?m=image) · [Flare official](https://platform.acedata.cloud/models/gpt-image-2.6-flare%3Aofficial?m=image) · [Flare reverse](https://platform.acedata.cloud/models/gpt-image-2.6-flare%3Areverse?m=image)
* [Sunburst](https://platform.acedata.cloud/models/gpt-image-2.6-sunburst?m=image) · [Sunburst official](https://platform.acedata.cloud/models/gpt-image-2.6-sunburst%3Aofficial?m=image) · [Sunburst reverse](https://platform.acedata.cloud/models/gpt-image-2.6-sunburst%3Areverse?m=image)

## 이미지 생성 요청 준비

[애플리케이션 목록](https://platform.acedata.cloud/console/applications)에서 범용 애플리케이션을 열고 **API KEY** 오른쪽의 복사 버튼을 클릭합니다. 다음으로 이 키를 사용하여 이미지 한 장을 생성합니다. 제한된 키를 사용할 때는 이미지 생성이 허용되는지 확인하세요. 참조 이미지를 편집하려면 이미지 편집 권한도 필요합니다.

## 첫 번째 이미지 생성

```bash theme={null}
export ACEDATACLOUD_API_KEY="YOUR_API_KEY"
curl --fail-with-body 'https://api.acedata.cloud/openai/images/generations' \
  --header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "A white ceramic coffee mug on a blue table, soft morning light, no text.",
    "size": "1024x1024",
    "n": 1,
    "response_format": "url"
  }'
```

### 응답 JSON

다음은 기존 Images 응답의 일부로, 작업 식별자, 모델 및 이미지 URL의 위치를 보여줍니다. 선택한 모델과 이미지 주소는 이번 요청의 반환값을 기준으로 합니다.

```json theme={null}
{
  "success": true,
  "task_id": "49848451-c624-4df9-9dc2-494018daaf4c",
  "trace_id": "5ac021c2-2891-4eed-bfcf-4c6668ac1be1",
  "created": 1788831893,
  "data": [
    {
      "url": "https://cdn.acedata.cloud/assets/examples/gpt-image/49848451-c624-4df9-9dc2-494018daaf4c_0-b6d780a732ca.png"
    }
  ]
}
```

동기 응답이 반환되면 `data[].url`에서 생성된 이미지를 읽습니다. 화면 비율, 품질 또는 출력 형식을 조정해야 할 때는 [이미지 생성 가이드](https://platform.acedata.cloud/documents/openai-images-generations-integration)를 확인하세요. `b64_json` 반환 형식을 선택한 경우 가이드에 따라 해당 결과를 디코딩합니다.

## 참조 이미지 편집

`YOUR_IMAGE_URL`을 접근 가능한 참조 이미지 주소로 바꾼 다음 수정할 내용을 설명합니다.

```bash theme={null}
curl --fail-with-body 'https://api.acedata.cloud/openai/images/edits' \
  --header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare",
    "image": "YOUR_IMAGE_URL",
    "prompt": "Change the mug to dark green and keep the composition.",
    "n": 1,
    "response_format": "url"
  }'
```

### 응답 JSON

다음은 기존 Images 응답의 일부로, 작업 식별자, 모델 및 이미지 URL의 위치를 보여줍니다. 선택한 모델과 이미지 주소는 이번 요청의 반환값을 기준으로 합니다.

```json theme={null}
{
  "success": true,
  "task_id": "49848451-c624-4df9-9dc2-494018daaf4c",
  "trace_id": "5ac021c2-2891-4eed-bfcf-4c6668ac1be1",
  "created": 1788831893,
  "data": [
    {
      "url": "https://cdn.acedata.cloud/assets/examples/gpt-image/49848451-c624-4df9-9dc2-494018daaf4c_0-b6d780a732ca.png"
    }
  ]
}
```

편집 결과도 `data[].url`에서 읽습니다. 여러 이미지, 마스크, 크기 및 형식의 입력 요구사항은 [이미지 편집 가이드](https://platform.acedata.cloud/documents/openai-images-edits-integration)를 참조하세요.

## 장시간 작업 및 오류 복구

비동기 방식이 필요한 경우 이미지 인터페이스 문서에 따라 `async=true`를 설정하고 반환된 작업 식별자를 저장합니다. [OpenAI 작업 조회](https://platform.acedata.cloud/documents/openai-tasks-integration)를 사용하여 원래 작업의 최종 결과를 가져오고, 대기 중 중복 제출을 방지합니다. 인증, 잔액 및 매개변수 오류는 응답의 `error`에 따라 처리하고, 문제를 조사할 수 있도록 `trace_id`를 보관합니다.

전체 호출 예제와 더 많은 기능 안내는 [OpenAIAPI](https://github.com/AceDataCloud/OpenAIAPI)를 참조하세요.


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