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

# AI Detection 빠른 시작

> 확률 점수로 AI 생성 이미지 탐지하기

이 가이드는 이미지가 AI로 생성되었는지 탐지하는 과정을 안내합니다 — 이미지 업로드부터 탐지 결과 확인까지.

## 사전 준비

* BIZ MORI API 키 ([여기서 발급](https://app.bizmori.com/keys))
* 분석할 이미지 파일 (`jpeg`, `jpg`, `png`, `webp`, `bmp`, 또는 `tiff`)

## 1단계: 주문 생성

이미지 파일 이름으로 AI Detection 주문을 생성합니다.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.bizmori.com/api/v2/orders/ai-detection \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "idempotencyKey": "my-detection-001",
      "fileName": "photo.jpg"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.bizmori.com/api/v2/orders/ai-detection', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      idempotencyKey: 'my-detection-001',
      fileName: 'photo.jpg',
    }),
  });
  const { data } = await response.json();
  ```

  ```python Python theme={null}
  import requests

  res = requests.post(
      'https://api.bizmori.com/api/v2/orders/ai-detection',
      headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
      json={
          'idempotencyKey': 'my-detection-001',
          'fileName': 'photo.jpg',
      },
  )
  data = res.json()['data']
  ```
</CodeGroup>

**응답:**

```json theme={null}
{
  "data": {
    "orderId": "123456789",
    "orderName": "ai_detection_2026-03-18",
    "status": "pending",
    "file": {
      "fileId": 1,
      "fileName": "photo.jpg",
      "uploadUrl": "https://s3.amazonaws.com/...",
      "fileKey": "ai-detection/123456789/1/photo.jpg"
    }
  }
}
```

<Tip>
  대시보드 구분을 위한 썸네일, 히트맵, 오버레이 이미지를 생성하려면 [AI Detection API 레퍼런스](/ko/api-reference/ai-detection/create-order)를 참고하세요.
</Tip>

## 2단계: 파일 업로드

1단계 응답의 `uploadUrl`로 파일을 PUT 업로드합니다. **Authorization 헤더는 필요 없습니다** — S3 직접 업로드입니다.

```bash cURL theme={null}
curl -X PUT "https://s3.amazonaws.com/..." \
  -H "Content-Type: image/jpeg" \
  --data-binary @photo.jpg
```

<Note>
  Presigned 업로드 URL은 **1시간** 후 만료됩니다. 만료 전에 이미지를 업로드하세요.
</Note>

## 3단계: 주문 확인

업로드 완료 후, 탐지 처리를 시작하기 위해 주문을 확인합니다:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.bizmori.com/api/v2/orders/ai-detection/confirm \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"idempotencyKey": "YOUR_IDEMPOTENCY_KEY", "orderId": "123456789"}'
  ```

  ```javascript Node.js theme={null}
  await fetch('https://api.bizmori.com/api/v2/orders/ai-detection/confirm', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_TOKEN',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      idempotencyKey: 'YOUR_IDEMPOTENCY_KEY',
      orderId: '123456789',
    }),
  });
  ```

  ```python Python theme={null}
  requests.post(
      'https://api.bizmori.com/api/v2/orders/ai-detection/confirm',
      headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
      json={'idempotencyKey': 'YOUR_IDEMPOTENCY_KEY', 'orderId': '123456789'},
  )
  ```
</CodeGroup>

## 4단계: 결과 확인

주문 상태를 폴링하거나 [웹훅](/ko/webhooks)을 설정하여 탐지 완료 알림을 받습니다. 탐지 결과는 주문 상세에 직접 포함되어 있으며, 별도의 다운로드 단계는 없습니다.

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.bizmori.com/api/v2/orders/123456789 \
    -H "Authorization: Bearer YOUR_API_TOKEN"
  ```

  ```javascript Node.js theme={null}
  const res = await fetch('https://api.bizmori.com/api/v2/orders/123456789', {
    headers: { 'Authorization': 'Bearer YOUR_API_TOKEN' },
  });
  const { data } = await res.json();
  // data.probability: 0-1
  // data.statusCode: 'likely_ai' | 'uncertain_ai' | 'uncertain_real' | 'likely_real'
  ```

  ```python Python theme={null}
  res = requests.get(
      'https://api.bizmori.com/api/v2/orders/123456789',
      headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
  )
  data = res.json()['data']
  probability = data['probability']
  status_code = data['statusCode']
  ```
</CodeGroup>

**응답:**

```json theme={null}
{
  "data": {
    "type": "aiDetection",
    "orderId": "123456789",
    "channel": "api",
    "thumbnailImageUrl": "https://s3.amazonaws.com/...",
    "status": "complete",
    "orderName": "ai_detection_2026-03-18",
    "fileCount": 1,
    "createdAt": "2026-03-18T12:00:00.000Z",
    "updatedAt": "2026-03-18T12:01:30.000Z",
    "errors": null,
    "probability": 0.92,
    "statusCode": "likely_ai",
    "options": {
      "generateHeatmap": false,
      "generateOverlay": false,
      "generateThumbnail": false
    },
    "originalImageUrl": "https://s3.amazonaws.com/..."
  }
}
```

<Note>
  `heatmapUrl`, `overlayUrl`, `thumbnailImageUrl`은 주문 생성 시 각각 `options.generateHeatmap`, `options.generateOverlay`, `options.generateThumbnail`을 요청한 경우에만 응답에 포함됩니다.
</Note>

### 결과 해석

`probability` 필드(0–1)는 이미지가 AI로 생성되었을 확률을 나타냅니다. `statusCode`는 이를 사람이 읽기 쉽게 해석한 값입니다:

| `statusCode`     | 의미              |
| ---------------- | --------------- |
| `likely_real`    | 사람 창작 가능성 매우 높음 |
| `uncertain_real` | 사람 창작 가능성 높음    |
| `uncertain_ai`   | AI 생성 가능성 높음    |
| `likely_ai`      | AI 생성 가능성 매우 높음 |

## 에러 처리

| HTTP 상태 코드 | 의미     | 조치                   |
| ---------- | ------ | -------------------- |
| `400`      | 잘못된 요청 | 파라미터 및 파일 형식 확인      |
| `401`      | 인증 실패  | API 키 확인             |
| `429`      | 사용량 초과 | 요청 빈도를 줄이거나 플랜 업그레이드 |

전체 에러 코드는 [에러 코드](/ko/errors) 페이지를 참고하세요.

## 다음 단계

<CardGroup cols={2}>
  <Card title="Anti-AI" icon="shield" href="/ko/quickstart/anti-ai">
    이미지를 AI 학습 및 생성으로부터 보호합니다.
  </Card>

  <Card title="워터마크 삽입" icon="stamp" href="/ko/quickstart/watermark-embed">
    이미지에 보이지 않는 워터마크를 삽입합니다.
  </Card>

  <Card title="워터마크 검출" icon="magnifying-glass" href="/ko/quickstart/watermark-extract">
    이미지에서 워터마크를 검출하고 추출합니다.
  </Card>

  <Card title="웹훅" icon="bell" href="/ko/webhooks">
    처리 완료 시 알림을 받기 위해 웹훅을 설정합니다.
  </Card>
</CardGroup>
