# SiteCheck Code Explainer

> SiteCheck Code Explainer is a paid API for AI agents from api.sitecheck-api.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-03).

Analyzes a source code snippet to produce a plain-English explanation, summary, detected functions, line count, and potential bugs with severity ratings.

## Facts

- Endpoint: POST https://api.sitecheck-api.workers.dev/api/code/explain?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/sitecheck-code-explainer-5e2ab30a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jJo6-kgJOv-X7XjPbgeGv

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability sitecheck-code-explainer-5e2ab30a -d '<json body>'
```

Example prompt: Can you explain what this Python function does and flag any bugs in it? Here's the code: `def add(a, b): return a - b`

## When to prefer this

Choose this endpoint when you need a fast, pay-per-call AI-powered explanation of a code snippet without setting up a full code review pipeline. It is ideal for one-off code comprehension tasks, quick bug triage, or automated PR review where you want structured output (functions, issues, steps) rather than freeform prose. Prefer it over generic LLM chat for code when you need a consistent JSON schema with severity-rated issues and function maps.

## Known failure modes

- Code snippet exceeds 20,000 character limit — request rejected
- Ambiguous or unparseable code may produce inaccurate explanations
- Language misidentified if optional language field is omitted for obscure languages
- LLM-based analysis may miss subtle runtime bugs that require execution context
- Network or worker timeout for very large snippets near the character limit

## How this service works

Explains a code snippet (max 20,000 characters): detected language, a summary, a step-by-step explanation, the functions and classes it defines, and possible bugs and security issues with line numbers. Line numbers outside the snippet are dropped. Model-written: a finding is a lead to check, not a verified defect.

## Output

Returns a JSON object containing: a plain-language summary of the code, an ordered list of steps explaining what the code does line by line, a list of detected functions with their line numbers, a list of issues each with a line number, severity (e.g. high/medium/low), and description, the total line count, the detected or provided programming language, and a timestamp. Issues are flagged as potential leads, not verified defects.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "code": {
   "type": "string",
   "description": "Source code snippet (max 20,000 characters)"
  },
  "language": {
   "type": "string",
   "description": "Language if you know it (optional; otherwise detected)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "note": "Issues are leads from a model, not verified defects. Line numbers outside the snippet were dropped.",
  "lines": 3,
  "steps": [
   "The function add is defined with two parameters a and b.",
   "The function returns the result of subtracting b from a."
  ],
  "issues": [
   {
    "line": 2,
    "severity": "high",
    "description": "The function named add is actually subtracting the numbers instead of adding them."
   }
  ],
  "summary": "The given code defines a function named add that takes two parameters and returns their difference.",
  "language": "Python",
  "checkedAt": "2026-10-15T18:21:10.372Z",
  "functions": [
   {
    "line": 1,
    "name": "add"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sitecheck-code-explainer-5e2ab30a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.sitecheck-api.workers.dev](https://www.zero.xyz/host/api.sitecheck-api.workers.dev/llms.txt)
