Developer documentation

AI Detector API and MCP documentation

Send JSON to the detector, humanizer, and plagiarism REST APIs, or connect the remote MCP server to a compatible assistant. The examples below use the production hostname and current contract.

Start here

Quickstart

In the API dashboard, prepare a key, copy it into a secure store, confirm that it is saved, and activate it. Then send JSON over HTTPS. This example uses Detector v3.

BASE URLhttps://api.detecting-ai.com
cURL quickstart
curl --request POST \
  --url https://api.detecting-ai.com/api/detect/ \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: detector-review-001" \
  --header "X-API-Key: YOUR_API_KEY" \
  --data '{
    "text": "Paste the text you want to analyze.",
    "version": "v3"
  }'

Keep private keys private. Store the key in a server-side environment variable or secret manager. Do not put it in a browser bundle, mobile binary, public repository, screenshot, or shared document. The full value is shown only before activation and cannot be recovered after you leave or reload. Preparing a replacement does not interrupt the active key. It changes only when you activate the saved value.

Access

Authentication

REST requests and local MCP clients use customer API keys in different headers. Hosted MCP connectors discover OAuth and open a browser authorization flow.

InterfaceAuthenticationExample
REST APIX-API-KeyX-API-Key: YOUR_API_KEY
Hosted MCP connectorOAuth 2.0 with PKCEAdd only the MCP URL, then sign in and approve access
Local MCP clientAuthorizationBearer YOUR_API_KEY

Usage safety

Retry one request without paying twice

New integrations should send a unique Idempotency-Key for every logical REST request and keep that value until the request succeeds or you abandon it. If a connection drops, retry the exact same endpoint, text, version or model, and key. An exact replay returns the stored response without running the provider or deducting the words again.

HeaderStatusContract
Idempotency-KeyStrongly recommended8–128 URL-safe characters. Generate a random value per logical operation and persist it across retries.
X-Idempotency-KeyResponseEchoes the accepted client or compatibility key on successful responses and metering failures.
X-Idempotency-Key-SourceCompatibility responseSet to server-generated only when a legacy request omitted Idempotency-Key.

Never reuse a key with changed text, endpoint, detector version, or humanizer model. The API binds those fields to the first use and returns HTTP 409 on a mismatch. Existing clients that omit the header receive a random key in X-Idempotency-Key and X-Idempotency-Key-Source: server-generated. If the entire response is lost, that generated key cannot be recovered, so the request cannot be retried safely. New clients should always create and persist their own key before sending.

While the first caller still owns the provider lease, an exact concurrent retry returns HTTP 409 with Retry-After. After completion, the exact response remains replayable for 24 hours. Once that private body expires, the same key returns HTTP 410. Its permanent tombstone still prevents a second charge.

REST endpoint

AI Detector API

Analyze supplied text for patterns associated with AI writing. Results are probabilistic review signals, not proof of authorship.

POST/api/detect/

Request body

FieldTypeRequiredDescription
textstringYesText to analyze.
versionstringYesv1, v2, or v3. Use v3 for a new integration.
Detector request
curl --request POST \
  --url https://api.detecting-ai.com/api/detect/ \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: detector-review-001" \
  --header "X-API-Key: YOUR_API_KEY" \
  --data '{
    "text": "Paste the text you want to analyze.",
    "version": "v3"
  }'

Response

Detector v3 response
{
  "success": true,
  "data": {
    "details": {
      "chunks": [
        {
          "text": "A sentence from the input.",
          "startChar": 0,
          "endChar": 26,
          "type": "AI",
          "score": 0.87
        }
      ],
      "ai_percentage": 42.5
    },
    "version": "v3",
    "words_processed": 120
  }
}

Read the score correctly. In the public Detector v3 compatibility contract, chunks are sentence-level and labeled AI or Human. Each chunk score is the provider confidence from 0 to 1. Values above 0.5 receive the AI label. The overall ai_percentage is the percentage of input characters covered by AI-labeled sentences, not the average of chunk scores. This differs from the newer website detector methodology, so do not multiply or average fields interchangeably.

Read the AI Detector API overview

Both MCP tools require an idempotency_key argument of 16–128 URL-safe characters. Generate it per intentional tool operation and reuse it only for an exact retry. The JSON-RPC request ID is not used as the billing operation key.

REST endpoint

AI Humanizer API

Rewrite supplied text with a selected humanizer model. The output is editable and should be reviewed for meaning, facts, names, links, tone, and required terminology.

POST/api/humanize/

Request body

