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

# 범용 이미지 생성 API

> 여러 이미지 생성 모델을 위한 통합 API

## API 개요

다양한 이미지 생성 모델의 통합을 단순화하기 위해 Aihubmix는 다음과 같은 주류 모델을 지원하는 통합 이미지 API를 제공합니다:

* [OpenAI 시리즈](#openai)
* [Ideogram V3](#ideogram-v3)
* [Stability SD 3.5 Large](#stability)
* [Google Imagen 시리즈](#google-imagen)

**API 사양:**

```shell Curl theme={null}
curl https://aihubmix.com/v1/models/<model_path>/predictions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d '{
  "input": {
    "prompt": "당신의 프롬프트"
  }
}'
```

**여기서:**

* `https://aihubmix.com/v1/models/`는 고정된 접두사입니다.
* `<model_path>`는 모델 경로이며, 사용 가능한 모델은 다음과 같습니다:
  * `openai/gpt-image-2`
  * `opanai/gpt-image-1`
  * `opanai/dall-e-3`
  * `imagen-4.0-ultra-generate-001`
  * `imagen-4.0-generate-001`
  * `imagen-4.0-fast-generate-001`
  * `imagen-4.0-fast-generate-preview-06-06`
  * `imagen-3.0-generate-002`
  * `flux-kontext-max`
  * `flux-kontext-pro`
  * `FLUX.1-Kontext-pro`
  * `FLUX-1.1-pro`
  * `ideogram/V3`
  * `stability/Stable-Diffusion-3-5-Large`
* `sk-***`는 Aihubmix에서 생성한 API 키입니다.

***

아래는 각 모델의 호출 방법입니다.

## OpenAI

### 지원되는 모델:

* [gpt-image-2](https://aihubmix.com/model/gpt-image-2) (OpenAI 호환 이미지 편집 엔드포인트에서 지원됩니다. 모델 ID는 `gpt-image-2` 전체를 사용해야 하며 `image2`는 유효하지 않습니다.)
* gpt-image-1
* dall-e-3

### 사용법:

<CodeGroup>
  ```shell Curl gpt-image-1 theme={null}
  curl https://aihubmix.com/v1/models/opanai/gpt-image-1/predictions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-***" \
      -d '{
    "input": {
      "prompt": "호수에서 물을 마시는 사슴, 벚꽃 잎이 떨어지고, 푸르고 깨끗한 물, 일본 사원, 얼룩덜룩한 햇빛, 영화 같은 조명, 넓은 시야, 평화",
      "size": "1024x1024", 
      "n": 1,
      "quality": "high",
      "moderation": "low",
      "background": "auto"
    }
  }'
  ```

  ```shell Curl dall-e-3 theme={null}
  curl https://aihubmix.com/v1/models/opanai/dall-e-3/predictions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-***" \
      -d '{
    "input": {
      "prompt": "호수에서 물을 마시는 사슴, 벚꽃 잎이 떨어지고, 푸르고 깨끗한 물, 일본 사원, 얼룩덜룩한 햇빛, 영화 같은 조명, 넓은 시야, 평화",
      "size": "1024x1024", 
      "n": 1
    }
  }'
  ```
</CodeGroup>

### gpt-image-2

이 모델은 OpenAI 이미지 편집 모델입니다. 호출할 때는 전체 모델명 `gpt-image-2`를 사용하세요. `image2`는 유효한 모델 ID가 아닙니다. 엔드포인트가 `b64_json`을 반환하면 아래 예시는 결과를 `edited.png`로 저장합니다.

<CodeGroup>
  ```powershell PowerShell theme={null}
  curl.exe -sS -X POST "https://aihubmix.com/v1/images/edits" `
    -H "Authorization: Bearer YOUR_API_KEY" `
    -F "model=gpt-image-2" `
    -F "prompt=배경을 파란 하늘과 흰 구름으로 바꿔주세요" `
    -F "image=@test.png" `
    -F "size=1024x1024" `
    -D headers.txt `
    -o response.json `
    -w "HTTP_CODE:%{http_code}`nTOTAL:%{time_total}`n"

  $b64 = (Get-Content .\response.json -Raw | ConvertFrom-Json).data[0].b64_json
  [IO.File]::WriteAllBytes(".\edited.png", [Convert]::FromBase64String($b64))
  ```

  ```typescript TypeScript theme={null}
  import { readFile, writeFile } from "node:fs/promises";

  const apiKey = process.env.AIHUBMIX_API_KEY;
  if (!apiKey) {
    throw new Error("Set AIHUBMIX_API_KEY first.");
  }

  const form = new FormData();
  form.append("model", "gpt-image-2");
  form.append("prompt", "배경을 파란 하늘과 흰 구름으로 바꿔주세요");
  form.append("image", new Blob([await readFile("test.png")], { type: "image/png" }), "test.png");
  form.append("size", "1024x1024");

  const response = await fetch("https://aihubmix.com/v1/images/edits", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${apiKey}`,
    },
    body: form,
  });

  if (!response.ok) {
    throw new Error(`${response.status} ${await response.text()}`);
  }

  const result = (await response.json()) as {
    data: Array<{ b64_json: string }>;
  };

  await writeFile("edited.png", Buffer.from(result.data[0].b64_json, "base64"));
  ```
</CodeGroup>

## Ideogram V3

### 지원되는 모델:

* V3

<Note>
  1. V3 미만 버전(V\_2, V\_1 등)은 레거시 API를 사용하며 현재 지원되지 않습니다.
  2. 반환된 링크는 액세스하려면 프록시 네트워크가 필요합니다.
</Note>

### 사용법:

<CodeGroup>
  ```shell Curl theme={null}
  curl https://aihubmix.com/v1/models/ideogram/V3/predictions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-***" \
      -d '{
    "input": {
      "prompt": "호수에서 물을 마시는 사슴, 벚꽃 잎이 떨어지고, 푸르고 깨끗한 물, 일본 사원, 얼룩덜룩한 햇빛, 영화 같은 조명, 넓은 시야, 평화, 픽사 3D 스타일",
      "rendering_speed": "QUALITY",
      "aspect_ratio": "2x1"
    }
  }'
  ```
</CodeGroup>

## Stability

### 지원되는 모델:

* Stable-Diffusion-3-5-Large

### 사용법:

<CodeGroup>
  ```shell Curl theme={null}
  curl https://aihubmix.com/v1/models/stability/Stable-Diffusion-3-5-Large/predictions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-***" \
      -d '{
    "input": {
      "prompt": "호수에서 물을 마시는 사슴, 벚꽃 잎이 떨어지고, 푸르고 깨끗한 물, 일본 사원, 얼룩덜룩한 햇빛, 영화 같은 조명, 넓은 시야, 평화",
      "n": 1
    }
  }'
  ```
</CodeGroup>

## Google Imagen

### 지원되는 모델:

* imagen-4.0-ultra-generate-001
* imagen-4.0-generate-001
* imagen-4.0-fast-generate-001
* imagen-4.0-fast-generate-preview-06-06
* imagen-3.0-generate-002

<Note>
  Gemini 시리즈 모델은 지원되지 않습니다.
</Note>

### 사용법:

<CodeGroup>
  ```shell Curl theme={null}
  curl https://aihubmix.com/v1/models/google/imagen-3.0-generate-002/predictions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-***" \
      -d '{
    "input": {
      "prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace",
      "numberOfImages": 1
    }
  }'
  ```
</CodeGroup>

***

마지막 업데이트: 2026-06-01
