openapi: 3.1.0
info:
  title: AIORNOT API
  summary: "\n        Welcome to AI or Not`s documentation, the developer guide to\
    \ discerning digital authenticity!\n        "
  termsOfService: https://aiornot.com/terms-of-service
  contact:
    name: AIORNOT
    url: https://aiornot.com/
    email: support@aiornot.com
  version: 5.0.2
servers:
- url: https://api.aiornot.com
  description: Production environment
paths:
  /v2/image/sync:
    post:
      tags:
      - Reports by Modality
      summary: Image
      description: 'Analyze an **image**.

        This endpoint can run multiple reports on an image simultanously. By default, it runs
        `ai_generated`, `deepfake`, `nsfw`, and `quality` reports. You can select which reports
        to run by using the `only` and `excluding` parameters. Please note that `ai_generated`
        and `deepfake` reports both have their own costs.

         
        **Limitations:**

        - **Maximum file size:** 50MB

        - **Supported formats:** jpg, jpeg, png, webp, heic, heif, tiff'
      operationId: get_image_report_image_sync_post
      parameters:
        - name: only
          in: query
          description: Array of analysis types to include. Valid values are `ai_generated`, `deepfake`, `nsfw`, `quality`, `reverse_search`.
          required: false
          schema:
            type: array
            items:
              type: string
              enum: [ai_generated, deepfake, nsfw, quality, reverse_search]
        - name: excluding
          in: query
          description: Array of analysis types to exclude. Valid values are `ai_generated`, `deepfake`, `nsfw`, `quality`, `reverse_search`.
          required: false
          schema:
            type: array
            items:
              type: string
              enum: [ai_generated, deepfake, nsfw, quality, reverse_search]
        - name: external_id
          in: query
          description: An optional external identifier for tracking this image analysis.
          required: false
          schema:
            type: string
            nullable: true
      x-codeSamples:
        - lang: python
          label: Python
          source: |
            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"
            
            # By default, ai_generated, deepfake, nsfw, and quality reports run.
            # Use 'only' and 'excluding' parameters to select subsets.
            # Note: ai_generated and deepfake have their own costs.

            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
                        # Example: only run reverse_search:
                        # "only": ["reverse_search"]
                        # Example: run all defaults except deepfake:
                        # "excluding": ["deepfake"]
                    }
                )
                resp.raise_for_status()
                print(resp.json())
        - lang: curl
          label: cURL
          source: |
            # By default, ai_generated, deepfake, nsfw, and quality reports run.
            # Use 'only' and 'excluding' parameters to select subsets.
            # Note: ai_generated and deepfake have their own costs.

            curl --request POST \
              --url https://api.aiornot.com/v2/image/sync \
              --header 'Authorization: Bearer $AIORNOT_API_KEY' \
              --form 'image=@image.jpeg'

            # Example: only run reverse_search
            # curl --request POST \
            #   --url 'https://api.aiornot.com/v2/image/sync?only=reverse_search' \
            #   --header 'Authorization: Bearer $AIORNOT_API_KEY' \
            #   --form 'image=@image.jpeg'

            # Example: run all defaults except deepfake
            # curl --request POST \
            #   --url 'https://api.aiornot.com/v2/image/sync?excluding=deepfake' \
            #   --header 'Authorization: Bearer $AIORNOT_API_KEY' \
            #   --form 'image=@image.jpeg'
        - lang: javascript
          label: JavaScript
          source: |
            // By default, ai_generated, deepfake, nsfw, and quality reports run.
            // Use 'only' and 'excluding' parameters to select subsets.
            // Note: ai_generated and deepfake have their own costs.

            const fs = require('fs');
            const FormData = require('form-data');
            const fetch = require('node-fetch');

            const API_KEY = process.env.AIORNOT_API_KEY;
            const IMAGE_ENDPOINT = 'https://api.aiornot.com/v2/image/sync';

            const form = new FormData();
            form.append('image', fs.createReadStream('image.jpeg'));

            const params = new URLSearchParams({
              external_id: 'my-tracking-id'  // Optional
              // Example: only run reverse_search:
              // only: 'reverse_search'
              // Example: run all defaults except deepfake:
              // excluding: 'deepfake'
            });

            fetch(`${IMAGE_ENDPOINT}?${params}`, {
              method: 'POST',
              headers: {
                'Authorization': `Bearer ${API_KEY}`,
                ...form.getHeaders()
              },
              body: form
            })
              .then(response => {
                if (!response.ok) {
                  throw new Error(`Failed to analyze image: ${response.status} ${response.statusText}`);
                }
                return response.json();
              })
              .then(data => console.log(data))
              .catch(error => console.error('Error:', error));
        - lang: php
          label: PHP
          source: |
            <?php
            // By default, ai_generated, deepfake, nsfw, and quality reports run.
            // Use 'only' and 'excluding' parameters to select subsets.
            // Note: ai_generated and deepfake have their own costs.

            $API_KEY = getenv('AIORNOT_API_KEY');
            $IMAGE_ENDPOINT = 'https://api.aiornot.com/v2/image/sync';

            $curl = curl_init();

            $imageFile = new CURLFile('image.jpeg', 'image/jpeg', 'image');

            $query_params = http_build_query([
              'external_id' => 'my-tracking-id'  // Optional
              // Example: only run reverse_search:
              // 'only' => ['reverse_search']
              // Example: run all defaults except deepfake:
              // 'excluding' => ['deepfake']
            ]);

            curl_setopt_array($curl, [
              CURLOPT_URL => $IMAGE_ENDPOINT . '?' . $query_params,
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_POST => true,
              CURLOPT_POSTFIELDS => [
                'image' => $imageFile
              ],
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer $API_KEY"
              ],
            ]);

            $response = curl_exec($curl);
            $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } elseif ($httpCode !== 200) {
              echo "Failed to analyze image: HTTP $httpCode - $response";
            } else {
              $data = json_decode($response, true);
              print_r($data);
            }
        - lang: go
          label: Go
          source: |
            // By default, ai_generated, deepfake, nsfw, and quality reports run.
            // Use 'only' and 'excluding' parameters to select subsets.
            // Note: ai_generated and deepfake have their own costs.

            package main

            import (
              "bytes"
              "fmt"
              "io"
              "io/ioutil"
              "mime/multipart"
              "net/http"
              "net/url"
              "os"
            )

            func main() {
              APIKey := os.Getenv("AIORNOT_API_KEY")
              imageEndpoint := "https://api.aiornot.com/v2/image/sync"

              file, err := os.Open("image.jpeg")
              if err != nil {
                panic(err)
              }
              defer file.Close()

              var requestBody bytes.Buffer
              writer := multipart.NewWriter(&requestBody)

              part, err := writer.CreateFormFile("image", "image.jpeg")
              if err != nil {
                panic(err)
              }

              _, err = io.Copy(part, file)
              if err != nil {
                panic(err)
              }

              err = writer.Close()
              if err != nil {
                panic(err)
              }

              params := url.Values{}
              params.Set("external_id", "my-tracking-id")  // Optional
              // Example: only run reverse_search:
              // params.Set("only", "reverse_search")
              // Example: run all defaults except deepfake:
              // params.Set("excluding", "deepfake")

              fullURL := imageEndpoint + "?" + params.Encode()

              req, err := http.NewRequest("POST", fullURL, &requestBody)
              if err != nil {
                panic(err)
              }

              req.Header.Set("Authorization", "Bearer "+APIKey)
              req.Header.Set("Content-Type", writer.FormDataContentType())

              client := &http.Client{}
              resp, err := client.Do(req)
              if err != nil {
                panic(err)
              }
              defer resp.Body.Close()

              body, err := ioutil.ReadAll(resp.Body)
              if err != nil {
                panic(err)
              }

              if resp.StatusCode != 200 {
                fmt.Printf("Failed to analyze image: %d %s\n", resp.StatusCode, string(body))
                return
              }

              fmt.Println(string(body))
            }
        - lang: java
          label: Java
          source: |
            // By default, ai_generated, deepfake, nsfw, and quality reports run.
            // Use 'only' and 'excluding' parameters to select subsets.
            // Note: ai_generated and deepfake have their own costs.

            import java.io.File;
            import java.io.IOException;
            import okhttp3.*;

            public class ImageAnalysis {
                public static void main(String[] args) {
                    String apiKey = System.getenv("AIORNOT_API_KEY");
                    String imageEndpoint = "https://api.aiornot.com/v2/image/sync";

                    OkHttpClient client = new OkHttpClient();

                    File imageFile = new File("image.jpeg");

                    RequestBody requestBody = new MultipartBody.Builder()
                        .setType(MultipartBody.FORM)
                        .addFormDataPart("image", imageFile.getName(),
                            RequestBody.create(MediaType.parse("image/jpeg"), imageFile))
                        .build();

                    HttpUrl url = HttpUrl.parse(imageEndpoint).newBuilder()
                        .addQueryParameter("external_id", "my-tracking-id")  // Optional
                        // Example: only run reverse_search:
                        // .addQueryParameter("only", "reverse_search")
                        // Example: run all defaults except deepfake:
                        // .addQueryParameter("excluding", "deepfake")
                        .build();
                    
                    Request request = new Request.Builder()
                        .url(url)
                        .header("Authorization", "Bearer " + apiKey)
                        .post(requestBody)
                        .build();
                    
                    try {
                        Response response = client.newCall(request).execute();
                        if (!response.isSuccessful()) {
                            System.err.println("Failed to analyze image: " + response.code() + " " + response.body().string());
                        } else {
                            System.out.println(response.body().string());
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: binary
                  title: Image
                  description: "The image file to analyze.\n - Supported formats: jpg, jpeg, png, webp, heic, heif, tiff.\n- Max file size: 10MB"
              required:
              - image
            encoding:
              image:
                contentType: image/*
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ImageReportResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/reports/voice:
    post:
      tags:
      - Reports by Modality
      summary: Audio - Voice
      description: 'Analyze an **audio file** to determine if it was generated by
        an AI *voice* model.


        This endpoint is only appropriate when you are looking for ai versus human
        generated voices. It is not appropriate for music (including singing).


        **Warning: This endpoint can take up two minutes for long duration audio files
        or if our backend is spinning up additional processing nodes. Please set a
        two minute timeout in your client.**'
      x-codeSamples:
        - lang: python
          label: Python
          source: |
            import os, requests


            # Set API key ENV variable or replace with your own API key
            API_KEY = os.getenv("AIORNOT_API_KEY")
            VOICE_ENDPOINT = "https://api.aiornot.com/v1/reports/voice"

            with open("audio.mp3", "rb") as audio_file:
                files = {"file": audio_file}
                resp = requests.post(
                    VOICE_ENDPOINT, 
                    headers={"Authorization": f"Bearer {API_KEY}"},
                    files=files,
                    timeout=120
                )
                if resp.status_code != 200:
                    raise Exception(f"Failed to analyze image: {resp.status_code} {resp.text}")

                print(resp.json())
        - lang: curl
          label: cURL
          source: |
            curl --request POST \
              --url https://api.aiornot.com/v1/reports/voice \
              --header 'Authorization: Bearer $AIORNOT_API_KEY' \
              --form 'file=@audio.mp3' \
              --max-time 120
        - lang: javascript
          label: JavaScript
          source: |
            const fs = require('fs');
            const FormData = require('form-data');
            const fetch = require('node-fetch');

            const API_KEY = process.env.AIORNOT_API_KEY;
            const VOICE_ENDPOINT = 'https://api.aiornot.com/v1/reports/voice';

            const form = new FormData();
            form.append('file', fs.createReadStream('audio.mp3'));

            fetch(VOICE_ENDPOINT, {
              method: 'POST',
              headers: {
                'Authorization': `Bearer ${API_KEY}`,
                ...form.getHeaders()
              },
              body: form,
              timeout: 120000
            })
              .then(response => {
                if (!response.ok) {
                  throw new Error(`Failed to analyze voice: ${response.status} ${response.statusText}`);
                }
                return response.json();
              })
              .then(data => console.log(data))
              .catch(error => console.error('Error:', error));
        - lang: php
          label: PHP
          source: |
            <?php

            $API_KEY = getenv('AIORNOT_API_KEY');
            $VOICE_ENDPOINT = 'https://api.aiornot.com/v1/reports/voice';

            $curl = curl_init();

            $audioFile = new CURLFile('audio.mp3', 'audio/mpeg', 'file');

            curl_setopt_array($curl, [
              CURLOPT_URL => $VOICE_ENDPOINT,
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_TIMEOUT => 120,
              CURLOPT_POST => true,
              CURLOPT_POSTFIELDS => [
                'file' => $audioFile
              ],
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer $API_KEY"
              ],
            ]);

            $response = curl_exec($curl);
            $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } elseif ($httpCode !== 200) {
              echo "Failed to analyze voice: HTTP $httpCode - $response";
            } else {
              $data = json_decode($response, true);
              print_r($data);
            }
        - lang: go
          label: Go
          source: |
            package main

            import (
              "bytes"
              "fmt"
              "io"
              "io/ioutil"
              "mime/multipart"
              "net/http"
              "os"
              "time"
            )

            func main() {
              APIKey := os.Getenv("AIORNOT_API_KEY")
              voiceEndpoint := "https://api.aiornot.com/v1/reports/voice"

              file, err := os.Open("audio.mp3")
              if err != nil {
                panic(err)
              }
              defer file.Close()

              var requestBody bytes.Buffer
              writer := multipart.NewWriter(&requestBody)

              part, err := writer.CreateFormFile("file", "audio.mp3")
              if err != nil {
                panic(err)
              }

              _, err = io.Copy(part, file)
              if err != nil {
                panic(err)
              }

              err = writer.Close()
              if err != nil {
                panic(err)
              }

              client := &http.Client{
                Timeout: 120 * time.Second,
              }

              req, err := http.NewRequest("POST", voiceEndpoint, &requestBody)
              if err != nil {
                panic(err)
              }

              req.Header.Set("Authorization", "Bearer "+APIKey)
              req.Header.Set("Content-Type", writer.FormDataContentType())

              resp, err := client.Do(req)
              if err != nil {
                panic(err)
              }
              defer resp.Body.Close()

              body, err := ioutil.ReadAll(resp.Body)
              if err != nil {
                panic(err)
              }

              if resp.StatusCode != 200 {
                fmt.Printf("Failed to analyze voice: %d %s\n", resp.StatusCode, string(body))
                return
              }

              fmt.Println(string(body))
            }
        - lang: java
          label: Java
          source: |
            import java.io.File;
            import java.io.IOException;
            import java.util.concurrent.TimeUnit;
            import okhttp3.*;

            public class VoiceAnalysis {
                public static void main(String[] args) {
                    String apiKey = System.getenv("AIORNOT_API_KEY");
                    String voiceEndpoint = "https://api.aiornot.com/v1/reports/voice";
                    
                    OkHttpClient client = new OkHttpClient.Builder()
                        .readTimeout(120, TimeUnit.SECONDS)
                        .build();
                    
                    File audioFile = new File("audio.mp3");
                    
                    RequestBody requestBody = new MultipartBody.Builder()
                        .setType(MultipartBody.FORM)
                        .addFormDataPart("file", audioFile.getName(),
                            RequestBody.create(MediaType.parse("audio/mpeg"), audioFile))
                        .build();
                    
                    Request request = new Request.Builder()
                        .url(voiceEndpoint)
                        .header("Authorization", "Bearer " + apiKey)
                        .post(requestBody)
                        .build();
                    
                    try {
                        Response response = client.newCall(request).execute();
                        if (!response.isSuccessful()) {
                            System.err.println("Failed to analyze voice: " + response.code() + " " + response.body().string());
                        } else {
                            System.out.println(response.body().string());
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
      operationId: get_voice_report_reports_voice_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_get_voice_report_reports_voice_post'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceReportResponse'
      security:
      - HTTPBearer: []
  /v1/reports/music:
    post:
      tags:
      - Reports by Modality
      summary: Audio - Music
      description: 'Analyze an **audio file** to determine if it was generated by
        an AI *music* model.


        This endpoint is only appropriate when you are looking for ai versus human
        generated music. Music means both singing (vocals) and instrumentals.


        **Warning: This endpoint can take up two minutes for long duration audio files
        or if our backend is spinning up additional processing nodes. Please set a
        two minute timeout in your client.**'
      x-codeSamples:
        - lang: python
          label: Python
          source: |
            import os, requests


            # Set API key ENV variable or replace with your own API key
            API_KEY = os.getenv("AIORNOT_API_KEY")
            MUSIC_ENDPOINT = "https://api.aiornot.com/v1/reports/music"

            with open("audio.mp3", "rb") as audio_file:
                files = {"file": audio_file}
                resp = requests.post(
                    MUSIC_ENDPOINT, 
                    headers={"Authorization": f"Bearer {API_KEY}"},
                    files=files,
                    timeout=120
                )
                if resp.status_code != 200:
                    raise Exception(f"Failed to analyze image: {resp.status_code} {resp.text}")

                print(resp.json())
        - lang: curl
          label: cURL
          source: |
            curl --request POST \
              --url https://api.aiornot.com/v1/reports/music \
              --header 'Authorization: Bearer $AIORNOT_API_KEY' \
              --form 'file=@audio.mp3' \
              --max-time 120
        - lang: javascript
          label: JavaScript
          source: |
            const fs = require('fs');
            const FormData = require('form-data');
            const fetch = require('node-fetch');

            const API_KEY = process.env.AIORNOT_API_KEY;
            const MUSIC_ENDPOINT = 'https://api.aiornot.com/v1/reports/music';

            const form = new FormData();
            form.append('file', fs.createReadStream('audio.mp3'));

            fetch(MUSIC_ENDPOINT, {
              method: 'POST',
              headers: {
                'Authorization': `Bearer ${API_KEY}`,
                ...form.getHeaders()
              },
              body: form,
              timeout: 120000
            })
              .then(response => {
                if (!response.ok) {
                  throw new Error(`Failed to analyze music: ${response.status} ${response.statusText}`);
                }
                return response.json();
              })
              .then(data => console.log(data))
              .catch(error => console.error('Error:', error));
        - lang: php
          label: PHP
          source: |
            <?php

            $API_KEY = getenv('AIORNOT_API_KEY');
            $MUSIC_ENDPOINT = 'https://api.aiornot.com/v1/reports/music';

            $curl = curl_init();

            $audioFile = new CURLFile('audio.mp3', 'audio/mpeg', 'file');

            curl_setopt_array($curl, [
              CURLOPT_URL => $MUSIC_ENDPOINT,
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_TIMEOUT => 120,
              CURLOPT_POST => true,
              CURLOPT_POSTFIELDS => [
                'file' => $audioFile
              ],
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer $API_KEY"
              ],
            ]);

            $response = curl_exec($curl);
            $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } elseif ($httpCode !== 200) {
              echo "Failed to analyze music: HTTP $httpCode - $response";
            } else {
              $data = json_decode($response, true);
              print_r($data);
            }
        - lang: go
          label: Go
          source: |
            package main

            import (
              "bytes"
              "fmt"
              "io"
              "io/ioutil"
              "mime/multipart"
              "net/http"
              "os"
              "time"
            )

            func main() {
              APIKey := os.Getenv("AIORNOT_API_KEY")
              musicEndpoint := "https://api.aiornot.com/v1/reports/music"

              file, err := os.Open("audio.mp3")
              if err != nil {
                panic(err)
              }
              defer file.Close()

              var requestBody bytes.Buffer
              writer := multipart.NewWriter(&requestBody)

              part, err := writer.CreateFormFile("file", "audio.mp3")
              if err != nil {
                panic(err)
              }

              _, err = io.Copy(part, file)
              if err != nil {
                panic(err)
              }

              err = writer.Close()
              if err != nil {
                panic(err)
              }

              client := &http.Client{
                Timeout: 120 * time.Second,
              }

              req, err := http.NewRequest("POST", musicEndpoint, &requestBody)
              if err != nil {
                panic(err)
              }

              req.Header.Set("Authorization", "Bearer "+APIKey)
              req.Header.Set("Content-Type", writer.FormDataContentType())

              resp, err := client.Do(req)
              if err != nil {
                panic(err)
              }
              defer resp.Body.Close()

              body, err := ioutil.ReadAll(resp.Body)
              if err != nil {
                panic(err)
              }

              if resp.StatusCode != 200 {
                fmt.Printf("Failed to analyze music: %d %s\n", resp.StatusCode, string(body))
                return
              }

              fmt.Println(string(body))
            }
        - lang: java
          label: Java
          source: |
            import java.io.File;
            import java.io.IOException;
            import java.util.concurrent.TimeUnit;
            import okhttp3.*;

            public class MusicAnalysis {
                public static void main(String[] args) {
                    String apiKey = System.getenv("AIORNOT_API_KEY");
                    String musicEndpoint = "https://api.aiornot.com/v1/reports/music";
                    
                    OkHttpClient client = new OkHttpClient.Builder()
                        .readTimeout(120, TimeUnit.SECONDS)
                        .build();
                    
                    File audioFile = new File("audio.mp3");
                    
                    RequestBody requestBody = new MultipartBody.Builder()
                        .setType(MultipartBody.FORM)
                        .addFormDataPart("file", audioFile.getName(),
                            RequestBody.create(MediaType.parse("audio/mpeg"), audioFile))
                        .build();
                    
                    Request request = new Request.Builder()
                        .url(musicEndpoint)
                        .header("Authorization", "Bearer " + apiKey)
                        .post(requestBody)
                        .build();
                    
                    try {
                        Response response = client.newCall(request).execute();
                        if (!response.isSuccessful()) {
                            System.err.println("Failed to analyze music: " + response.code() + " " + response.body().string());
                        } else {
                            System.out.println(response.body().string());
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
      operationId: get_music_report_reports_music_poalysis including confidence scores
        and model-specific insights. Supports common audio formats like MP3, WAVst
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  title: File
                  description: The audio file to analyze. Must be a valid audio file.
              required:
              - file
            encoding:
              file:
                contentType: audio/*
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MusicReportResponse'
      security:
      - HTTPBearer: []
  /v2/video/sync:
    post:
      tags:
      - Reports by Modality
      summary: Video
      description: 'Analyze a **video file** to determine if it contains AI-generated content.


        This endpoint analyzes both the video and audio components of the file, providing
        separate confidence scores for AI-generated video, voice, and music. It can also optionally
        detect deepfake video content when explicitly requested.


        **Caveats**:

        * This endpoint can take up to two minutes for longer video files or if our backend is spinning up additional processing nodes. Please set a 120 second timeout in your client.

        * This endpoint is synchronous and will only analyze a portion of the content for longer duration videos. The response includes the duration tested. For videos longer than 30 seconds, we recommend breaking them into 30-second segments on the client side for complete analysis.

        * Due to a limitation in our document provider, the playground only supports small files of up to 10MB. This limit does not apply when using the API directly.'
      parameters:
        - name: excluding
          in: query
          description: Array of analysis types to exclude. Valid values are `ai_video`, `ai_music`, `ai_voice`, `deepfake_video`.
          required: false
          schema:
            type: array
            items:
              type: string
              enum: [ai_video, ai_music, ai_voice, deepfake_video]
        - name: only
          in: query
          description: Array of analysis types to include. Valid values are `ai_video`, `ai_music`, `ai_voice`, `deepfake_video`. **Note:** `deepfake_video` is OFF by default and must be explicitly included using this parameter if you want deepfake detection.
          required: false
          schema:
            type: array
            items:
              type: string
              enum: [ai_video, ai_music, ai_voice, deepfake_video]
        - name: external_id
          in: query
          description: An optional external identifier for tracking this video analysis.
          required: false
          schema:
            type: string
            nullable: true
      x-codeSamples:
        - lang: python
          label: Python
          source: |
            import os, requests


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

            with open("video.mp4", "rb") as video_file:
                files = {"video": video_file}
                resp = requests.post(
                    VIDEO_ENDPOINT,
                    headers={"Authorization": f"Bearer {API_KEY}"},
                    files=files,
                    # Uncomment below to use only, excluding, or external_id params.
                    # params={
                    #   "only": ["ai_video", "ai_voice"],
                    #   "excluding": ["ai_music"],
                    #   "external_id": "my-tracking-id-123"
                    # },
                    # To enable deepfake detection (OFF by default), include it in the only param:
                    # params={
                    #   "only": ["deepfake_video"]
                    # },
                    timeout=120
                )
                if resp.status_code != 200:
                    raise Exception(f"Failed to analyze video: {resp.status_code} {resp.text}")

                print(resp.json())
        - lang: curl
          label: cURL
          source: |
            curl --request POST \
              --url https://api.aiornot.com/v2/video/sync \
              --header 'Authorization: Bearer $AIORNOT_API_KEY' \
              --form 'video=@video.mp4' \
              --max-time 120
        - lang: javascript
          label: JavaScript
          source: |
            const fs = require('fs');
            const FormData = require('form-data');
            const fetch = require('node-fetch');

            const API_KEY = process.env.AIORNOT_API_KEY;
            const VIDEO_ENDPOINT = 'https://api.aiornot.com/v2/video/sync';

            const form = new FormData();
            form.append('video', fs.createReadStream('video.mp4'));

            fetch(VIDEO_ENDPOINT, {
              method: 'POST',
              headers: {
                'Authorization': `Bearer ${API_KEY}`,
                ...form.getHeaders()
              },
              body: form,
              timeout: 120000
            })
              .then(response => {
                if (!response.ok) {
                  throw new Error(`Failed to analyze video: ${response.status} ${response.statusText}`);
                }
                return response.json();
              })
              .then(data => console.log(data))
              .catch(error => console.error('Error:', error));
        - lang: php
          label: PHP
          source: |
            <?php

            $API_KEY = getenv('AIORNOT_API_KEY');
            $VIDEO_ENDPOINT = 'https://api.aiornot.com/v2/video/sync';

            $curl = curl_init();

            $videoFile = new CURLFile('video.mp4', 'video/mp4', 'video');

            curl_setopt_array($curl, [
              CURLOPT_URL => $VIDEO_ENDPOINT,
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_TIMEOUT => 120,
              CURLOPT_POST => true,
              CURLOPT_POSTFIELDS => [
                'video' => $videoFile
              ],
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer $API_KEY"
              ],
            ]);

            $response = curl_exec($curl);
            $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } elseif ($httpCode !== 200) {
              echo "Failed to analyze video: HTTP $httpCode - $response";
            } else {
              $data = json_decode($response, true);
              print_r($data);
            }
        - lang: go
          label: Go
          source: |
            package main

            import (
              "bytes"
              "fmt"
              "io"
              "io/ioutil"
              "mime/multipart"
              "net/http"
              "os"
              "time"
            )

            func main() {
              APIKey := os.Getenv("AIORNOT_API_KEY")
              videoEndpoint := "https://api.aiornot.com/v2/video/sync"

              file, err := os.Open("video.mp4")
              if err != nil {
                panic(err)
              }
              defer file.Close()

              var requestBody bytes.Buffer
              writer := multipart.NewWriter(&requestBody)

              part, err := writer.CreateFormFile("video", "video.mp4")
              if err != nil {
                panic(err)
              }

              _, err = io.Copy(part, file)
              if err != nil {
                panic(err)
              }

              err = writer.Close()
              if err != nil {
                panic(err)
              }

              client := &http.Client{
                Timeout: 120 * time.Second,
              }

              req, err := http.NewRequest("POST", videoEndpoint, &requestBody)
              if err != nil {
                panic(err)
              }

              req.Header.Set("Authorization", "Bearer "+APIKey)
              req.Header.Set("Content-Type", writer.FormDataContentType())

              resp, err := client.Do(req)
              if err != nil {
                panic(err)
              }
              defer resp.Body.Close()

              body, err := ioutil.ReadAll(resp.Body)
              if err != nil {
                panic(err)
              }

              if resp.StatusCode != 200 {
                fmt.Printf("Failed to analyze video: %d %s\n", resp.StatusCode, string(body))
                return
              }

              fmt.Println(string(body))
            }
        - lang: java
          label: Java
          source: |
            import java.io.File;
            import java.io.IOException;
            import java.util.concurrent.TimeUnit;
            import okhttp3.*;

            public class VideoAnalysis {
                public static void main(String[] args) {
                    String apiKey = System.getenv("AIORNOT_API_KEY");
                    String videoEndpoint = "https://api.aiornot.com/v2/video/sync";
                    
                    OkHttpClient client = new OkHttpClient.Builder()
                        .readTimeout(120, TimeUnit.SECONDS)
                        .build();
                    
                    File videoFile = new File("video.mp4");
                    
                    RequestBody requestBody = new MultipartBody.Builder()
                        .setType(MultipartBody.FORM)
                        .addFormDataPart("video", videoFile.getName(),
                            RequestBody.create(MediaType.parse("video/mp4"), videoFile))
                        .build();
                    
                    Request request = new Request.Builder()
                        .url(videoEndpoint)
                        .header("Authorization", "Bearer " + apiKey)
                        .post(requestBody)
                        .build();
                    
                    try {
                        Response response = client.newCall(request).execute();
                        if (!response.isSuccessful()) {
                            System.err.println("Failed to analyze video: " + response.code() + " " + response.body().string());
                        } else {
                            System.out.println(response.body().string());
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
      operationId: get_video_report_reports_video_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                video:
                  type: string
                  format: binary
                  title: Video
                  description: |
                    The video file to analyze. Must be a valid video file.
                    
                    Supported formats include:
                    - 3gp
                    - avi 
                    - flv
                    - gif
                    - m4v
                    - mkv
                    - mov
                    - mp4
                    - mpeg
                    - mpg
                    - mxf
                    - ts
                    - vob
                    - webm
                    - wmv

                    Maximum file size: 200MB
                    
                    For videos with multiple audio or video tracks, only the first track of each type will be analyzed. Videos without audio are allowed - in this case, no audio analysis will be performed.
              required:
              - video
            encoding:
              video:
                contentType: video/*
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoReportResponse'
      security:
      - HTTPBearer: []
  /v2/text/sync:
    post:
      tags:
      - Reports by Modality
      summary: Text
      description: 'Analyze **text** to determine if it was generated by AI.


        This endpoint analyzes text content and returns confidence scores for AI detection.


        **Text Processing Limits:**

        - **Minimum Text Length:** 250 characters

        - **Maximum Text Length:** 500,000 characters (500KB)

        - **Minimum Words**: Approximately 64 words'
      operationId: get_text_report_text_sync_post
      parameters:
        - name: external_id
          in: query
          description: An optional external identifier for tracking this text analysis
          required: false
          schema:
            type: string
            nullable: true
        - name: include_annotations
          in: query
          description: Include block-level AI detection annotations in the response
          required: false
          schema:
            type: boolean
            default: false
      x-codeSamples:
        - lang: python
          label: Python
          source: |
            import os, requests


            # Set API key ENV variable or replace with your own API key
            API_KEY = os.getenv("AIORNOT_API_KEY")
            TEXT_ENDPOINT = "https://api.aiornot.com/v2/text/sync"
            
            data = {
                "text": "Your text content to analyze goes here..."
            }
            
            resp = requests.post(
                TEXT_ENDPOINT,
                headers={"Authorization": f"Bearer {API_KEY}"},
                data=data,
                params={
                    "include_annotations": True,  # Optional: Include block-level annotations
                    "external_id": "my-tracking-id"  # Optional: External tracking ID
                }
            )
            resp.raise_for_status()
            print(resp.json())
        - lang: curl
          label: cURL
          source: |
            curl --request POST \
              --url 'https://api.aiornot.com/v2/text/sync?include_annotations=true&external_id=my-tracking-id' \
              --header 'Authorization: Bearer $AIORNOT_API_KEY' \
              --header 'Content-Type: application/x-www-form-urlencoded' \
              --data 'text=Your text content to analyze goes here...'
        - lang: javascript
          label: JavaScript
          source: |
            const fetch = require('node-fetch');
            const querystring = require('querystring');

            const API_KEY = process.env.AIORNOT_API_KEY;
            const TEXT_ENDPOINT = 'https://api.aiornot.com/v2/text/sync';

            const data = querystring.stringify({
              text: 'Your text content to analyze goes here...'
            });

            const params = new URLSearchParams({
              include_annotations: 'true',  // Optional: Include block-level annotations
              external_id: 'my-tracking-id'  // Optional: External tracking ID
            });

            fetch(`${TEXT_ENDPOINT}?${params}`, {
              method: 'POST',
              headers: {
                'Authorization': `Bearer ${API_KEY}`,
                'Content-Type': 'application/x-www-form-urlencoded'
              },
              body: data
            })
              .then(response => {
                if (!response.ok) {
                  throw new Error(`Failed to analyze text: ${response.status} ${response.statusText}`);
                }
                return response.json();
              })
              .then(data => console.log(data))
              .catch(error => console.error('Error:', error));
        - lang: php
          label: PHP
          source: |
            <?php

            $API_KEY = getenv('AIORNOT_API_KEY');
            $TEXT_ENDPOINT = 'https://api.aiornot.com/v2/text/sync';

            $curl = curl_init();

            $data = [
              'text' => 'Your text content to analyze goes here...'
            ];

            $query_params = http_build_query([
              'include_annotations' => 'true',  // Optional: Include block-level annotations
              'external_id' => 'my-tracking-id'  // Optional: External tracking ID
            ]);

            curl_setopt_array($curl, [
              CURLOPT_URL => $TEXT_ENDPOINT . '?' . $query_params,
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_POST => true,
              CURLOPT_POSTFIELDS => http_build_query($data),
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer $API_KEY",
                "Content-Type: application/x-www-form-urlencoded"
              ],
            ]);

            $response = curl_exec($curl);
            $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } elseif ($httpCode !== 200) {
              echo "Failed to analyze text: HTTP $httpCode - $response";
            } else {
              $data = json_decode($response, true);
              print_r($data);
            }
        - lang: go
          label: Go
          source: |
            package main

            import (
              "fmt"
              "io/ioutil"
              "net/http"
              "net/url"
              "os"
              "strings"
            )

            func main() {
              APIKey := os.Getenv("AIORNOT_API_KEY")
              textEndpoint := "https://api.aiornot.com/v2/text/sync"

              data := url.Values{}
              data.Set("text", "Your text content to analyze goes here...")

              params := url.Values{}
              params.Set("include_annotations", "true")  // Optional: Include block-level annotations
              params.Set("external_id", "my-tracking-id")  // Optional: External tracking ID

              fullURL := textEndpoint + "?" + params.Encode()

              req, err := http.NewRequest("POST", fullURL, strings.NewReader(data.Encode()))
              if err != nil {
                panic(err)
              }

              req.Header.Set("Authorization", "Bearer "+APIKey)
              req.Header.Set("Content-Type", "application/x-www-form-urlencoded")

              client := &http.Client{}
              resp, err := client.Do(req)
              if err != nil {
                panic(err)
              }
              defer resp.Body.Close()

              body, err := ioutil.ReadAll(resp.Body)
              if err != nil {
                panic(err)
              }

              if resp.StatusCode != 200 {
                fmt.Printf("Failed to analyze text: %d %s\n", resp.StatusCode, string(body))
                return
              }

              fmt.Println(string(body))
            }
        - lang: java
          label: Java
          source: |
            import java.io.IOException;
            import okhttp3.*;

            public class TextAnalysis {
                public static void main(String[] args) {
                    String apiKey = System.getenv("AIORNOT_API_KEY");
                    String textEndpoint = "https://api.aiornot.com/v2/text/sync";
                    
                    OkHttpClient client = new OkHttpClient();
                    
                    RequestBody formBody = new FormBody.Builder()
                        .add("text", "Your text content to analyze goes here...")
                        .build();
                    
                    HttpUrl url = HttpUrl.parse(textEndpoint).newBuilder()
                        .addQueryParameter("include_annotations", "true")  // Optional: Include block-level annotations
                        .addQueryParameter("external_id", "my-tracking-id")  // Optional: External tracking ID
                        .build();
                    
                    Request request = new Request.Builder()
                        .url(url)
                        .header("Authorization", "Bearer " + apiKey)
                        .post(formBody)
                        .build();
                    
                    try {
                        Response response = client.newCall(request).execute();
                        if (!response.isSuccessful()) {
                            System.err.println("Failed to analyze text: " + response.code() + " " + response.body().string());
                        } else {
                            System.out.println(response.body().string());
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                text:
                  type: string
                  title: Text
                  description: The text content to analyze for AI generation (minimum 250 characters, maximum 500,000 characters)
                  minLength: 250
                  maxLength: 500000
              required:
              - text
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextReportResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/system/live:
    get:
      tags:
      - SYSTEM MANAGEMENT
      summary: Is Live
      description: 'Check if the API is live.


        This is useful for diagnosing issues with your integration. Is there a bug
        on your side, or are we simply down? You should not hit this endpoint very
        frequently as our system may flag it as abuse.


        Please see also [our status page](https://status.aiornot.com/).'
      operationId: is_live_system_live_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LiveStatus'
components:
  schemas:
    AIONGenerateVerdict:
      type: string
      enum:
      - ai
      - human
      title: AIONGenerateVerdict
      description: Generate verdict.
    AIONGeneratorScheme:
      properties:
        midjourney:
          $ref: '#/components/schemas/AIONPredictionBase'
          example: 0.95
        dall_e:
          $ref: '#/components/schemas/AIONPredictionBase'
          example: 0.95
        stable_diffusion:
          $ref: '#/components/schemas/AIONPredictionBase'
          example: 0.95
        this_person_does_not_exist:
          $ref: '#/components/schemas/AIONPredictionBase'
          example: 0.95
        adobe_firefly:
          $ref: '#/components/schemas/AIONPredictionBase'
          example: 0.95
        flux:
          $ref: '#/components/schemas/AIONPredictionBase'
          example: 0.95
        four_o:
          $ref: '#/components/schemas/AIONPredictionBase'
          example: 0.95
      type: object
      required:
      - midjourney
      - dall_e
      - stable_diffusion
      - this_person_does_not_exist
      - adobe_firefly
      - flux
      - four_o
      title: AIONGeneratorScheme
      description: 'A map of generator names to their prediction base.Please note
        that

        - This list is not exhaustive. We have trained on more generators than appear
        here.

        - We may add new generators at any time, so please make sure your integration
        allows for field addition without error.'
    AIONPredictionBase:
      properties:
        is_detected:
          type: boolean
          title: Is Detected
          description: Indicates whether the particular class was detected.
        confidence:
          type: number
          title: Confidence
          minimum: 0
          maximum: 1
          example: 0.95
          description: Confidence score for the particular class.
      type: object
      required:
      - is_detected
      - confidence
      title: AIONPredictionBase
    AIONPredictionType2:
      properties:
        is_detected:
          type: boolean
          title: Is Detected
      type: object
      required:
      - is_detected
      title: AIONPredictionType2
    AIONReportScheme:
      properties:
        verdict:
          title: Verdict
          description: 'The predicted class of the uploaded image.


            This is the most important field in the response. This field is more reliable
            than directly using the confidence score yourself, as the confidence score
            may drift over time for new models.'
          enum:
          - ai
          - human
          - unknown
        ai:
          $ref: '#/components/schemas/AIONPredictionBase'
          example:
            is_detected: true
            confidence: 0.95
        human:
          $ref: '#/components/schemas/AIONPredictionBase'
          example:
            is_detected: false
            confidence: 0.05
        generator:
          $ref: '#/components/schemas/AIONGeneratorScheme'
      type: object
      required:
      - verdict
      - ai
      - human
      - generator
      title: AIONReportScheme
    AudioReportResponse:
      properties:
        report:
          $ref: '#/components/schemas/ShareReport'
      type: object
      required:
      - report
      title: AudioReportResponse
    BboxScheme:
      properties:
        x:
          type: number
          title: X
          example: 120
        y:
          type: number
          title: Y
          example: 85
        w:
          type: number
          title: W
          example: 260
        h:
          type: number
          title: H
          example: 210
      type: object
      required:
      - x
      - y
      - w
      - h
      title: BboxScheme
    Body_get_music_report_reports_music_post:
      properties:
        file:
          type: string
          format: binary
          title: File
      type: object
      required:
      - file
      title: Body_get_music_report_reports_music_post
    Body_get_voice_report_reports_audio_post:
      properties:
        object:
          type: string
          format: binary
          title: Object
      type: object
      required:
      - object
      title: Body_get_voice_report_reports_audio_post
    Body_get_voice_report_reports_voice_post:
      properties:
        file:
          type: string
          format: binary
          title: File
          description: The audio file to analyze. Must be a valid audio file.
      type: object
      required:
      - file
      title: Body_get_voice_report_reports_voice_post
    DeepFakeVerdict:
      type: string
      enum:
      - deepfake
      - real
      title: DeepFakeVerdict
    FacetsScheme:
      properties:
        quality:
          anyOf:
          - $ref: '#/components/schemas/QualityReportScheme'
          - type: 'null'
        nsfw:
          anyOf:
          - $ref: '#/components/schemas/NSFWReportScheme'
          - type: 'null'
          title: Nsfw
      type: object
      required:
      - quality
      - nsfw
      title: FacetsScheme
    ImageDeepFakeReportResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        max_confidence:
          type: number
          title: Max Confidence
          description: Field that indicates the maximum confidence of the prediction.
          example: 0.95
          minimum: 0
          maximum: 1
        is_detected:
          type: boolean
          title: Is Detected
          description: Field that indicates whether the aion_image was modified with
            AI or not.
        rois:
          items:
            $ref: '#/components/schemas/RoiReportScheme'
          type: array
          title: Rois
          description: Field that contains the list of regions of interest.
      type: object
      required:
      - id
      - max_confidence
      - is_detected
      - rois
      title: ImageDeepFakeReportResponse
    ImageReportResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Unique identifier associated with the request.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Date and time of request processing.
        report:
          $ref: '#/components/schemas/AIONReportScheme'
          title: Report
        facets:
          $ref: '#/components/schemas/FacetsScheme'
      type: object
      required:
      - id
      - report
      - facets
      title: ImageReportResponse
    V2ImageReportResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Unique identifier associated with the request.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Date and time of request processing.
        report:
          type: object
          properties:
            ai_generated:
              $ref: '#/components/schemas/AIONReportScheme'
            deepfake:
              anyOf:
              - $ref: '#/components/schemas/DeepFakeReportScheme'
              - type: 'null'
            nsfw:
              anyOf:
              - $ref: '#/components/schemas/NSFWReportScheme'
              - type: 'null'
            quality:
              anyOf:
              - $ref: '#/components/schemas/QualityReportScheme'
              - type: 'null'
            reverse_search:
              anyOf:
              - $ref: '#/components/schemas/ReverseSearchReportScheme'
              - type: 'null'
            meta:
              $ref: '#/components/schemas/ImageMetadata'
          required:
          - meta
        external_id:
          type: string
          nullable: true
          title: External Id
          description: The external identifier provided in the request, if any.
      type: object
      required:
      - id
      - report
      title: V2ImageReportResponse
    LiveStatus:
      properties:
        is_live:
          type: boolean
          title: Is Live
          default: true
      type: object
      title: LiveStatus
      description: Indicates that API is live.
    MusicReportResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        report:
          $ref: '#/components/schemas/ShareMusicReport'
      type: object
      required:
      - id
      - report
      title: MusicReportResponse
    NSFWReportScheme:
      properties:
        version:
          type: string
          title: Version
          default: 1.0.0
        is_detected:
          type: boolean
          title: Is Detected
          description: True if NSFW content found in the image. Please note that for
            us, the mere presence of a child is enough to trigger this flag. We offer
            a more granular NSFW report for clients who need it. Please contact us
            if this describes you.
      type: object
      required:
      - is_detected
      title: NSFWReportScheme
    DeepFakeReportScheme:
      properties:
        is_detected:
          type: boolean
          title: Is Detected
          example: true
        confidence:
          type: number
          title: Confidence
          example: 0.95
          minimum: 0
          maximum: 1
        rois:
          items:
            $ref: '#/components/schemas/RoisReportScheme'
          type: array
          title: Rois
      type: object
      required:
      - is_detected
      - confidence
      - rois
      title: DeepFakeReportScheme
    ReverseSearchMatch:
      properties:
        domain:
          type: string
          title: Domain
          description: The domain where the matching image was found
          example: cnet.com
        image_url:
          type: string
          title: Image URL
          description: URL of the matching image
          example: https://img.tineye.com/result/59752e592ddca832cb36bf200135b4f30f6fadca2ea4acc7c63f8dd231463c72-43
        width:
          type: integer
          title: Width
          description: Width of the matching image in pixels
          example: 196
        height:
          type: integer
          title: Height
          description: Height of the matching image in pixels
          example: 147
        earliest_crawl_date:
          type: string
          title: Earliest Crawl Date
          description: The earliest date this image was crawled (YYYY-MM-DD format)
          example: "2021-03-26"
        earliest_backlink:
          type: string
          title: Earliest Backlink
          description: URL of the earliest page where this image was found
          example: https://www.cnet.com/topics/internet-culture/2/
      type: object
      required:
      - domain
      - image_url
      - width
      - height
      - earliest_crawl_date
      - earliest_backlink
      title: ReverseSearchMatch
    ReverseSearchReportScheme:
      properties:
        was_found:
          type: boolean
          title: Was Found
          description: Indicates whether matching images were found on the web
          example: true
        matches:
          items:
            $ref: '#/components/schemas/ReverseSearchMatch'
          type: array
          title: Matches
          description: List of matching images found on the web
      type: object
      required:
      - was_found
      - matches
      title: ReverseSearchReportScheme
    DeepfakeVideoReportScheme:
      properties:
        is_detected:
          type: boolean
          title: Is Detected
          description: Whether deepfake video content was detected
          example: true
        confidence:
          type: number
          title: Confidence
          description: Confidence score for deepfake detection
          example: 0.936413076150301
          minimum: 0
          maximum: 1
        no_faces_found:
          type: boolean
          title: No Faces Found
          description: Indicates whether no faces were found in the video
          example: false
      type: object
      required:
      - is_detected
      - confidence
      - no_faces_found
      title: DeepfakeVideoReportScheme
    RoisReportScheme:
      properties:
        is_detected:
          type: boolean
          title: Is Detected
          example: true
        confidence:
          type: number
          title: Confidence
          example: 0.95
          minimum: 0
          maximum: 1
        bbox:
          $ref: '#/components/schemas/BBoxScheme'
      type: object
      required:
      - is_detected
      - confidence
      - bbox
      title: RoisReportScheme
    BBoxScheme:
      properties:
        x1:
          type: integer
          title: X1
          example: 120
        y1:
          type: integer
          title: Y1
          example: 85
        x2:
          type: integer
          title: X2
          example: 380
        y2:
          type: integer
          title: Y2
          example: 295
      type: object
      required:
      - x1
      - y1
      - x2
      - y2
      title: BBoxScheme
    ImageMetadata:
      properties:
        width:
          anyOf:
          - type: integer
          - type: 'null'
          title: Width
          example: 640
        height:
          anyOf:
          - type: integer
          - type: 'null'
          title: Height
          example: 480
        format:
          anyOf:
          - type: string
          - type: 'null'
          title: Format
          example: "jpeg"
        size_bytes:
          anyOf:
          - type: integer
          - type: 'null'
          title: Size Bytes
          example: 102400
        md5:
          anyOf:
          - type: string
          - type: 'null'
          title: Md5
          example: "a1b2c3d4e5f6789012345678901234567"
        processing_status:
          additionalProperties:
            $ref: '#/components/schemas/ReportStatus'
          propertyNames:
            $ref: '#/components/schemas/ImageReportType'
          type: object
          title: Processing Status
          example:
            ai_generated: "processed"
            deepfake: "processed"
            nsfw: "processed"
            quality: "processed"
      type: object
      required:
      - width
      - height
      - format
      - size_bytes
      - md5
      - processing_status
      title: ImageMetadata
    ImageReportType:
      type: string
      enum:
      - ai_generated
      - deepfake
      - nsfw
      - quality
      - reverse_search
      title: ImageReportType
    ReportStatus:
      type: string
      enum:
      - processed
      - rejected
      - errored
      title: ReportStatus
    QualityReportScheme:
      properties:
        is_detected:
          type: boolean
          title: Is Detected
          description: Indicates whether the image is of high quality. **Low quality (`false`)
            is not a asthetic judgement.** It merely means that there are artifacts
            present that indicate things like excessive compression or blurring which
            degrades the performance of other classifiers (e.g. ai image detection).
      type: object
      required:
      - is_detected
      title: QualityReportScheme
    RoiReportScheme:
      properties:
        bbox:
          $ref: '#/components/schemas/BboxScheme'
        confidence:
          type: number
          title: Confidence
          example: 0.95
          minimum: 0
          maximum: 1
        is_detected:
          type: boolean
          title: Is Detected
          example: true
      type: object
      required:
      - bbox
      - confidence
      - is_detected
      title: RoiReportScheme
    ShareMusicReport:
      properties:
        verdict:
          $ref: '#/components/schemas/AIONGenerateVerdict'
        confidence:
          type: number
          title: Confidence
          description: Confidence score for whether this audio file is ai-generated.
          minimum: 0
          maximum: 1
          example: 0.95
        duration:
          type: integer
          title: Duration
          description: Duration of the audio file in seconds.
          example: 120
        total_bytes:
          type: integer
          title: Total Bytes
          description: Total size of the audio file in bytes.
          example: 362594
        md5:
          type: string
          title: MD5
          description: MD5 hash of the uploaded audio file.
          example: db36d923800f6ca6b7f87cff8a19d1d1
      type: object
      required:
      - verdict
      - confidence
      - duration
      - total_bytes
      - md5
      title: ShareMusicReport
    ShareReport:
      properties:
        verdict:
          $ref: '#/components/schemas/AIONGenerateVerdict'
        confidence:
          type: number
          title: Confidence
      type: object
      required:
      - verdict
      - confidence
      title: ShareReport
    ShareVoiceReport:
      properties:
        verdict:
          $ref: '#/components/schemas/AIONGenerateVerdict'
        confidence:
          type: number
          title: Confidence
          minimum: 0
          maximum: 1
          example: 0.95
        duration:
          type: integer
          title: Duration
          example: 120
        total_bytes:
          type: integer
          title: Total Bytes
          example: 362594
        md5:
          type: string
          title: Md5
          example: db36d923800f6ca6b7f87cff8a19d1d1
      type: object
      required:
      - verdict
      - confidence
      - duration
      - total_bytes
      - md5
      title: ShareVoiceReport
    VideoReportResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        external_id:
          type: string
          nullable: true
          title: External ID
          description: The external identifier provided in the request, if any.
        created_at:
          type: string
          format: date-time
          title: Created At
        report:
          $ref: '#/components/schemas/ShareVideoReport'
      type: object
      required:
      - id
      - report
      title: VideoReportResponse
    ShareVideoReport:
      properties:
        ai_video:
          $ref: '#/components/schemas/AIONPredictionBase'
        ai_voice:
          anyOf:
          - $ref: '#/components/schemas/AIONPredictionBase'
          - type: 'null'
        ai_music:
          anyOf:
          - $ref: '#/components/schemas/AIONPredictionBase'
          - type: 'null'
        deepfake_video:
          anyOf:
          - $ref: '#/components/schemas/DeepfakeVideoReportScheme'
          - type: 'null'
        meta:
          type: object
          properties:
            duration:
              type: integer
              title: Duration
              description: Duration of video processed.
              example: 120
            total_bytes:
              type: integer
              title: Total Bytes
              description: Total size of the video file in bytes.
              example: 362594
            md5:
              type: string
              title: MD5
              description: MD5 hash of the uploaded video file.
              example: db36d923800f6ca6b7f87cff8a19d1d1
            audio:
              type: string
              title: Audio
              description: Should be 'processed' if successful. If unable to process audio, it will be 'error'.
              example: processed
            video:
              type: string
              title: Video
              description: Should be 'processed' if successful. If unable to process video, it will be 'error'.
              example: processed
          required:
          - duration
          - total_bytes
          - md5
          - audio
          - video
      type: object
      required:
      - ai_video
      - ai_voice
      - ai_music
      - meta
      title: ShareVideoReport
    VoiceReportResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        report:
          $ref: '#/components/schemas/ShareVoiceReport'
      type: object
      required:
      - id
      - report
      title: VoiceReportResponse
    TextReportResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Unique identifier associated with the request
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Date and time of request processing
        report:
          type: object
          properties:
            ai_text:
              $ref: '#/components/schemas/AITextReportScheme'
          required:
          - ai_text
        metadata:
          $ref: '#/components/schemas/TextMetadata'
        external_id:
          type: string
          nullable: true
          title: External Id
          description: The external identifier provided in the request, if any
      type: object
      required:
      - id
      - report
      - metadata
      title: TextReportResponse
    AITextReportScheme:
      properties:
        confidence:
          type: number
          title: Confidence
          description: Confidence score for AI-generated text detection
          minimum: 0
          maximum: 1
          example: 0.95
        is_detected:
          type: boolean
          title: Is Detected
          description: Whether AI-generated text was detected
        annotations:
          type: array
          title: Annotations
          description: Block-level AI detection results (only included when include_annotations=true)
          items:
            type: array
            minItems: 2
            maxItems: 2
            items:
              - type: string
                description: Text block
              - type: number
                description: Confidence score for this block
                minimum: 0
                maximum: 1
          example:
            - ["This is the first block of text.", 0.9999]
            - ["This is the second block of text.", 0.0012]
      type: object
      required:
      - confidence
      - is_detected
      title: AITextReportScheme
    TextMetadata:
      properties:
        word_count:
          type: integer
          title: Word Count
          description: Number of words in the analyzed text
          example: 150
        character_count:
          type: integer
          title: Character Count
          description: Number of characters in the analyzed text
          example: 750
        token_count:
          type: integer
          title: Token Count
          description: Number of tokens in the analyzed text
          example: 200
        md5:
          type: string
          title: MD5
          description: MD5 hash of the analyzed text
          example: "ebe5836f4d7dddc3f9a957eff565be21"
      type: object
      required:
      - word_count
      - character_count
      - token_count
      - md5
      title: TextMetadata
    HTTPValidationError:
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          type: array
          items:
            oneOf:
            - type: string
            - type: integer
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: Your [API key](https://www.aiornot.com/dashboard/api) as the `Bearer`
        token in the `Authorization` header.

