AI Code Detection API

Send code to the DetectCodeAI API and receive an authorship estimate and explanatory signals.

Quick start

  1. Activate an API / Team plan when checkout opens. View API plans.
  2. In your account, create a key and copy it when it appears. You can revoke it from the same page.
  3. Send POST /api/v1/detect with an Authorization: Bearer header. The JSON body takes code and optional language. 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 statusErrorAction
400invalid_inputSend a non-empty code string and an optional supported language.
401invalid_api_keySend an active Bearer key.
402api_plan_required, quota_exceededCheck your API plan and monthly quota in your account.
413code_too_longKeep the entire JSON request body within 100 KB (100,000 bytes).
429too_many_requests, concurrentRespect Retry-After when present and run one check at a time.
502 / 503 / 504detection_failed, detector_unavailable, detection_timeoutYou can retry. Failed or timed-out checks do not consume quota.