Skip to main content
POST
AI Image Detection

Overview

Use POST /api/v1/ai-detection/image to check whether an image is AI-generated. Send the image as base64 or as a direct link to the image file. Detection is run by Pangram.
To check an image without code, use the AI image detector on nano-gpt.com. It uses the same detectors and prices.

Endpoint

Authentication

An API key is required. Browser sessions are not accepted.
  • Authorization: Bearer YOUR_API_KEY
  • x-api-key: YOUR_API_KEY

Request Body

Send a link:
Or send the image itself:

Parameters

Send exactly one of image or image_url.

Models and Pricing

Your balance and any API key spend limits must cover the price before the image is read. You are charged only when a result is returned; a detector failure is not charged. If you disconnect after the image reaches the detector, the check still finishes and is charged. For API keys with an allowed-model list, the list must include pangram-image-detection (for pangram-image-1) or pangram-image-flash-detection (for pangram-image-flash-1).

Image Rules

  • Formats: PNG, JPEG or WebP.
  • Size: up to 32 MiB (33,554,432 bytes).
  • The JSON request body is limited to 4,400,000 bytes, so base64 images above about 3.3 MB must be sent with image_url.
  • image_url must be a direct link to the image file, not a web page that shows it. Links with a username or password are refused. The download times out after 30 seconds.
  • Link downloads count against the same per-account and per-IP request and byte quotas as other NanoGPT remote file fetches.
  • Up to 10 AI detection checks can run at once per account. This limit is shared with text detection.

Response

The request returns when the check finishes. The server stops waiting for the detector about 280 seconds after the request starts and returns 504 with code timeout.

Example

Send a local file as base64:

Common Errors

Errors use this shape: