{
  "name": "Is it AI? API",
  "description": "Writing-style analysis of IETF Internet-Drafts. Four LLMs plus deterministic text statistics rate how far a draft's prose sits from typical IETF style. It measures style, not authorship: a high score means unusual prose, it does not prove a draft was AI-written.",
  "docs": "https://ietf.jaime.win/is-it-ai",
  "cors": "open (Access-Control-Allow-Origin: *)",
  "auth": "none",
  "limits": {
    "rate": "50 scans per IP per day (POST /is-it-ai/api/analyze only)",
    "budget": "$20 lifetime cost cap on new analyses; cached reads are always free"
  },
  "fields": {
    "ai_pct": "0-100. Style-deviation percent, not a probability of AI authorship. Higher = further from typical IETF prose.",
    "human_pct": "100 - ai_pct.",
    "signal": "clear | review | flagged. Consensus verdict. UI relabels these low | mixed | high.",
    "signal_votes": "Per-signal model count, e.g. {clear:3, review:1}.",
    "agreement": "unanimous | strong | split. How much the models agreed.",
    "scores": "Mean per-dimension score, each 0 (typical) to 10 (atypical): uniformity, hedging, specificity, depth, originality.",
    "votes": "Per-model results: model_key, model, signal, ai_pct, scores{}, summary, evidence[], excluded.",
    "stats": "Deterministic text metrics (avgWordLength, hedgingDensity, guiraudIndex, zipfAlpha, ...). Only hedgingDensity and avgWordLength track the score meaningfully.",
    "other": "draft, revision, date, analyzed (ISO), sections, references, sentences, model, n_models, evidence[], summary."
  },
  "endpoints": [
    {
      "method": "GET",
      "path": "/is-it-ai/api/result/{draft}",
      "description": "Cached analysis for a draft. {draft} is the base name without revision, e.g. draft-jimenez-t2trg-iot-agent. 404 if not yet scanned.",
      "example": "https://ietf.jaime.win/is-it-ai/api/result/draft-jimenez-t2trg-iot-agent",
      "returns": {
        "draft": "string",
        "signal": "clear|review|flagged",
        "ai_pct": "0-100",
        "scores": "{5 dims 0-10}",
        "votes": "[per-model]",
        "stats": "{text metrics}",
        "...": "see fields"
      }
    },
    {
      "method": "POST",
      "path": "/is-it-ai/api/analyze",
      "description": "Analyze a draft or RFC by URL. Returns the cached result if already scanned, else runs the ensemble (rate-limited, counts against budget). Same response shape as /result. Errors: 400 bad/missing URL or JSON, 429 rate limit or budget exhausted, 502 fetch failed, all as {error:string}.",
      "body": {
        "draft_url": "https://datatracker.ietf.org/doc/draft-jimenez-t2trg-iot-agent/"
      }
    },
    {
      "method": "GET",
      "path": "/is-it-ai/api/stats",
      "description": "Corpus totals.",
      "example": "https://ietf.jaime.win/is-it-ai/api/stats",
      "returns": {
        "drafts": "int, total analyzed",
        "cost_usd": "string, running compute cost"
      }
    }
  ]
}