POST
/
v2
/
image
/
sync
Python
import os, requests


# Set API key ENV variable or replace with your own API key
API_KEY=os.getenv("AIORNOT_API_KEY")
IMAGE_ENDPOINT = "https://api.aiornot.com/v2/image/sync"

with open("image.jpeg", "rb") as f:
    resp = requests.post(
        IMAGE_ENDPOINT,
        headers={"Authorization": f"Bearer {API_KEY}"},
        files={"image": f},
        params={
            "external_id": "my-tracking-id"  # Optional
        }
    )
  resp.raise_for_status()
  print(resp.json())
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "report": {
    "ai_generated": {
      "verdict": "ai",
      "ai": {
        "is_detected": true,
        "confidence": 0.95
      },
      "human": {
        "is_detected": false,
        "confidence": 0.05
      },
      "generator": {
        "midjourney": 0.95,
        "dall_e": 0.95,
        "stable_diffusion": 0.95,
        "this_person_does_not_exist": 0.95,
        "adobe_firefly": 0.95,
        "flux": 0.95,
        "four_o": 0.95
      }
    },
    "deepfake": {
      "is_detected": true,
      "confidence": 0.95,
      "rois": [
        {
          "is_detected": true,
          "confidence": 0.95,
          "bbox": {
            "x1": 120,
            "y1": 85,
            "x2": 380,
            "y2": 295
          }
        }
      ]
    },
    "nsfw": {
      "version": "1.0.0",
      "is_detected": true
    },
    "quality": {
      "is_detected": true
    },
    "meta": {
      "width": 640,
      "height": 480,
      "format": "jpeg",
      "size_bytes": 102400,
      "md5": "a1b2c3d4e5f6789012345678901234567",
      "processing_status": {
        "ai_generated": "processed",
        "deepfake": "processed",
        "nsfw": "processed",
        "quality": "processed"
      }
    }
  },
  "external_id": "<string>"
}

Authorizations

Authorization
string
header
required

Your API key as the Bearer token in the Authorization header.

Query Parameters

only
enum<string>[]

Array of analysis types to include. Valid values are ai_generated, deepfake, nsfw, quality.

excluding
enum<string>[]

Array of analysis types to exclude. Valid values are ai_generated, deepfake, nsfw, quality.

external_id
string | null

An optional external identifier for tracking this image analysis.

Body

multipart/form-data

Response

200
application/json

Successful Response

The response is of type object.