> ## 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` 배열과 동일한 길이여야 합니다.


## 주문 결과 다운로드

주문이 `complete` 상태가 되면 [다운로드 URL 발급](/ko/api-reference/orders/download-order) 엔드포인트를 사용하여 처리된 파일을 다운로드할 수 있습니다:

```bash theme={null}
curl -X GET https://api.bizmori.com/api/v2/orders/{orderId}/download \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

<Warning>
  주문 생성 후 **최대 7일**까지 파일을 다운로드할 수 있습니다. 7일이 경과하면 주문이 `expired` 상태로 전환되며, 이후 파일을 다운로드할 수 없습니다.
</Warning>


## 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 provides four core services for digital content protection:
    - **Anti-AI**: Protect images from AI training
    - **Watermark Embed**: Embed invisible digital watermarks into images
    - **Watermark Extract**: Extract and verify watermarks from images
    - **AI Detection**: Detect whether an image is AI-generated
  contact:
    name: BIZ MORI Support
    email: support@bizmori.com
servers:
  - url: https://api.bizmori.com
    description: Production
security: []
tags:
  - name: Anti-AI
    description: Anti-AI image protection orders
  - name: Watermark Embed
    description: Watermark embedding orders
  - name: Watermark Extract
    description: Watermark extraction orders
  - name: AI Detection
    description: AI-generated image detection orders
  - name: Orders
    description: Order query and management
  - name: Webhooks
    description: Webhook configuration and events
paths:
  /api/v2/orders/anti-ai:
    post:
      tags:
        - Anti-AI
      summary: Create Anti-AI order
      description: >
        Create an order for AI detection protection processing.


        ## Input Modes (Upload / URL / Mixed)

        The input mode is determined by the presence of `originalFileUrl` in
        each file object:

        - **Upload mode** (no `originalFileUrl`): Presigned URL issued → Client
        uploads to S3 → Call `/confirm`

        - **URL mode** (`originalFileUrl` provided): Image downloaded from the
        URL and processed immediately

        - **Mixed mode**: Some files in Upload mode, others in URL mode
        simultaneously


        ### Behavior

        | Condition | Order Status | Confirm Required |

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

        | All files have `originalFileUrl` | `inProgress` | No (immediate
        processing) |

        | Any file without `originalFileUrl` | `pending` | Yes (upload then
        confirm) |


        ## Zero Copy Mode

        When `mode.zeroCopy: true`, processed results are uploaded directly to
        customer-provided presigned URLs.

        In this case, `outputTargets` array is required and must match the
        length of `files` array.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - idempotencyKey
                - files
              properties:
                idempotencyKey:
                  type: string
                  description: Idempotency key to prevent duplicate requests
                orderName:
                  type: string
                  maxLength: 64
                  description: Order name (optional, auto-generated if not provided)
                files:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: object
                    required:
                      - fileName
                    properties:
                      fileName:
                        type: string
                        description: File name (with extension)
                        example: image.jpg
                      originalFileUrl:
                        type: string
                        format: uri
                        description: >
                          Original image URL (optional)

                          - Provided: URL mode (no presigned URL issued,
                          immediate processing)

                          - Not provided: Upload mode (presigned URL issued,
                          confirm required)
                        example: https://example.com/image.jpg
                mode:
                  type: object
                  description: Processing mode settings
                  properties:
                    zeroCopy:
                      type: boolean
                      default: false
                      description: Enable Zero Copy mode
                outputTargets:
                  type: array
                  description: >-
                    Output upload targets for Zero Copy mode (required when
                    mode.zeroCopy is true)
                  items:
                    type: object
                    required:
                      - fileKey
                      - url
                      - presignedUrlExpiresAt
                    properties:
                      fileKey:
                        type: string
                        description: File key (identifier)
                      url:
                        type: string
                        format: uri
                        description: Presigned URL for uploading results
                      presignedUrlExpiresAt:
                        type: string
                        format: date-time
                        description: Presigned URL expiration time (ISO 8601)
                options:
                  $ref: '#/components/schemas/OrderOptions'
            examples:
              uploadMode:
                summary: Upload mode (traditional)
                value:
                  idempotencyKey: key-upload-001
                  files:
                    - fileName: image1.jpg
                    - fileName: image2.png
                  options:
                    strength: high
              urlMode:
                summary: URL mode (immediate processing)
                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: Mixed mode
                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: Order created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      orderName:
                        type: string
                      orderId:
                        type: string
                      status:
                        type: string
                        enum:
                          - pending
                          - inProgress
                        description: >
                          Order status

                          - `pending`: Contains upload files (confirm required)

                          - `inProgress`: All files in URL mode (immediate
                          processing)
                      files:
                        type: array
                        items:
                          $ref: '#/components/schemas/AntiAiOrderFile'
              examples:
                uploadModeResponse:
                  summary: Upload mode response
                  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 mode response
                  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: |
            Protection strength level
            * low - Low protection strength
            * standard - Standard protection strength
            * high - High protection strength
    AntiAiOrderFile:
      type: object
      description: |
        Anti-AI order file info (fields vary by file mode)
        - Upload mode: fileId, fileName, uploadUrl, fileKey
        - URL mode: fileId, fileName, originalFileUrl
      properties:
        fileId:
          type: string
          description: File ID
        fileName:
          type: string
          description: File name
        uploadUrl:
          type: string
          format: uri
          description: Upload URL (presigned URL) — Upload mode files only
        fileKey:
          type: string
          description: S3 file key — Upload mode files only
        originalFileUrl:
          type: string
          format: uri
          description: Original image URL — URL mode files only
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: VALIDATION_FAILED
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: AUTH_NOT_AUTHENTICATED
    UsageLimitExceeded:
      description: Usage limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: USAGE_LIMIT_EXCEEDED
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: SERVER_INTERNAL_ERROR
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API Key for external client access

````