FieldTypeRequiredDescription
textstringYesText to rewrite.
modelstringYescognia, lexi, cognia_v2, or huma_v2.
Humanizer request
curl --request POST \
  --url https://api.detecting-ai.com/api/humanize/ \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: humanizer-review-001" \
  --header "X-API-Key: YOUR_API_KEY" \
  --data '{
    "text": "Paste the text you want to rewrite.",
    "model": "cognia"
  }'

Response

Humanizer response
{
  "humanized_text": "The rewritten text is returned here.",
  "words_processed": 120,
  "model_used": "cognia"
}

Read the AI Humanizer API overview

REST endpoint

Plagiarism Checker API

Search for sentence-level overlap and return source context when a match is found. A match needs human review because quotation, citation, permission, and standard phrasing affect what it means.

POST/api/plagiarism/

Request body

FieldTypeRequiredDescription
textstringYesText to check for sentence-level source overlap.
Plagiarism request
curl --request POST \
  --url https://api.detecting-ai.com/api/plagiarism/ \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: plagiarism-review-001" \
  --header "X-API-Key: YOUR_API_KEY" \
  --data '{
    "text": "Paste the text you want to check."
  }'

Response

Plagiarism response
{
  "result": {
    "results": [
      {
        "sentence": "A sentence from the input.",
        "is_plagiarised": true,
        "web_sentence": "A similar source sentence.",
        "similarity": 91.0,
        "link": "https://example.com/source"
      }
    ],
    "plagiarism_score": 34.2
  },
  "words_processed": 120
}

The score is not exhaustive. plagiarism_score is the share of input characters inside flagged sentences. The checker searches candidate web pages and returns the first qualifying fuzzy match for a sentence. It does not prove the text has never appeared elsewhere.

Read the Plagiarism Checker API overview

Streamable HTTP

Remote MCP server

One remote server exposes exactly two tools: detect_ai_text and humanize_text. Plagiarism checking is available through REST, not MCP.

MCPhttps://api.detecting-ai.com/api/mcp
ToolPurposeDefault
detect_ai_textAnalyze text for AI writing signals and sentence-level detail.version: v3
humanize_textRewrite supplied text and return an editable result.model: cognia

Hosted connectors

Add only the MCP URL in a hosted connector. The client discovers OAuth, opens sign-in and consent in the browser, and stores its own tokens. Do not append an API key or other credential to the URL.

Codex

Codex configuration
export DETECTING_AI_API_KEY="YOUR_API_KEY"

[mcp_servers.detecting_ai]
url = "https://api.detecting-ai.com/api/mcp"
bearer_token_env_var = "DETECTING_AI_API_KEY"
tool_timeout_sec = 300

Claude Code

Claude Code command
claude mcp add --transport http --scope user \
  --header "Authorization: Bearer YOUR_API_KEY" \
  detecting-ai https://api.detecting-ai.com/api/mcp

Failure handling

Errors

Check both the HTTP status and response body. Error payloads are not yet normalized into one universal schema.

StatusMeaningWhat to check
400Invalid request or insufficient word balanceRequired fields, supported version or model, and available words
401Authentication missing or invalidREST X-API-Key header or MCP bearer token
403No active subscription for the featurePlan status and access to the requested product
409Operation already in progress, or key reused for different workHonor Retry-After for an exact in-flight retry. For changed text, endpoint, version, or model, generate a new key.
410The completed operation is older than the 24-hour private replay windowDo not resubmit it as the same logical operation. The tombstone remains charged and prevents duplicate execution.
429Temporary request limit reachedHonor Retry-After and reduce request concurrency
502The selected analysis provider failed safelyRetry later. No successful result was returned or charged.
503Subscription verification or usage recording is unavailableRetry the exact request with the same Idempotency-Key. The service withholds provider output when finalization is uncertain.

Existing quota error compatibility remains top-level. No active subscription returns HTTP 403 with error_code: "1002". Insufficient words returns HTTP 400 with the legacy error field plus structured balance fields.

Quotas and boundaries

Usage and limits

Usage is charged from the whitespace-separated input word count. Detector, humanizer, and plagiarism balances are feature-specific, including when the same key accesses more than one product.

  • Check remaining words and active plans in the API dashboard.
  • MCP uses the same detector or humanizer balance as the matching REST API.
  • REST and MCP have a default 160,000-character text limit. MCP also has a 1 MiB transport body limit. Split unusually large documents into meaningful sections.

Ready to integrate

Make the first request from a trusted server

Create a key, choose the endpoint that matches the job, and test both successful and unsuccessful responses before adding UI.