Getting started / Introduction
Getting started

Introduction

Detectivision is a content moderation API for text, images, video, audio and live streams: send content, get back the flags it raised and their confidence.

On this page

Detectivision checks content for you. Send a piece of text, an image or a video (the file itself, or its address), the address of a recording, or start a live session, and get back which flags it raised and how sure the models are. In text and images every flag judges the whole text or image: answers have no positions, and capture and censor return what detect returns, at the same price.

It is a serverless API: there is nothing to install or scale. You call one HTTPS endpoint with an API key and pay only for completed checks.

curl https://api.detectivision.ai/api/v1/moderation \
  -H "Api-Key: $DETECTIVISION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "image_moderation", "input": "https://example.com/photo.jpg"}'
import os, requests

r = requests.post(
    "https://api.detectivision.ai/api/v1/moderation",
    headers={"Api-Key": os.environ["DETECTIVISION_API_KEY"]},
    json={"type": "image_moderation", "input": "https://example.com/photo.jpg"},
)
print(r.json()["flagged"])
const res = await fetch("https://api.detectivision.ai/api/v1/moderation", {
  method: "POST",
  headers: { "Api-Key": process.env.DETECTIVISION_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ type: "image_moderation", input: "https://example.com/photo.jpg" }),
});
const { flagged, flags } = await res.json();

What you can moderate#

Type Input What comes back
Text The text itself, up to 10,000 characters (English, Spanish, Portuguese, French, German, Italian, Turkish, Arabic, Russian, Hindi, Chinese and Japanese) The flags raised, each with its confidence.
Image The image as a file, its URL or base64 (JPEG, PNG, WebP, BMP, GIF, up to 10 MB) The flags raised, each with its confidence.
Video The video as a file (up to 20 MB) or its URL (up to 100 MB): MP4, MOV, WebM, MKV, AVI The flags raised, each with its confidence, and when and where each finding is.
Audio The address of a recording: a podcast episode, a voice message, a call The flags raised, each with its confidence and the start and end of each finding in seconds.
Live stream A stream link (RTSP, RTMP, HLS, HTTP, SRT) or frames from your camera The flags raised on each frame, and the flagged moments, kept with their picture.

Key concepts#

  • Moderation type. What kind of content you send: text_moderation, image_moderation, video_moderation or audio_moderation; live streams are checked in live sessions. Each type has its own credits.
  • Flag. A category the checks look for. Your account's flags depend on its plan; GET /api/v1/flags lists them. A result lists the flags that were raised. See Flags.
  • Mode. How much you want back: detect, capture (the default) or censor. For text and images all three return the flags and their confidence, at the same price. See Modes and censoring.
  • Credits. Each completed check costs credits from the type's balance; a check that could not finish costs nothing. See Credits and billing.
  • Result. Every check returns the same shape: flagged, the flags with their detections, the flags checked, and usage. See Responses.

Where to go next#