> ## 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.

# Anti-AI 주문 생성

> AI 감지 방지 처리를 위한 주문을 생성합니다.

## 입력 모드 (업로드 / URL / 혼합)
입력 모드는 각 파일 객체에 `originalFileUrl` 포함 여부로 결정됩니다:
- **업로드 모드** (`originalFileUrl` 없음): 프리사인드 URL 발급 → 클라이언트가 S3에 업로드 → `/confirm` 호출
- **URL 모드** (`originalFileUrl` 제공): URL에서 이미지를 다운로드하여 즉시 처리
- **혼합 모드**: 일부 파일은 업로드 모드, 나머지는 URL 모드로 동시 처리

### 동작 방식
| 조건 | 주문 상태 | Confirm 필요 |
|------|-----------|-------------|
| 모든 파일에 `originalFileUrl` 있음 | `inProgress` | 불필요 (즉시 처리) |
| `originalFileUrl` 없는 파일 포함 | `pending` | 필요 (업로드 후 confirm) |

## Zero Copy 모드
`mode.zeroCopy: true`로 설정하면, 처리 결과가 고객이 제공한 프리사인드 URL로 직접 업로드됩니다.
이 경우 `outputTargets` 배열이 필수이며 `files` 배열과 동일한 길이여야 합니다.




## OpenAPI

