Use CamScanner to detect whether an image was generated by an AI model (e.g. Stable Diffusion, Midjourney, DALL·E). Powered by an AIGC-detection engine that...
---
name: camscanner-image-detect-aigc
description: Use CamScanner to detect whether an image was generated by an AI model (e.g. Stable Diffusion, Midjourney, DALL·E). Powered by an AIGC-detection engine that classifies an image as genuine, suspected AI-generated, or AI-generated, with a confidence score. Returns a JSON result containing `ai_check_result` (1/2/3), `confidence`, and `result_text`. Use when the user asks whether a photo is AI-generated, wants to verify an image's authenticity against AI generation, or asks "is this AI art / Stable Diffusion / Midjourney?". Triggers on "检测AI生成", "是不是AI画的", "AIGC检测", "AI图片识别", "detect AI-generated image", "is this AI art", "is this diffusion / midjourney", or when the user shares an image and asks whether it was produced by AI.
metadata:
author: CamScanner
version: "1.0"
openclaw:
emoji: "🤖"
requires:
bins: ["curl", "jq"]
homepage: "https://www.camscanner.com"
---
# CamScanner Image Detect AIGC
## Overview
CamScanner provides an AIGC-detection engine that determines whether an image was produced by an AI generator. The workflow is a 2-step pipeline: **upload** the image, then **validate** it with `validate_mode: 2`. Unlike conversion skills, this skill does not produce a file — the validate step returns a JSON result whose key fields (`ai_check_result`, `confidence`, `result_text`) should be reported back to the user directly.
## When to Use
- User asks whether an image was generated by AI (Stable Diffusion, Midjourney, DALL·E, etc.)
- User wants to distinguish a real photo from AI-generated artwork
- User asks "is this AI art / AI-generated?" or similar authenticity questions
- User shares an image and explicitly asks whether it came from a generative model
## Presenting the Result
- Always read `ai_check_result`, `confidence`, and `result_text` from the response and report them in plain language.
- Map `ai_check_result` to a verdict: `1` = not AI-generated, `2` = suspected AI-generated, `3` = AI-generated.
- Include the `confidence` value (a float in `[0, 1]`) so the user understands how certain the verdict is.
- **Match the user's language.** `result_text` is returned in Chinese by the API. If the user asked in English (or any other language), translate/rephrase it into that language. If the user asked in Chinese, you can use `result_text` as-is.
- Do not overstate the verdict: "suspected AI-generated" is not the same as "AI-generated".
## Privacy & Data
> **Important: Privacy & Data Flow Notice**
>
> - **Third-party service**: This skill sends your files to CamScanner's official servers (`ai-tools.camscanner.com`) for processing.
> - **Data retention**: CamScanner servers process your files in real-time. Files are not permanently stored on the server.
> - **Result**: Only a JSON detection result is returned — no file is downloaded.
## API Reference
**Base URL:** `https://ai-tools.camscanner.com`
### Supported Validations
| source_type | validate_mode | Detection | Engine |
| ----------- | ------------- | ----------------------- | --------------- |
| image | 2 | AIGC (AI-generated) | aigcdetection |
### Step 1: Upload Image
```bash
BASE="https://ai-tools.camscanner.com"
IN_FILE_ID=$(curl -sS -X POST "$BASE/v1/tools/upload_file/execute" \
-H "Content-Type: application/octet-stream" \
--data-binary "@/path/to/image.jpg" | jq -r '.tool_result.data.file_id')
```
**Response:**
```json
{
"code": 200,
"tool": "upload_file",
"tool_result": {
"success": true,
"data": {
"file_id": "file_1741857600_ab12cd34ef56.jpg",
"size": 24576
}
}
}
```
### Step 2: Validate Image (Detect AIGC)
```bash
curl -sS -X POST "$BASE/v1/tools/validate_image/execute" \
-H "Content-Type: application/json" \
-d "{\"file_id\":\"$IN_FILE_ID\",\"validate_mode\":2}"
```
**Response (suspected AI-generated example):**
```json
{
"code": 200,
"tool": "validate_image",
"tool_result": {
"success": true,
"data": {
"ai_check_result": 2,
"confidence": 0.346435546875,
"engine": "aigcdetection",
"file_id": "file_xxx.jpg",
"result_text": "检测结果为疑似 AI 生成图片",
"review_state": "auto_checked",
"validate_mode": 2
},
"metadata": {
"ai_check_result": 2,
"confidence": 0.346435546875,
"engine": "aigcdetection",
"result_text": "检测结果为疑似 AI 生成图片",
"review_state": "auto_checked",
"validate_mode": 2
}
}
}
```
## Interpreting the Result
| Field | Type | Meaning |
| ----------------- | ------- | ------------------------------------------------------------------------------ |
| `ai_check_result` | integer | `1` = not AI-generated, `2` = suspected AI-generated, `3` = AI-generated |
| `confidence` | float | Model confidence score in `[0, 1]` |
| `result_text` | string | Human-readable conclusion (Chinese by default — translate for other languages) |
| `review_state` | string | Review status (e.g. `auto_checked`) — informational, not user-facing |
| `validate_mode` | integer | Echo of the requested mode (always `2` for AIGC detection) |
### Verdict Mapping
| `ai_check_result` | Verdict | Suggested phrasing (EN) |
| ----------------- | ----------------------- | ------------------------------------ |
| 1 | Not AI-generated | "Looks like a real image" |
| 2 | Suspected AI-generated | "Suspected to be AI-generated" |
| 3 | AI-generated | "Detected as AI-generated" |
## Quick Reference: Complete Pipeline
Detect whether an image is AI-generated (two-step, reads JSON result):
```bash
BASE="https://ai-tools.camscanner.com"
INPUT_IMAGE="/path/to/image.jpg"
# Upload
IN_FILE_ID=$(curl -sS -X POST "$BASE/v1/tools/upload_file/execute" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$INPUT_IMAGE" | jq -r '.tool_result.data.file_id')
# Validate and extract key fields
RESULT=$(curl -sS -X POST "$BASE/v1/tools/validate_image/execute" \
-H "Content-Type: application/json" \
-d "{\"file_id\":\"$IN_FILE_ID\",\"validate_mode\":2}")
AI_CHECK=$(echo "$RESULT" | jq -r '.tool_result.data.ai_check_result')
CONFIDENCE=$(echo "$RESULT" | jq -r '.tool_result.data.confidence')
RESULT_TEXT=$(echo "$RESULT" | jq -r '.tool_result.data.result_text')
echo "ai_check_result: $AI_CHECK"
echo "confidence: $CONFIDENCE"
echo "result_text: $RESULT_TEXT"
```
## Common Mistakes
| Mistake | Fix |
| ------------------------------------------ | --------------------------------------------------------------------------- |
| Wrong Content-Type on upload | Upload uses `application/octet-stream`, not `multipart/form-data` |
| Using GET instead of POST | Both endpoints use POST |
| Passing `validate_mode` as a string | `validate_mode` is an integer — use `2`, not `"2"` |
| Including `output_mode` in the request | `validate_image` does not use `output_mode`; it always returns JSON |
| Treating `ai_check_result` as boolean | It is a 3-state integer (`1`/`2`/`3`); map explicitly to a verdict |
| Reporting "suspected" as "AI-generated" | `ai_check_result == 2` means *suspected*, not confirmed — phrase accordingly |
| Reporting `result_text` verbatim in EN | `result_text` is Chinese; translate to match the user's language |
## Error Handling
Check each step before proceeding:
```bash
# After upload
if [ -z "$IN_FILE_ID" ] || [ "$IN_FILE_ID" = "null" ]; then
echo "Upload failed"; exit 1
fi
# After validate
if [ "$AI_CHECK" = "null" ] || [ -z "$AI_CHECK" ]; then
echo "Validation failed"; exit 1
fi
```
don't have the plugin yet? install it then click "run inline in claude" again.
structured the original into six explicit sections (intent, inputs, procedure with I/O per step, decision points for all three verdicts plus language translation and edge cases, output contract, and outcome signal), added edge cases for network failures rate limiting and missing fields, clarified the language translation requirement, and removed em-dashes per voice guidelines.
use CamScanner's AIGC-detection engine to determine if an image was produced by an AI generator (Stable Diffusion, Midjourney, DALL·E, etc.). the skill classifies images as genuine, suspected AI-generated, or AI-generated with a confidence score. run this when the user asks whether a photo is AI-generated, wants to verify image authenticity against generative models, or shares an image asking "is this AI art / Midjourney / Stable Diffusion?". triggers on queries in English or Chinese including "detect AI-generated image", "is this AI art", "is this diffusion", "检测AI生成", "是不是AI画的", "AIGC检测", or when an image is shared with an authenticity question.
external connection: CamScanner AIGC API
https://ai-tools.camscanner.comrequired tools / binaries
curl (HTTP requests)jq (JSON parsing)required parameters
image_file_path: local path to the image file (jpg, png, or other common formats)optional context
validate image file exists and is readable
image_file_pathupload image to CamScanner
image_file_pathcurl -sS -X POST "https://ai-tools.camscanner.com/v1/tools/upload_file/execute" -H "Content-Type: application/octet-stream" --data-binary "@{image_file_path}"tool_result.data.file_id (string like file_1741857600_ab12cd34ef56.jpg)file_id for step 3validate image with AIGC detection
file_id from step 2curl -sS -X POST "https://ai-tools.camscanner.com/v1/tools/validate_image/execute" -H "Content-Type: application/json" -d "{\"file_id\":\"$file_id\",\"validate_mode\":2}"tool_result.data with fields:ai_check_result (integer: 1, 2, or 3)confidence (float in [0, 1])result_text (string in Chinese)map result to user-facing verdict
ai_check_result, confidence, result_text, user's languagereport result to user
if ai_check_result == 1: image is not AI-generated
if ai_check_result == 2: image is suspected to be AI-generated
if ai_check_result == 3: image is AI-generated
language translation
result_text as-is or rephrase for clarityresult_text from Chinese to that language before reportingedge case: network timeout or server error
edge case: empty or null result fields
ai_check_result is null or missing: report "validation did not return a result"confidence is null or missing: report verdict without confidence scoreresult_text is empty: report verdict based on ai_check_result mapping aloneedge case: unsupported image format
edge case: rate limiting
success data format (JSON)
{
"ai_check_result": 1,
"confidence": 0.95,
"result_text": "检测结果为真实图片",
"verdict": "not AI-generated",
"confidence_percent": 95
}
or in failure:
{
"error": true,
"message": "upload failed"
}
no file output: this skill returns only a JSON result object. it does not produce or download any file. the result is printed to stdout and reported to the user verbally.
data location: result lives in memory and is output to console; not persisted unless the calling context saves it.
the user knows the skill worked when they receive a clear, natural-language verdict stating:
example outcome: "detected as AI-generated with 92% confidence. this looks like it came from a generative model like Stable Diffusion or Midjourney."