# Code Explainer: Summary, Steps, I/O, Risks & Complexity

> Code Explainer: Summary, Steps, I/O, Risks & Complexity is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.006/call, status unknown (last checked 2026-10-02).

Analyzes a code snippet and returns a plain-English explanation covering its summary, step-by-step logic, inputs/outputs, visible risks, and complexity assessment.

## Facts

- Endpoint: POST https://twin.unykorn.org/ai/code-explain?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code-explainer-summary-steps-i-o-risks-complexity-ba9c044f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fLYuNKX7fCAHt8QikSxz6

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 code-explainer-summary-steps-i-o-risks-complexity-ba9c044f -d '<json body>'
```

Example prompt: Can you explain this Python function to me — give me a plain-English summary, walk through it step by step, tell me what it takes as input and what it returns, flag any visible risks, and rate how complex it is? Here's the code: [paste code here]

## When to prefer this

Choose this endpoint when you need a multi-dimensional explanation of a code snippet covering not just what it does but also step-by-step logic, I/O contract, risk flags, and complexity — rather than a simple one-liner description. Particularly useful for code review workflows, onboarding, documentation generation, or educating non-technical stakeholders. Supports up to 12,000 characters of code and optionally accepts a language hint for more accurate results.

## Known failure modes

- Code exceeds 12,000 character limit — returns an error or truncated analysis
- Unsupported or ambiguous language without the optional language field — may produce less accurate results
- Highly obfuscated or minified code may yield a shallow explanation
- Network or payment failure via x402 protocol — call is not executed

## How this service works

Explain code: summary, step-by-step, inputs/outputs, visible risks, complexity — Genesis402 / UnyKorn Operator Network

## Output

Returns a structured explanation of the submitted code including: a high-level summary of purpose, a step-by-step walkthrough of the logic, descriptions of inputs and outputs, any visible risks (e.g. security vulnerabilities, error-prone patterns), and a complexity assessment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "code": {
     "type": "string",
     "description": "required, up to 12,000 chars"
    },
    "language": {
     "type": "string",
     "description": "optional"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "code-explain",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.006,
   "receipt_id": "g402-<16hex>"
  },
  "sources": [
   {
    "ok": true,
    "name": "<source>"
   }
  ],
  "limitations": "<text>",
  "generated_at": "<iso time>",
  "evidence_hash": "sha256:<64hex>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code-explainer-summary-steps-i-o-risks-complexity-ba9c044f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
