{"uid":"cap_jJo6-kgJOv-X7XjPbgeGv","slug":"sitecheck-code-explainer-5e2ab30a","name":"SiteCheck Code Explainer","description":"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.","url":"https://api.sitecheck-api.workers.dev/api/code/explain?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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)"}}},"responseSchema":{"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"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_PiUDoXNxGGT4TWnVRVFqx","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Analyzes a source code snippet to produce a plain-English explanation, summary, detected functions, line count, and potential bugs with severity ratings.","exampleAgentPrompt":"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`","exampleUseCases":[{"title":"Debug a suspicious function","prompt":"I think there's a bug in this JavaScript function — can you analyze it and tell me what it actually does versus what it seems intended to do? Here's the snippet: `function multiply(x, y) { return x + y; }`"},{"title":"Onboard a new developer to legacy code","prompt":"Can you walk me through this legacy Python function step by step so I can understand what it does before I modify it? Here's the code: `def process(data): return [x*2 for x in data if x > 0]`"},{"title":"Code review automation for a PR","prompt":"Review this SQL snippet for any logic issues or potential problems and give me a severity-rated list of what you find: `SELECT * FROM orders WHERE status = 'active' OR 1=1;`"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-03T18:37:16.982Z","isFirstParty":false,"canonicalSlug":"sitecheck-code-explainer-5e2ab30a"}