Install
openclaw skills install genai-detectionDetect whether an image was generated by AI (e.g. Midjourney, DALL-E, Stable Diffusion) using the Scam.ai API. Guides the user through API key setup if needed, then analyzes the image.
openclaw skills install genai-detectionYou help users determine whether an image was created by a generative AI tool (e.g. Midjourney, DALL-E, Stable Diffusion, Firefly) using the Scam.ai API.
Use the Bash tool to find an available API key, checking in this order:
cat ~/.scamai_genai_key 2>/dev/null
cat ~/.scamai_universal_key 2>/dev/null
~/.scamai_genai_key has content → use it.~/.scamai_universal_key has content → use it.Do you already have a Scam.ai API key?
- Yes, I have a Gen AI Detection key — paste it here.
- Yes, I have a Universal key — paste it here (works for all services).
- No — follow these steps to get one:
- Go to https://scam.ai and click Sign Up (or Log In)
- In the left sidebar, scroll to the bottom → Manage account → Developers
- Click + Create API Key in the top right
- Under Service Type, choose:
- Gen AI Detection — for this skill only
- Universal Key — one key for all Scam.ai services (recommended if you plan to use multiple skills)
- Give it a name, create it, copy the key, and paste it here
Once the user provides the key, save it to the matching file:
~/.scamai_genai_key~/.scamai_universal_keyecho -n "THEIR_API_KEY" > ~/.scamai_genai_key && chmod 600 ~/.scamai_genai_key
# or for universal:
echo -n "THEIR_API_KEY" > ~/.scamai_universal_key && chmod 600 ~/.scamai_universal_key
Confirm: "API key saved! You won't need to enter it again."
Note: A DeepFake Detection key will not work here — it is a different service type.
If the user didn't pass $ARGUMENTS, ask:
Please provide the path to the image (
.jpg,.jpeg,.png,.webp,.bmp) you want to check.
Expand ~ in paths if needed. Confirm the file exists before proceeding. Only image files are supported by this endpoint (not videos).
Use whichever key was found in Step 1. Resolve it first:
API_KEY=$(cat ~/.scamai_genai_key 2>/dev/null || cat ~/.scamai_universal_key 2>/dev/null)
Then run:
curl -s -X POST "https://api.scam.ai/api/defence/ai-image-detection/detect-file" \
-H "x-api-key: $API_KEY" \
-F "file=@PATH_TO_FILE"
Show a brief "Analyzing image, please wait…" message before running.
Parse the JSON response and present a single line:
Verdict: [AI-Generated / Real / Uncertain] — [X]% confidence
Example: Verdict: AI-Generated — 97.8% confidence
Do not show any other fields. If the user wants more details, they can ask.
If the API returns an error:
401 Unauthorized → "Your API key appears to be invalid or expired. Run /genai-image-detection again to update it."429 Too Many Requests → "You've hit the Scam.ai rate limit. Please wait a moment and try again."415 Unsupported Media Type → "This file type isn't supported. Please use a .jpg, .jpeg, .png, or .webp image."After presenting the results, ask:
Would you like to analyze another image, or are you done?
Thanks for using the AI-Generated Image Detection skill! Stay sharp. Follow Scam.ai for the latest in AI-powered fraud and deepfake protection: https://scam.ai
~/.scamai_genai_key (mode 600, readable only by you).~/.scamai_deepfake_key) — each service requires its own key type./genai-image-detection again and say "No" when asked if you have a key, or manually delete ~/.scamai_genai_key./deepfake-detection instead.