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

> Protect your images from AI with the Anti-AI API

This guide walks you through creating an **Anti-AI protection order** — from uploading an image to downloading the protected result.

<Tip>
  You can also provide image URLs directly instead of uploading files. See the [Create Anti-AI order API](/api-reference/anti-ai/create-order) for URL mode details.
</Tip>

## Prerequisites

* A BIZ MORI API key ([get one here](https://app.bizmori.com/keys))
* An image file to protect (`jpeg`, `jpg`, `png`, `webp`, `tiff`, or `bmp`)

## Step 1: Create an order

Create an order and receive presigned S3 URLs for uploading your files.

<CodeGroup>
  ```bash cURL theme={null}
  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": "my-first-order-001",
      "files": [{ "fileName": "photo.jpg" }],
      "options": { "strength": "high" }
    }'
  ```

  ```javascript Node.js theme={null}
  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: 'my-first-order-001',
      files: [{ fileName: 'photo.jpg' }],
      options: { strength: 'high' },
    }),
  });
  const { data } = await response.json();
  ```

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

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

**Response:**

```json theme={null}
{
  "data": {
    "orderName": "anti_ai_2026-02-19",
    "orderId": "123456789",
    "status": "pending",
    "files": [
      {
        "fileId": 1,
        "fileName": "photo.jpg",
        "uploadUrl": "https://s3.amazonaws.com/...",
        "fileKey": "temp/123456789/0/photo.jpg"
      }
    ]
  }
}
```

## Step 2: Upload files

PUT your file to the presigned `uploadUrl` from Step 1. This is a direct S3 upload — **no Authorization header needed**.

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

<Note>
  Presigned URLs expire after **1 hour**. If yours has expired, use the [Refresh URLs](/api-reference/orders/refresh-urls) endpoint to generate new ones.
</Note>

## Step 3: Confirm the order

After uploading all files, call confirm to start processing:

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

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

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

## Step 4: Check order status

Poll the order or use [webhooks](/webhooks) to receive a push notification when processing completes.

<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.status: 'pending' | 'inProgress' | 'complete' | 'failed'
  ```

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

Order statuses:

| Status       | Meaning                 |
| ------------ | ----------------------- |
| `pending`    | Waiting for file upload |
| `inProgress` | Processing              |
| `complete`   | Ready for download      |
| `failed`     | Processing failed       |

## Step 5: Download the result

Once `status` is `complete`, fetch the download URL:

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

  ```javascript Node.js theme={null}
  const res = await fetch('https://api.bizmori.com/api/v2/orders/123456789/download', {
    headers: { 'Authorization': 'Bearer YOUR_API_TOKEN' },
  });
  const { data } = await res.json();
  // data.downloadUrl — valid for 1 hour
  ```

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

**Response:**

```json theme={null}
{
  "data": {
    "downloadUrl": "https://s3.amazonaws.com/...",
    "expiresIn": 3600
  }
}
```

The `downloadUrl` is a presigned S3 URL valid for **1 hour**. Download the protected file directly from this URL.

## Error handling

| HTTP Status | Meaning               | Action                                   |
| ----------- | --------------------- | ---------------------------------------- |
| `400`       | Invalid request       | Check parameters and file format         |
| `401`       | Authentication failed | Verify your API key                      |
| `429`       | Rate limit exceeded   | Reduce request frequency or upgrade plan |

For the complete error code reference, see [Error Codes](/errors).

## Next steps

<CardGroup cols={2}>
  <Card title="Watermark Embed" icon="stamp" href="/quickstart/watermark-embed">
    Embed invisible watermarks into your images.
  </Card>

  <Card title="Watermark Extract" icon="magnifying-glass" href="/quickstart/watermark-extract">
    Detect and extract watermarks from images.
  </Card>

  <Card title="AI Detection" icon="robot" href="/quickstart/ai-detection">
    Detect AI-generated images with probability scores.
  </Card>

  <Card title="Webhooks" icon="bell" href="/webhooks">
    Set up webhooks to get notified when processing completes.
  </Card>
</CardGroup>
