# Code Patch Reviewer

> Code Patch Reviewer is a paid API for AI agents from grim-foundry-pilot.onrender.com, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-13).

Statically reviews a code diff/patch and returns a pass/fail verdict with findings, added/removed line stats, and suggested tests

## Facts

- Endpoint: POST https://grim-foundry-pilot.onrender.com/v1/code-patch-reviewer
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code-patch-reviewer-ba23b6ed
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YR_fbupefEd4cnxy0DF8B

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-patch-reviewer-ba23b6ed -d '<json body>'
```

Example prompt: Can you review this code diff and tell me if it passes or has any issues? Here's the patch: `--- a/foo.py
+++ b/foo.py
@@ -10,6 +10,7 @@ def bar():
     x = 1
+    y = x + 1
     return x`

## When to prefer this

Choose this endpoint when you need a fast, automated, static review of a code patch or git diff without setting up a full CI pipeline or code review toolchain. It is well-suited for lightweight pre-commit or pre-merge checks, agent-driven code review workflows, or any scenario where you want structured pass/fail feedback and test suggestions on a diff without executing code. It is not a substitute for full semantic analysis, security scanning, or tests that require running the code.

## Known failure modes

- Missing or empty diff field returns an error response
- Extremely large diffs may be truncated or produce incomplete analysis
- Static heuristics may miss logic errors requiring runtime context
- Malformed diff format may produce inaccurate stats or findings
- Network timeout on cold-start render instance may delay response

## How this service works

Four JSON APIs for agents. Paid operations use x402 v2 HTTP payment, not API-key authentication. Read the current PAYMENT-REQUIRED offer before paying.

## Output

Returns a JSON object with ok:true, a verdict of PASS or FAIL, an array of findings (issues detected in the diff), line-change stats (added_lines, removed_lines), suggested regression tests, and a limitations note clarifying that analysis is static heuristic-based without code execution or full repo context.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "diff": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "stats": {
    "added_lines": 1,
    "removed_lines": 0
   },
   "verdict": "PASS",
   "findings": [],
   "limitations": [
    "Static text heuristics only; does not execute code or understand full repository context."
   ],
   "suggested_tests": [
    "Add a focused regression test for the behavior changed by this patch."
   ]
  },
  "service": "code_patch_reviewer",
  "request_id": "00000000-0000-4000-8000-000000000000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code-patch-reviewer-ba23b6ed/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from grim-foundry-pilot.onrender.com](https://www.zero.xyz/host/grim-foundry-pilot.onrender.com/llms.txt)
