AI Code Detection API
Send code to the DetectCodeAI API and receive an authorship estimate and explanatory signals.
Quick start
- Activate an API / Team plan when checkout opens. View API plans.
- In your account, create a key and copy it when it appears. You can revoke it from the same page.
- Send
POST /api/v1/detectwith anAuthorization: Bearerheader. The JSON body takescodeand optionallanguage. Leave it out for automatic language detection.
The default rate limit is 10 requests per minute per key. Each account can run one detection at a time. Repeating identical code returns the saved result while it exists.
curl https://detectcodeai.com/api/v1/detect \
-H "Authorization: Bearer ${DETECTCODEAI_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{"code":"def greet(name):\n return name.strip()","language":"python"}'Example response
{
"code": 0,
"message": "ok",
"data": {
"id": "e20a6a6f-53e7-4d42-9519-3d55065241bc",
"verdict": "likely_human",
"confidence": 72,
"confidence_band": "medium",
"signals": [
{
"signal": "Task-specific structure",
"explanation": "The loop is tailored to the booking schedule."
}
],
"language": "python",
"route": "flash+sol",
"partial": false
}
}If a signal cites a verified excerpt, its optional excerpt.start and excerpt.end locate it in the submitted string using zero-based UTF-16 offsets. The end offset is exclusive.
This result is a probability estimate, not proof. Never use it as the sole basis for academic or employment decisions. Detection is probabilistic — always review the signals yourself before acting.
Errors
| HTTP status | Error | Action |
|---|---|---|
| 400 | invalid_input | Send a non-empty code string and an optional supported language. |
| 401 | invalid_api_key | Send an active Bearer key. |
| 402 | api_plan_required, quota_exceeded | Check your API plan and monthly quota in your account. |
| 413 | code_too_long | Keep the entire JSON request body within 100 KB (100,000 bytes). |
| 429 | too_many_requests, concurrent | Respect Retry-After when present and run one check at a time. |
| 502 / 503 / 504 | detection_failed, detector_unavailable, detection_timeout | You can retry. Failed or timed-out checks do not consume quota. |