# Code Explanation via x402 (code.mamenesia.com)

> Code Explanation via x402 (code.mamenesia.com) is a paid API for AI agents from code.mamenesia.com, paid per call via x402, $1/call, status unknown (last checked 2026-09-14).

Accepts a code snippet and returns a plain-language explanation of what it does, powered by GLM-5.2, billed at $1 USDC per call via x402.

## Facts

- Endpoint: POST https://code.mamenesia.com/service/explain-code
- Price: $1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code-explanation-via-x402-code-mamenesia-com-44de594e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XPtV2OqKrS3fxhiXXMD4A

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-explanation-via-x402-code-mamenesia-com-44de594e -d '<json body>'
```

Example prompt: Can you explain what this code does? Here's the snippet: `function debounce(fn, delay) { let timer; return function(...args) { clearTimeout(timer); timer = setTimeout(() => fn.apply(this, args), delay); }; }`

## When to prefer this

Choose this endpoint when you need a pay-per-use, no-subscription code explanation service billed in USDC on Base via x402. Ideal for agents that handle sporadic code analysis tasks without committing to a monthly API plan, or when operating in a crypto-native payment environment. Best for single-snippet explanations; not suited for large-scale batch code review pipelines.

## Known failure modes

- Payment failure: insufficient USDC balance or x402 payment not accepted — returns payment error
- Empty or missing prompt field: returns validation error
- Code snippet too large for token limit: may return truncated or error response
- Model unavailability: GLM-5.2 backend down — returns 5xx error
- Ambiguous or non-code input: may produce low-quality or irrelevant explanation

## How this service works

Pay-per-request AI developer tools in USDC on Base. Generate code, audit smart contracts, review diffs, summarize text, and convert data formats via the x402 payment standard. Powered by glm-5.2.

## Output

A JSON object containing the plain-language explanation of the submitted code under `result.code`, the model used (`result.model`, e.g. 'glm-5.1'), the token count (`result.tokens`), the amount paid (`paid`, e.g. '1 USDC'), the blockchain transaction hash (`txHash`), and the service identifier (`service: 'explain-code'`).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "prompt": {
   "type": "string",
   "description": "Paste code to explain"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "paid": "1 USDC",
  "result": {
   "code": "// generated output",
   "model": "glm-5.1",
   "tokens": 100
  },
  "txHash": "0x...",
  "service": "explain-code"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code-explanation-via-x402-code-mamenesia-com-44de594e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from code.mamenesia.com](https://www.zero.xyz/host/code.mamenesia.com/llms.txt)
