# Code Agent – Audit Diff (AI Code Review via x402)

> Code Agent – Audit Diff (AI Code Review via x402) is a paid API for AI agents from code.mamenesia.com, paid per call via x402, $0.25/call, status unknown (last checked 2026-09-14).

Reviews a unified diff using AI (GLM-5.2) and returns actionable code review feedback, paid per-request in USDC on Base via the x402 protocol.

## Facts

- Endpoint: POST https://code.mamenesia.com/service/audit-diff
- Price: $0.25/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code-agent-audit-diff-ai-code-review-via-x402-46a06fd2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kL-RG_Bra74ofl2mjHWaj

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-agent-audit-diff-ai-code-review-via-x402-46a06fd2 -d '<json body>'
```

Example prompt: Can you review this unified diff from my feature branch and flag any bugs, security issues, or style problems? The code is Python: [paste diff here].

## When to prefer this

Choose this endpoint when you need a pay-per-use, no-subscription AI code review of a specific unified diff, especially in automated pipelines or agentic workflows that support x402 micropayments on Base. It is particularly useful for teams wanting per-commit or per-PR AI review without a recurring SaaS subscription, or for agents that need to programmatically audit diffs as part of a CI/CD or code quality workflow.

## Known failure modes

- Missing or empty 'diff' field returns a validation error
- Malformed unified diff may produce incoherent or empty review output
- Insufficient USDC balance or failed x402 payment results in a 402 Payment Required response
- Overly large diffs may exceed token limits, causing truncation or error
- Invalid language hint may be ignored rather than causing failure

## 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 AI-generated code review as a code string, the model used (glm-5.1), the number of tokens consumed, the x402 transaction hash, and the service name confirming 'audit-diff'.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "diff": {
   "type": "string",
   "pattern": "\\S"
  },
  "language": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "paid": "0.25 USDC",
  "result": {
   "code": "## Findings\n- High: arithmetic regression",
   "model": "glm-5.2"
  },
  "service": "audit-diff"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code-agent-audit-diff-ai-code-review-via-x402-46a06fd2/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)
