# StableDetect API Reference ## Authentication All endpoints require micropayment. Include payment headers as per the HTTP 402 specification. Payments are processed on Base mainnet (eip155:8453), Solana, or Tempo. ## Base URL https://stabledetect.dev All endpoints are relative to this base URL. ## Agent Workflow (Progressive) 1. Discover candidate endpoints with `mcp__agentcash__discover_api_endpoints("https://stabledetect.dev")`. 2. For selected POST endpoints, call `mcp__agentcash__check_endpoint_schema` before first fetch. 3. Execute with `mcp__agentcash__fetch`. --- # AI Content Detection Detect whether text, images, or video are AI-generated. Text detection is powered by [Pangram](https://www.pangram.com); image and video deepfake detection by [BitMind](https://bitmind.ai). ## POST /api/detect/text Classify a text passage as AI-generated, AI-assisted, human-written, or mixed. Returns document-level fractions plus per-window segment labels with character offsets, so you can pinpoint exactly which parts are AI. Price: $0.10 per started 1,000 words (a 3,500-word document costs $0.40). Call `mcp__agentcash__check_endpoint_schema` with your intended body for an exact quote. Body: - `text` (string, required) — the passage to analyze. Minimum 50 words, maximum 50,000 words. Under 50 words returns HTTP 400 before any charge. - `publicDashboardLink` (boolean, optional, default false) — include a shareable pangram.com dashboard link for the analysis in the response. Response (key fields): ```json { "headline": "AI Detected", "prediction_short": "AI", "fraction_ai": 0.7, "fraction_ai_assisted": 0.2, "fraction_human": 0.1, "windows": [ { "label": "AI-Generated", "ai_assistance_score": 0.85, "confidence": "High", "start_index": 0, "end_index": 812 } ] } ``` `prediction_short` is one of `AI`, `AI-Assisted`, `Human`, `Mixed`. Fractions sum to ~1.0. Each window covers a slice of the input (`start_index`/`end_index` are character offsets). ## POST /api/detect/image Detect whether an image is AI-generated or a deepfake. Price: $0.02 per request Body: - `image` (string, required) — public http(s) URL or a data URL (`data:image/png;base64,...`). JPEG, PNG, GIF, BMP, WebP, AVIF. Response: ```json { "isAI": true, "confidence": 0.87 } ``` `confidence` is 0-1; treat >= 0.7 as a strong signal either way. ## POST /api/detect/video Detect whether a video is AI-generated or a deepfake. Accepts direct video URLs plus YouTube, Twitter/X, and TikTok links. Price: $0.10 per request Body: - `video` (string, required) — video URL. - `startTime` / `endTime` (numbers, optional, seconds) — analyze only a segment. Recommended for videos over ~2 minutes. - `fps` (integer, optional) — frames per second to sample. Response: ```json { "isAI": true, "confidence": 0.87 } ``` ### Composition tips - Verifying a social-media post: run /api/detect/text on the caption and /api/detect/image (or /video) on the media in parallel. - Long articles: send the full text in one call — pricing scales per 1,000 words and windows tell you which sections are AI. - Low-confidence results (0.4-0.6) are genuinely uncertain; report them as inconclusive rather than forcing a verdict. --- # Pricing Summary | Endpoint | Price | |----------|-------| | Text detection | $0.10 per started 1,000 words | | Image detection | $0.02 | | Video detection | $0.10 |