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.
https://api.detecting-ai.comcurl --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.
| Interface | Authentication | Example |
|---|---|---|
| REST API | X-API-Key | X-API-Key: YOUR_API_KEY |
| Hosted MCP connector | OAuth 2.0 with PKCE | Add only the MCP URL, then sign in and approve access |
| Local MCP client | Authorization | Bearer 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.
| Header | Status | Contract |
|---|---|---|
Idempotency-Key | Strongly recommended | 8–128 URL-safe characters. Generate a random value per logical operation and persist it across retries. |
X-Idempotency-Key | Response | Echoes the accepted client or compatibility key on successful responses and metering failures. |
X-Idempotency-Key-Source | Compatibility response | Set 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.
/api/detect/Request body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to analyze. |
version | string | Yes | v1, v2, or v3. Use v3 for a new integration. |
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
{
"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.
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.
/api/humanize/Request body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to rewrite. |
model | string | Yes | cognia, lexi, cognia_v2, or huma_v2. |
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
{
"humanized_text": "The rewritten text is returned here.",
"words_processed": 120,
"model_used": "cognia"
}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.
/api/plagiarism/Request body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to check for sentence-level source overlap. |
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
{
"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.
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.
https://api.detecting-ai.com/api/mcp| Tool | Purpose | Default |
|---|---|---|
detect_ai_text | Analyze text for AI writing signals and sentence-level detail. | version: v3 |
humanize_text | Rewrite 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
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 = 300Claude Code
claude mcp add --transport http --scope user \
--header "Authorization: Bearer YOUR_API_KEY" \
detecting-ai https://api.detecting-ai.com/api/mcpFailure handling
Errors
Check both the HTTP status and response body. Error payloads are not yet normalized into one universal schema.
| Status | Meaning | What to check |
|---|---|---|
400 | Invalid request or insufficient word balance | Required fields, supported version or model, and available words |
401 | Authentication missing or invalid | REST X-API-Key header or MCP bearer token |
403 | No active subscription for the feature | Plan status and access to the requested product |
409 | Operation already in progress, or key reused for different work | Honor Retry-After for an exact in-flight retry. For changed text, endpoint, version, or model, generate a new key. |
410 | The completed operation is older than the 24-hour private replay window | Do not resubmit it as the same logical operation. The tombstone remains charged and prevents duplicate execution. |
429 | Temporary request limit reached | Honor Retry-After and reduce request concurrency |
502 | The selected analysis provider failed safely | Retry later. No successful result was returned or charged. |
503 | Subscription verification or usage recording is unavailable | Retry 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.