DocumentationGateway v1.0Public API

ban.wtf APIs Reference

Complete developer reference for integrating Image and Text moderation router endpoints into Discord bots, backend web applications, and LLM agent pipelines.

Machine-Readable & Agent Documentation

Standardized, structured endpoints ready to load into Cursor, Claude, custom LLM agents, and OpenAPI client generators.

OpenAPI 3.1 & llms.txt standard
OpenAPI 3.1.0JSON

Full machine-readable specification for Swagger, Postman, Cursor, and SDK generators.

llms.txtStandard

Concise markdown index conforming to the /llms.txt standard for rapid LLM ingestion.

llms-full.txtFull Context

Complete, un-truncated API documentation and code examples in a single prompt-ready file.

1

Authentication

All requests to the ban.wtf API router require an active secret key prefixed with bw_live_. You can generate keys in your API Keys Manager.

# Standard Bearer Authorization Header:
Authorization: Bearer bw_live_e93847291a0c8b...
# Or custom API key header:
x-api-key: bw_live_e93847291a0c8b...
2

Charge-and-Use Credit System

There are no monthly commitments or subscriptions. Your account balance is deducted on a strict per-request basis upon successful moderation.

Image Moderation1 Credits

Evaluates explicit adult nudity, drawn/manga nudity, and calculates estimated face age & minor flag.

Text Moderation0.5 Credits / message

Stateless high-performance Discord message moderation using hybrid AI guardrails. Detects phishing/scams, zero-day raids, toxicity, and action candidate probabilities.

Credits can be purchased at any time in the Billing Section through verified SumUp payments.

3

Image Moderation API

Discern explicit nudity, anime/drawn nudity, and estimate a person's age using TensorFlow.js NSFWJS and Face-API models. Cost: 1 credits per image.

POSThttps://apis.ban.wtf/api/v1/moderate/image
FieldTypeFormatDescription
image_urlstringJSON BodyPublic HTTP/HTTPS URL of the image to download and classify.
imagebinarymultipart/form-dataDirect image file upload (JPEG, PNG, WebP).
image_base64stringJSON BodyBase64-encoded image string or data URI.
curl -X POST "https://apis.ban.wtf/api/v1/moderate/image" \
  -H "Authorization: Bearer bw_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://images.unsplash.com/photo-1534528741775-53994a69daeb"
  }'
Sample Response (HTTP 200 OK)
{ "status": "success", "request_id": "req_img_1726918293", "credits_deducted": 5.0, "remaining_credits": 140.0, "data": { "is_flagged": false, "summary": "Image passed safety filters.", "categories": { "nudity": { "score": 0.0051, "flagged": false, "labels": ["safe_neutral"] }, "drawn_nudity": { "score": 0.0019, "flagged": false, "labels": ["none"] }, "age_estimation": { "estimated_age": 34, "age_range": "29 to 39", "is_minor": false, "confidence": 0.75, "face_detected": true } }, "classifications": [ { "className": "Neutral", "probability": 0.9844 }, { "className": "Drawing", "probability": 0.0086 }, { "className": "Porn", "probability": 0.0040 }, { "className": "Hentai", "probability": 0.0019 }, { "className": "Sexy", "probability": 0.0011 } ], "meta": { "source": "photo.jpg", "latency_ms": 112, "processed_at": "2026-09-21T15:00:00.000Z", "model_backend": "tensorflow_nsfwjs_age_v1" } } }
4

Text Moderation API

Evaluates a single message context against configured safety policies, zero-day raid filters, phishing/scam heuristics, and AI instructions. Cost: 0.5 credits.

POSThttps://apis.ban.wtf/api/v1/moderate/text
FieldTypeRequiredDefaultDescription
contentstringYesThe message text to analyze.
authorstringNo"user#0001"Author username, discriminator, or Discord snowflake ID.
channelstringNo"#general"Channel name or Discord channel snowflake ID.
account_age_daysintegerNo30Age of author's Discord account in days (for zero-day raid detection).
mentions_countintegerNo0Count of mentions in message (for mass-ping raid detection).
modestringNo"hybrid"Pipeline: "hybrid" (AI + Guardrails) or "native".
curl -X POST "https://apis.ban.wtf/api/v1/moderate/text" \
  -H "Authorization: Bearer bw_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "FREE NITRO: Claim your Discord Nitro gift at https://discrod-nitro-gift.ru/claim @everyone",
    "author": "spambot#1337",
    "channel": "#general",
    "account_age_days": 1,
    "mentions_count": 1,
    "mode": "hybrid"
  }'
