# PatchProof API – Deterministic Failure Diagnosis

> PatchProof API – Deterministic Failure Diagnosis is a paid API for AI agents from patchproof-api.krlosrdz.chatgpt.site, paid per call via x402, $0.25/call, status unknown (last checked 2026-09-14).

Analyzes Python or TypeScript code errors to deterministically identify failure type, pinpoint location, and produce a structured fix plan with confidence score.

## Facts

- Endpoint: POST https://patchproof-api.krlosrdz.chatgpt.site/api/v1/diagnose
- 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/patchproof-api-deterministic-failure-diagnosis-3dcf6726
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_f1FtoXgXhhSqcjYUgncN7

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 patchproof-api-deterministic-failure-diagnosis-3dcf6726 -d '<json body>'
```

Example prompt: I'm seeing error TS2322 in src/billing.ts around line 31 — can you run a deterministic diagnosis on that TypeScript failure, give me the exact location, a fix plan, and a confidence score?

## When to prefer this

Choose this endpoint when you need deterministic, structured code failure diagnosis specifically for Python or TypeScript — particularly when you need a machine-readable fix plan, exact line-level error location, and regression test suggestions in a single call. Prefer it over generic LLM code review when reproducibility, confidence scoring, and structured output are required for automated pipelines or CI/CD workflows.

## Known failure modes

- Unsupported language submitted (only Python and TypeScript are supported) — likely 4xx error
- Malformed or missing code/error payload — 400 Bad Request
- Insufficient context provided to determine location — lower confidence score returned
- Payment not processed or USDC balance insufficient — 402 Payment Required
- Ambiguous error signal preventing deterministic diagnosis — low confidence result with partial fix plan

## How this service works

Deterministic Python and TypeScript failure diagnosis for AI agents, paid per request with USDC.

## Output

Returns a JSON object containing: the failure type (e.g. 'type-safety'), the exact file/line/column location of the error, the primary signal (e.g. 'error TS2322'), a confidence score (0–1), a list of fix plan steps, suggested regression tests, and safety metadata indicating whether code was executed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "trace": {
   "type": "string",
   "maxLength": 8192,
   "minLength": 12,
   "description": "Python or TypeScript failure trace"
  },
  "language_hint": {
   "enum": [
    "python",
    "typescript",
    "javascript",
    "auto"
   ],
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "safety": {
   "retained": false,
   "code_executed": false
  },
  "fix_plan": [
   "Identify whether the producer violates its declared contract."
  ],
  "location": {
   "file": "src/billing.ts",
   "line": 31,
   "column": 12
  },
  "confidence": 0.96,
  "failure_type": "type-safety",
  "primary_signal": "error TS2322",
  "regression_tests": [
   "Add a focused test for the missing or invalid variant."
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/patchproof-api-deterministic-failure-diagnosis-3dcf6726/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from patchproof-api.krlosrdz.chatgpt.site](https://www.zero.xyz/host/patchproof-api.krlosrdz.chatgpt.site/llms.txt)
