POST
/
reports
/
image
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/v1/reports/image"

with open("image.jpeg", "rb") as f:
    resp = requests.post(
        IMAGE_ENDPOINT,
        headers={"Authorization": f"Bearer {API_KEY}"},
        files={"object": f}
    )
  resp.raise_for_status()
  print(resp.json())
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "report": {
    "verdict": "ai",
    "ai": {
      "is_detected": true,
      "confidence": 0.95
    },
    "human": {
      "is_detected": false,
      "confidence": 0.05
    },
    "generator": {
      "midjourney": 0.9,
      "dall_e": 0.05,
      "stable_diffusion": 0.04,
      "this_person_does_not_exist": 0.01,
      "adobe_firefly": 0,
      "flux": 0,
      "four_o": 0
    }
  },
  "facets": {
    "quality": {
      "is_detected": true
    },
    "nsfw": {
      "version": "1.0.0",
      "is_detected": true
    }
  }
}

Authorizations

Authorization
string
header
required

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

Body

multipart/form-data

Response

200 - application/json

Successful Response

The response is of type object.