````yaml /ko/api-reference/openapi.yaml post /api/v2/orders/anti-ai
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/anti-ai:
    post:
      tags:
        - Anti-AI
      summary: Anti-AI 주문 생성
      description: >
        AI 감지 방지 처리를 위한 주문을 생성합니다.


        ## 입력 모드 (업로드 / URL / 혼합)

        입력 모드는 각 파일 객체에 `originalFileUrl` 포함 여부로 결정됩니다:

        - **업로드 모드** (`originalFileUrl` 없음): 프리사인드 URL 발급 → 클라이언트가 S3에 업로드 →
        `/confirm` 호출

        - **URL 모드** (`originalFileUrl` 제공): URL에서 이미지를 다운로드하여 즉시 처리

        - **혼합 모드**: 일부 파일은 업로드 모드, 나머지는 URL 모드로 동시 처리


        ### 동작 방식

        | 조건 | 주문 상태 | Confirm 필요 |

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

        | 모든 파일에 `originalFileUrl` 있음 | `inProgress` | 불필요 (즉시 처리) |

        | `originalFileUrl` 없는 파일 포함 | `pending` | 필요 (업로드 후 confirm) |


        ## Zero Copy 모드

        `mode.zeroCopy: true`로 설정하면, 처리 결과가 고객이 제공한 프리사인드 URL로 직접 업로드됩니다.

        이 경우 `outputTargets` 배열이 필수이며 `files` 배열과 동일한 길이여야 합니다.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - idempotencyKey
                - files
              properties:
                idempotencyKey:
                  type: string
                  description: 중복 요청 방지를 위한 멱등성 키
                orderName:
                  type: string
                  maxLength: 64
                  description: 주문 이름 (미입력 시 자동 생성)
                files:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: object
                    required:
                      - fileName
                    properties:
                      fileName:
                        type: string
                        description: 파일 이름 (확장자 포함)
                        example: image.jpg
                      originalFileUrl:
                        type: string
                        format: uri
                        description: |
                          원본 이미지 URL (선택)
                          - 제공 시: URL 모드 (프리사인드 URL 미발급, 즉시 처리)
                          - 미제공 시: 업로드 모드 (프리사인드 URL 발급, confirm 필요)
                        example: https://example.com/image.jpg
                mode:
                  type: object
                  description: 처리 모드 설정
                  properties:
                    zeroCopy:
                      type: boolean
                      default: false
                      description: Zero Copy 모드 활성화
                outputTargets:
                  type: array
                  description: Zero Copy 모드 결과 업로드 대상 (mode.zeroCopy가 true일 때 필수)
                  items:
                    type: object
                    required:
                      - fileKey
                      - url
                      - presignedUrlExpiresAt
                    properties:
                      fileKey:
                        type: string
                        description: 파일 키 (식별자)
                      url:
                        type: string
                        format: uri
                        description: 결과 업로드를 위한 프리사인드 URL
                      presignedUrlExpiresAt:
                        type: string
                        format: date-time
                        description: 프리사인드 URL 만료 시각 (ISO 8601)
                options:
                  $ref: '#/components/schemas/OrderOptions'
            examples:
              uploadMode:
                summary: 업로드 모드 (기본)
                value:
                  idempotencyKey: key-upload-001
                  files:
                    - fileName: image1.jpg
                    - fileName: image2.png
                  options:
                    strength: high
              urlMode:
                summary: URL 모드 (즉시 처리)
                value:
                  idempotencyKey: key-url-001
                  files:
                    - fileName: image1.jpg
                      originalFileUrl: https://example.com/image1.jpg
                    - fileName: image2.png
                      originalFileUrl: https://example.com/image2.png
                  options:
                    strength: high
              mixedMode:
                summary: 혼합 모드
                value:
                  idempotencyKey: key-mixed-001
                  files:
                    - fileName: upload-file.jpg
                    - fileName: url-file.png
                      originalFileUrl: https://example.com/image.png
                  options:
                    strength: standard
      responses:
        '200':
          description: 주문 생성 성공
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      orderName:
                        type: string
                      orderId:
                        type: string
                      status:
                        type: string
                        enum:
                          - pending
                          - inProgress
                        description: |
                          주문 상태
                          - `pending`: 업로드 파일 포함 (confirm 필요)
                          - `inProgress`: 모든 파일이 URL 모드 (즉시 처리)
                      files:
                        type: array
                        items:
                          $ref: '#/components/schemas/AntiAiOrderFile'
              examples:
                uploadModeResponse:
                  summary: 업로드 모드 응답
                  value:
                    data:
                      orderName: anti_ai_2026-02-09
                      orderId: '123456789'
                      status: pending
                      files:
                        - fileId: 1
                          fileName: image1.jpg
                          uploadUrl: https://s3.amazonaws.com/...
                          fileKey: temp/123456789/0/image1.jpg
                urlModeResponse:
                  summary: URL 모드 응답
                  value:
                    data:
                      orderName: anti_ai_2026-02-09
                      orderId: '123456789'
                      status: inProgress
                      files:
                        - fileId: 1
                          fileName: image1.jpg
                          originalFileUrl: https://example.com/image1.jpg
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/UsageLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST https://api.bizmori.com/api/v2/orders/anti-ai \
              -H "Authorization: Bearer YOUR_API_TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
                "idempotencyKey": "key-001",
                "files": [
                  {"fileName": "image1.jpg"},
                  {"fileName": "image2.png"}
                ],
                "options": {"strength": "high"}
              }'
        - lang: javascript
          label: JavaScript
          source: >-
            const response = await
            fetch('https://api.bizmori.com/api/v2/orders/anti-ai', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer YOUR_API_TOKEN',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                idempotencyKey: 'key-001',
                files: [
                  { fileName: 'image1.jpg' },
                  { fileName: 'image2.png' }
                ],
                options: { strength: 'high' }
              })
            });

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

            response = requests.post(
                'https://api.bizmori.com/api/v2/orders/anti-ai',
                headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
                json={
                    'idempotencyKey': 'key-001',
                    'files': [
                        {'fileName': 'image1.jpg'},
                        {'fileName': 'image2.png'}
                    ],
                    'options': {'strength': 'high'}
                }
            )
            data = response.json()
components:
  schemas:
    OrderOptions:
      type: object
      properties:
        strength:
          type: string
          enum:
            - low
            - standard
            - high
          default: high
          description: |
            보호 강도 레벨
            * low - 낮은 보호 강도
            * standard - 표준 보호 강도
            * high - 높은 보호 강도
    AntiAiOrderFile:
      type: object
      description: |
        Anti-AI 주문 파일 정보 (파일 모드에 따라 필드가 다름)
        - 업로드 모드: fileId, fileName, uploadUrl, fileKey
        - URL 모드: fileId, fileName, originalFileUrl
      properties:
        fileId:
          type: string
          description: 파일 ID
        fileName:
          type: string
          description: 파일 이름
        uploadUrl:
          type: string
          format: uri
          description: 업로드 URL (프리사인드 URL) — 업로드 모드 파일만 해당
        fileKey:
          type: string
          description: S3 파일 키 — 업로드 모드 파일만 해당
        originalFileUrl:
          type: string
          format: uri
          description: 원본 이미지 URL — URL 모드 파일만 해당
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: 에러 코드
  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
    InternalError:
      description: 내부 서버 오류
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: SERVER_INTERNAL_ERROR
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 외부 클라이언트 접근을 위한 API 키

````