> ## 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 Detection 주문을 생성하고 이미지 업로드를 위한 S3 프리사인드 URL을 발급합니다.

## 처리 흐름

1. 이 엔드포인트를 호출하여 프리사인드 업로드 URL을 발급받습니다
2. 발급된 프리사인드 URL로 이미지를 S3에 직접 업로드합니다
3. `POST /api/v2/orders/ai-detection/{orderId}/confirm` 을 호출하여 비동기 감지를 시작합니다
4. 웹훅 또는 주문 상세 조회 엔드포인트를 통해 결과를 확인합니다

## 주문 상태

| 상태 | 설명 |
|------|------|
| `pending` | 파일 업로드 대기 중 |
| `inProgress` | 감지 처리 중 |
| `complete` | 감지 완료, 결과 확인 가능 |
| `failed` | 감지 실패 |

## 지원 파일 형식

jpg, jpeg, png, webp, bmp, tiff




## OpenAPI

````yaml /ko/api-reference/openapi.yaml post /api/v2/orders/ai-detection
openapi: 3.0.0
info:
  title: BIZ MORI API
  version: 2.0.0
  description: |
    BIZ MORI API는 디지털 콘텐츠 보호를 위한 네 가지 핵심 서비스를 제공합니다:
    - **Anti-AI**: 이미지를 AI 학습으로부터 보호
    - **Watermark Embed**: 이미지에 보이지 않는 디지털 워터마크 삽입
    - **Watermark Extract**: 이미지에서 워터마크 추출 및 검증
    - **AI Detection**: 이미지가 AI로 생성되었는지 감지
  contact:
    name: BIZ MORI 지원
    email: support@bizmori.com
servers:
  - url: https://api.bizmori.com
    description: 프로덕션
security: []
tags:
  - name: Anti-AI
    description: AI 학습 방지 이미지 보호 주문
  - name: Watermark Embed
    description: 워터마크 삽입 주문
  - name: Watermark Extract
    description: 워터마크 추출 주문
  - name: AI Detection
    description: AI 생성 이미지 감지 주문
  - name: Orders
    description: 주문 조회 및 관리
  - name: Webhooks
    description: 웹훅 설정 및 이벤트
paths:
  /api/v2/orders/ai-detection:
    post:
      tags:
        - AI Detection
      summary: AI Detection 주문 생성
      description: >
        AI Detection 주문을 생성하고 이미지 업로드를 위한 S3 프리사인드 URL을 발급합니다.


        ## 처리 흐름


        1. 이 엔드포인트를 호출하여 프리사인드 업로드 URL을 발급받습니다

        2. 발급된 프리사인드 URL로 이미지를 S3에 직접 업로드합니다

        3. `POST /api/v2/orders/ai-detection/{orderId}/confirm` 을 호출하여 비동기 감지를
        시작합니다

        4. 웹훅 또는 주문 상세 조회 엔드포인트를 통해 결과를 확인합니다


        ## 주문 상태


        | 상태 | 설명 |

        |------|------|

        | `pending` | 파일 업로드 대기 중 |

        | `inProgress` | 감지 처리 중 |

        | `complete` | 감지 완료, 결과 확인 가능 |

        | `failed` | 감지 실패 |


        ## 지원 파일 형식


        jpg, jpeg, png, webp, bmp, tiff
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - idempotencyKey
                - fileName
              properties:
                idempotencyKey:
                  type: string
                  description: 중복 요청 방지를 위한 멱등성 키
                  example: key-ai-detection-001
                orderName:
                  type: string
                  maxLength: 64
                  description: 주문명 (선택 사항, 미입력 시 자동 생성)
                  example: my-detection-order
                fileName:
                  type: string
                  description: '이미지 파일명 (확장자 포함). 지원 형식: jpg, jpeg, png, webp, bmp, tiff'
                  example: photo.jpg
                options:
                  type: object
                  description: 출력 옵션 (선택사항). 생성된 파일은 주문 상세 조회 응답에 포함됩니다.
                  properties:
                    generateHeatmap:
                      type: boolean
                      default: false
                      description: AI 판별 히트맵 이미지 생성 여부
                    generateOverlay:
                      type: boolean
                      default: false
                      description: 원본 위 히트맵 오버레이 이미지 생성 여부
                    generateThumbnail:
                      type: boolean
                      default: false
                      description: 썸네일 이미지 생성 여부
      responses:
        '200':
          description: 주문 생성 성공
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      orderId:
                        type: string
                        description: 주문 ID
                      orderName:
                        type: string
                        description: 주문명
                      status:
                        type: string
                        enum:
                          - pending
                        description: 주문 상태
                      file:
                        type: object
                        properties:
                          fileId:
                            type: integer
                            description: 파일 레코드 ID
                          fileName:
                            type: string
                            description: 파일명
                          uploadUrl:
                            type: string
                            format: uri
                            description: S3 직접 업로드용 프리사인드 URL
                          fileKey:
                            type: string
                            description: S3 파일 키
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/UsageLimitExceeded'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            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": "key-ai-001", "fileName": "photo.jpg"}'
        - lang: javascript
          label: JavaScript
          source: >-
            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: 'key-ai-001',
                fileName: 'photo.jpg'
              })
            });

            const data = await response.json();
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.post(
                'https://api.bizmori.com/api/v2/orders/ai-detection',
                headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
                json={'idempotencyKey': 'key-ai-001', 'fileName': 'photo.jpg'}
            )
            data = response.json()
components:
  responses:
    BadRequest:
      description: 잘못된 요청
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: VALIDATION_FAILED
    Unauthorized:
      description: 인증 실패
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: AUTH_NOT_AUTHENTICATED
    UsageLimitExceeded:
      description: 사용량 한도 초과
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: USAGE_LIMIT_EXCEEDED
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: 에러 코드
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 외부 클라이언트 접근을 위한 API 키

````