Sample Response (HTTP 200 OK)
{ "id": "mod_7f2b90d1ec4a3901", "action": "ban", "threat_score": 2.4512, "is_phishing_or_scam": 0.9821, "requires_mod_review": 0.9145, "action_probabilities": { "ban": 0.9612, "timeout": 0.0245, "warn": 0.0101, "none": 0.0042 }, "routing_model": "diffusion_router", "latency_ms": 14.82, "mode": "hybrid", "credits_deducted": 1.0, "remaining_credits": 149.0 }
5

Batch Moderation API

Evaluates up to 50 messages concurrently in a single HTTP request. Cost: 0.5 credits per message evaluated.

POSThttps://apis.ban.wtf/api/v1/moderate/text/batch
curl -X POST "https://apis.ban.wtf/api/v1/moderate/text/batch" \ -H "Authorization: Bearer bw_live_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "content": "Good morning everybody! Hope everyone has a nice weekend.", "author": "friendly_coder#0001" }, { "content": "FREE DISCORD NITRO: Claim immediately at https://discrod-gifts.ru/claim", "author": "pixel_scam#9999" } ], "mode": "hybrid" }'
Sample Batch Response (HTTP 200 OK)
{ "batch_size": 2, "total_latency_ms": 38.45, "results": [ { "content": "Good morning everybody! Hope everyone has a nice weekend.", "action": "none", "threat_score": 0.0812, "is_phishing_or_scam": 0.0120, "requires_mod_review": 0.0054, "action_probabilities": { "ban": 0.0011, "timeout": 0.0022, "warn": 0.0085, "none": 0.9882 } }, { "content": "FREE DISCORD NITRO: Claim immediately at https://discrod-gifts.ru/claim", "action": "ban", "threat_score": 2.6105, "is_phishing_or_scam": 0.9789, "requires_mod_review": 0.9412, "action_probabilities": { "ban": 0.9810, "timeout": 0.0125, "warn": 0.0041, "none": 0.0024 } } ], "credits_deducted": 2.0, "remaining_credits": 147.0 }
6

Custom Decision Inference & Judges API

Runs general-purpose decision inference on arbitrary input contexts using custom questions, instructions, or criteria. Unlike moderation-specific endpoints, callers can define any custom questions in shorthand array, typed schema, or freeform prompt. Cost: 0.5 credits.

POSThttps://apis.ban.wtf/v1/inference(aliased as /v1/custom & /api/inference)
curl -X POST "https://apis.ban.wtf/v1/inference" \
  -H "Authorization: Bearer bw_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "state": {
      "customer_id": "corp_9981",
      "ticket_subject": "Production database latency spike in us-east-1",
      "error_code": "504 Gateway Timeout"
    },
    "instructions": {
      "department": {
        "type": "choice",
        "instructions": "Select engineering department responsible for resolution.",
        "criteria": {
          "database_sre": "PostgreSQL database latency, clustering, failover",
          "billing_finance": "Invoices, credit card charges, refunds",
          "sales_expansion": "New contract negotiation, upsell"
        }
      },
      "urgency": {
        "type": "score",
        "instructions": "Assess business urgency.",
        "criteria": ["routine", "minor", "major", "critical"]
      },
      "requires_pager": {
        "type": "noul",
        "instructions": "Requires immediate on-call pager?",
        "criteria": { "true": "Critical outage", "false": "Normal queue" }
      }
    }
  }'
Custom Decision Makers ("Judges") & Fine-Tuning Checkpoints

In addition to ad-hoc inference, you can create persistent decision makers called Judges in your dashboard. When creating a Judge, enable storeContent: true to automatically record all incoming API requests and model responses.

  • Call your Judge directly via POST /v1/judges/{judge_id}/inference or by passing "judge_id": "..." in POST /v1/inference.
  • In the dashboard, view your dataset and re-classify model predictions to set ground-truth training data.
  • Submit a Checkpoint of all data up until that point for 5,000 credits to fine-tune custom model weights.

HTTP Status Codes & Errors

200 OKThe request was successfully authenticated, executed, and credits were deducted.
401 UnauthorizedMissing or invalid secret key. Ensure the header contains a valid active key prefixed with bw_live_.
402 Payment RequiredYour account credit balance is insufficient for this request. Top up via billing to continue.
422 UnprocessableMissing required fields (such as empty 'content') or invalid batch structure.
500 Server ErrorUpstream or gateway processing failure. Credits are never deducted on 500 responses.