# Detect Image

Detect if an image is AI-generated.

## Endpoint

`POST https://api.bitmind.ai/detect-image`

## Authentication

Send a Bearer token in the `Authorization` header.

See [Authentication](https://docs.bitmind.ai/api-reference/authentication).

## Request

```bash
curl -X POST https://api.bitmind.ai/detect-image \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image": "https://example.com/photo.jpg"}'
```

### Multipart upload

```bash
curl -X POST https://api.bitmind.ai/detect-image \
  -H "Authorization: Bearer $API_KEY" \
  -F "image=@photo.jpg"
```

### JSON fields

| Field   | Type    | Required | Description                        |
| ------- | ------- | -------- | ---------------------------------- |
| `image` | string  | Yes      | Image URL or base64 data URI       |
| `debug` | boolean | No       | Include debug data in the response |

### Multipart fields

| Field   | Type   | Required | Description           |
| ------- | ------ | -------- | --------------------- |
| `image` | file   | Yes      | Image file to upload  |
| `debug` | string | No       | `"true"` or `"false"` |

### Supported formats

`JPEG`, `PNG`, `GIF`, `BMP`, `WebP`, `AVIF`

## Response

```json
{
  "isAI": false,
  "confidence": 0.23,
  "similarity": 0.05,
  "objectKey": "1234567890.jpg"
}
```

### Response with debug enabled

```json
{
  "isAI": false,
  "confidence": 0.23,
  "similarity": 0.05,
  "objectKey": "1234567890.jpg",
  "debug": {
    "raw": 0.42,
    "processingTime": 1.2,
    "region": "us",
    "contentCredentials": {
      "hasCredentials": false
    }
  }
}
```
