Skip to main content
POST
/
v1
/
analysis
/
dead-code
cURL
curl -X POST 'https://api.supermodeltools.com/v1/analysis/dead-code' \
  -H 'Idempotency-Key: <idempotency-key>' \
  -H 'X-Api-Key: <api-key>' \
  -F 'file=@/path/to/your/repo-snapshot.zip;type=application/zip'
{
  "status": "completed",
  "jobId": "abc-123-def",
  "result": {
    "metadata": {
      "totalDeclarations": 162,
      "deadCodeCandidates": 102,
      "aliveCode": 60,
      "analysisMethod": "parse_graph + call_graph",
      "analysisStartTime": "2025-02-05T15:42:05Z",
      "analysisEndTime": "2025-02-05T15:42:10Z"
    },
    "deadCodeCandidates": [
      {
        "file": "src/utils/idGenerator.ts",
        "name": "generateSequentialId",
        "line": 8,
        "type": "function",
        "confidence": "high",
        "reason": "No callers found in codebase"
      }
    ],
    "aliveCode": [
      {
        "file": "src/index.ts",
        "name": "main",
        "line": 10,
        "type": "function",
        "callerCount": 3
      }
    ],
    "entryPoints": [
      {
        "file": "src/index.ts",
        "name": "main",
        "line": 10,
        "type": "function",
        "reason": "Module export"
      }
    ]
  }
}

Authorizations

X-Api-Key
string
header
required

API key issued by the control plane for accessing data plane resources.

Headers

Idempotency-Key
string
required

Unique identifier for this request for idempotency and tracing.

Body

multipart/form-data
file
file
required

Zipped repository archive containing the code to analyze.

Response

Dead code analysis (job completed)

Async response envelope for dead code analysis operations.

status
enum<string>
required

Current status of the job.

Available options:
pending,
processing,
completed,
failed
jobId
string
required

Unique identifier for the job.

retryAfter
integer<int32>

Recommended seconds to wait before polling again.

error
string

Error message (present when status is failed).

result
object

The result (present when status is completed).